<?php
session_start();
ob_start();
 include "../config/config.php"; 
 include "../config/function.php"; 
 
 $private_key=get_privatekey($_SESSION['admin_name']);
 $request_from_server=$_SERVER['HTTP_REFERER'];
$this_server=$_SERVER['HTTP_HOST'];
if($request_from_server!=''){
	check_access_url($request_from_server,$this_server);
}

// echo $_SESSION['login_status'];echo "<br>";
// echo $_SESSION['private_key'];echo "<br>";
// echo $_SESSION['admin_name'];echo "<br>";

if($_SESSION['login_status']!='YES' || $_SESSION['private_key']!=$private_key || $_SESSION['private_key']=='' || $_SESSION['admin_name']=='')
{
	header("Location:../AppLogin");
	exit();
}
else
{
    $payment_date=date("Y-m-d");
  echo "Post". $openStatus=RemoveSpecialChar($_POST['openStatus']);
    if($openStatus=='on')
   {
       $status=1;
       mysqli_query($connection,"Update  tbl_member_income_dtails set paid_status=1,payment_date='$payment_date' where paid_status=0");
   }
   else
   {
       $status=0;
   }
   echo "<br>". $Inst="Update  tbl_setting set openStatus=$status";
   mysqli_query($connection,$Inst) ;
} 
header("Location:../ClossingStatus");
?>