<?php  session_start(); error_reporting(0); 
if(isset($_SESSION['j_admin'])){ 
require_once("../j_conn/url.php");
require_once("../j_conn/dbc.php");
require_once("../j_incs/functions.php");
if(isset($_GET['t_id'])){
 $transact_id =RMC($_GET["t_id"]);       
 $b_url =urldecode($_GET["b_url"]);       
if(!empty($transact_id)  
){ //check if required field is not empty
//get the email of the user to confirm
//#######################################
$admin_username = $username;
$admin_name = $name;
$sql255x="SELECT * from j_users WHERE 
j_id='".$transact_id."' AND j_status < 1"; //  
$result255x = runSQL($sql255x);
$data255x = mysqli_fetch_array($result255x);
$user_name = $data255x['j_firstname'];
$user_lastname = $data255x['j_lastname'];
$username= $data255x['j_id'];
$main_username= $data255x['j_username'];
$user_id= $data255x['j_id'];
$user_status = $data255x['j_deleted'];
if(!empty($username)){
	if($user_status<1){
		$status="1";
		$status_info="Deleted";
	}else{
		$status="1";
		$status_info="Deleted";
	}
	$sql5="UPDATE j_users SET j_deleted='".$status."' WHERE j_id='".$username."'";
	$result5=runSQL($sql5); 
	if($result5){
        $u_subject ="Account $status_info";
        $u_message ="Hello $company;
        <br>
        Please be informed that Admin : <b>$admin_username ($admin_name)</b> has $status_info <b>$main_username ($user_name $user_lastname)</b>'s Account.
        ";
        echo $u_message;
        //send-notify to admin
        send_notify("",$id,$u_subject,$u_message);
        //send notify to user
        $u_message ="Hello $user_name $user_lastname;
        <br>
        Please be informed that your account has been $status_info.
        <br><br>
         For more info; Feel free to contact us via $company_email
        ";
        send_notify("",$user_id,$u_subject,$u_message);
        //
        $url="".$b_url."";
        echo '<script type="text/javascript">';
        echo 'window.location.href="'.$url.'";';
        echo '</script>';
        echo '<noscript>';
        echo '<meta http-equiv="refresh" content="0;url='.$url.'" />';
        echo '</noscript>';	
}}}}}