<?php 
$admin_toast_alert = "";
$special = new special;
if(isset($_POST['update_wallet'])){
$admin_toast_alert = $special->updateWallet($_POST);
}
if(isset($_POST['update_balance'])){
$admin_toast_alert = $special->wallet_balance($_POST['new_balance'],$_POST['investment_email']);
}
if(isset($_POST['update_profit'])){
$admin_toast_alert = $special->total_profit($_POST['new_balance'],$_POST['investment_email']);
}
if(isset($_POST['update_rank'])){
$admin_toast_alert = $special->update_rank($_POST['user_rank'],$_POST['investment_email']);
}
if(isset($_POST['validate_acct'])){
$admin_toast_alert = $special->validate_acct($_POST['investment_email']);
}
if(isset($_POST['acct_status'])){
$admin_toast_alert = $special->acct_status($_POST['investment_email'],$_POST['acct_status']);
}
if(isset($_POST['Action'])){
    $admin_toast_alert = $special->updateTransaction($_POST);
}
if(isset($_POST['update_loan'])){
    $admin_toast_alert = $special->updateLoanStatus($_POST);
}
if(isset($_POST['update_connect_info'])){
    $admin_toast_alert = $special->updateWCdata($_POST);
}
// if(isset($_POST['denyAction'])){
//     $admin_toast_alert = $special->updateTransaction($_POST);
// }
// $unique_admin_id = $_SESSION['unique_admin_id'];
// if(isset($_POST['gen_pin'])){
// 	$new_pin = rand(0000,9999);
// 	$sendtoData = "UPDATE admin_access SET i_pin = '$new_pin' WHERE admin_email = '$unique_admin_id'";
// $querytoData = mysqli_query($cxn, $sendtoData);
// }
// if(isset($_POST['gen_otp'])){
// 	$new_otp = rand(00000,99999);
// 	$sendtoData = "UPDATE admin_access SET otp = '$new_otp' WHERE admin_email = '$unique_admin_id'";
// $querytoData = mysqli_query($cxn, $sendtoData);
// }
// if(isset($_POST['gen_w_access'])){
// 	$w_access = rand(00000,99999);
// 	$sendtoData = "UPDATE admin_access SET access_token = '$w_access' WHERE admin_email = '$unique_admin_id'";
// $querytoData = mysqli_query($cxn, $sendtoData);
// }
// if(isset($_POST['gen_w_transferPin'])){
// 	$w_transferPin = rand(0000,9999);
// 	$sendtoData = "UPDATE admin_access SET transfer_pin = '$w_transferPin' WHERE admin_email = '$unique_admin_id'";
// $querytoData = mysqli_query($cxn, $sendtoData);
// }
// if(isset($_POST['ch_wa_number'])){
// 	$wa_numberx = $_POST['wa_number'];
// 	$sendtoData = "UPDATE admin_access SET wa_number = '$wa_numberx' WHERE admin_email = '$unique_admin_id'";
// $querytoData = mysqli_query($cxn, $sendtoData);
// }
// if(isset($_POST['ch_tele_number'])){
// 	$tele_numberx = $_POST['tele_number'];
// 	$sendtoData = "UPDATE admin_access SET tele_number = '$tele_numberx' WHERE admin_email = '$unique_admin_id'";
// $querytoData = mysqli_query($cxn, $sendtoData);
// }

// $getdata = "SELECT * FROM admin_access WHERE admin_email = '$unique_admin_id'";
// $querytogetData = mysqli_query($cxn, $getdata);
// if($querytogetData){
// 	$getmydata = mysqli_fetch_assoc($querytogetData);
// 	$getmydata_btc_id = $getmydata['wallet_id'];
// 	$getmydata_bch_id = $getmydata['bch_wallet_id'];
// 	// $getmydata_btc_id = $getmydata['wallet_id'];
// 	$_SESSION['spec_wallet_id'] = $getmydata_btc_id;
// 	$getmydata_eth_id = $getmydata['eth_id'];
// 	$getmydata_USDT_id = $getmydata['USDT_id'];
// 	$i_otp = $getmydata['otp'];
// 	$i_pin = $getmydata['i_pin'];
// 	$w_transferPin = $getmydata['transfer_pin'];
// 	$wa_number = $getmydata['wa_number'];
// 	$tele_number = $getmydata['tele_number'];
// 	$w_access = $getmydata['access_token'];
// 	$wallet_qrcode = '<img src="images/qrcode/'.$getmydata['wallet_qrcode'].'" height="200px" width="200px" >';
// 	$wallet_qrcode_bch = '<img src="images/qrcode/'.$getmydata['wallet_qrcode_bch'].'" height="200px" width="200px" >';
// 	$wallet_qrcode_eth = '<img src="images/qrcode/'.$getmydata['wallet_qrcode_eth'].'" height="200px" width="200px" >';
// 	$wallet_qrcode_USDT = '<img src="images/qrcode/'.$getmydata['wallet_qrcode_USDT'].'" height="200px" width="200px" >';
// }else{
// 	$getmydata_id = '';
// 	$wa_number = '';
// 	$tele_number = '';
// 	$i_otp = 'Generate OTP';
// 	$i_pin = 'Generate PIN';
// 	$w_transferPin = 'Generate PIN';
// 	$w_access = 'Generate TOKEN';
// 	$wallet_qrcode = 'No QR CODE yet!';
// 	$wallet_qrcode_bch = 'No QR CODE yet!';
// 	$wallet_qrcode_eth = 'No QR CODE yet!';
// 	$wallet_qrcode_USDT = 'No QR CODE yet!';
// }


// $alert_msg = '';
// $unique_admin_id = $_SESSION['unique_admin_id'];
// $search_data = false;

//    if(isset($_POST['search_post_name'])){
//        $search_post_name = $_POST['search_post_name'];
//   $get_data_post = "SELECT * FROM new_customer";
//   $query_data_post = mysqli_query($cxn, $get_data_post);
//   $gather_search_id = [];
//   while($search_result = mysqli_fetch_assoc($query_data_post)){
//       if(strlen(stristr($search_result['customer_name'], $search_post_name)) > 0){
//           array_push($gather_search_id,$search_result);
//       }
//   }
//   if(count($gather_search_id) == 0){
//       $search_data = false;
//   }else{     
//       $search_data = true;
//   }
//   }
//   if(isset($_REQUEST['enable_acct'])){
//       $dclient_email = $_REQUEST['enable_acct'];
//           $get_data_post = "UPDATE new_customer SET active_account = 'true' WHERE customer_email = '$dclient_email'";
//           $query_data_post = mysqli_query($cxn, $get_data_post);
//   }
//       if(isset($_REQUEST['disable_acct'])){
//       $dclient_email = $_REQUEST['disable_acct'];
//           $get_data_post = "UPDATE new_customer SET active_account = 'false' WHERE customer_email = '$dclient_email'";
//           $query_data_post = mysqli_query($cxn, $get_data_post);
//   }
      function format_d_date($d_date){
      $gmydate = date_create_from_format('Y-m-d H:i:s', $d_date);
       return date_format($gmydate, 'jS M Y g:ia');
      }

      global $admin_toast_alert;
?>