<?php session_start(); error_reporting(0); 
//if session
if(isset($_SESSION['j_admin'])){ }else{ 
    die(
    "
    <div class='alert alert-danger'> Please login. Try again.</div>
    "
    );
} 
require_once("../j_conn/url.php");
require_once("../j_conn/dbc.php");
require_once("../j_incs/functions.php");
$date_sm = $CurrentDate;
$wallet_type = $currency_in_use;
//
$ref = RMC($_GET['ref']);
$status = RMC($_GET['s']);

$sql25="SELECT * from j_pays WHERE 
j_deleted < 1 AND j_kind='Fund Wallet' AND j_id='".$ref."' order by j_id desc"; 
$result25 = runSQL($sql25);
$data25 = mysqli_fetch_array($result25);
$ref = $data25['j_id'];
$deposit_id = $data25['j_id'];
$plan_id = $data25['j_package'];
$user_id = $data25['j_user_id'];
$referrer_id = $data25['j_referrer_id'];
$p_status = $data25['j_status'];
$amount = $data25['j_amount'];
$currency = $data25['j_currency'];
$duration = $data25['j_duration'];
$r_ref = $data25['j_transact_id'];
/*
$sql4X="SELECT * from plans WHERE id='".$plan_id."'"; //check 
$result4X = runSQL($sql4X);
$data4X = mysqli_fetch_array($result4X);
$plan = $data4X['title'];
$duration = $data4X['duration'];
*/


$sql4X="SELECT * from j_users WHERE j_id='".$user_id."'"; //check 
$result4X = runSQL($sql4X);
$data4X = mysqli_fetch_array($result4X);
$name = $data4X['j_firstname'];
//									
	/*
	$period = "1 day";  
	$next_pay_date= date('Y-m-d', strtotime($CurrentDate. ' +'.$period.''));
	
	//die("$p_next_pay_date = $next_pay_date = $amount_t = $amount_d");
	*/
if(!empty($deposit_id)){
	$u6_amount = $amount;
	/*
	if($status=="Approved"){ require_once("approved.php"); }
	if($status=="waiting for confirmation"){ require_once("waiting-for-confirmation.php"); }
	if($status=="waiting for payment"){ require_once("waiting-for-payment.php"); }
	*/
	if($status=="Cancel"){ require_once("cancel.php"); }
	if($status=="Approve"){ require_once("approve.php"); }
	if($status=="Activate"){ require_once("activate.php"); }
	//die("$amount $duration $p_status");
	//if($status=="delete"){ require_once("delete.php"); }
}
?>