<?php 

// mysql_connect("nbbvicom.fatcowmysql.com","naijavoy_octanig","@bank$");

// custom_mysql_select_db("naijavoy_bank");

$mysqli = new mysqli("nbbvicom.fatcowmysql.com","naijavoy_octanig","@bank$","naijavoy_bank");
if ($mysqli -> connect_errno) {
    echo "Failed to connect to MySQL: " . $mysqli -> connect_error;
    exit();
  }




print_r($_REQUEST['hid']);

	

$r=custom_mysql_query("SELECT * FROM transaction where `id`='".$_POST['hid']."'");

$fetch=custom_mysql_fetch_object($r);

if($fetch->status==1)

{ 

//$sql = custom_mysql_query("UPDATE transaction SET status='0' where `id`='".$_POST['hid']."'");

$sql = custom_mysql_query("UPDATE transaction SET status='1' where `id`='".$_POST['hid']."'");

}

else

{

$sql = custom_mysql_query("UPDATE transaction SET status='1' where `id`='".$_POST['hid']."'");

}

















$sender_email = custom_mysql_fetch_array(custom_mysql_query("select * from act_holder_details where cust_act_number = '".$fetch->act_number."'"));











$email=$sender_email['cust_mail'];









 $to = $email; 

 $headers  = 'MIME-Version: 1.0' . "\r\n";

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

 $headers .= 'From: '.$_REQUEST['visitormail'] . "\r\n";// From

  $subject  =  'Allied Secured Wealth Bank alert' ; //Subject

 $message     = 'Money Deposited To Your Account'; //Enter the Html Tag



if(mail($to,$subject,$message)){

	echo 'mail send ';

	exit;	

	}else{ echo "Mail Not Send";	exit;	

}

















	/*chdir("..");

	include("config/admin-includes.php");

	chdir("ajax");

	$con=new DBConnection(host,user,pass,db);

	$conObj=$con->connectDB();

	

$sql = custom_mysql_query("UPDATE `latest_list` SET `aprove`='1' where `id`='".$_POST['hid']."'");*/

//echo $_POST['hid'];

//$r=custom_mysql_query("SELECT * FROM latest_list where `id`='".$_POST['hid']."'");

//$fetch=custom_mysql_fetch_object($r);

//$to=$fetch->email_address;

//$subject="thanks to contact us";

//$Secret_Key=sFNBtr(uniqid(),0,8);

//$sql1=custom_mysql_query("UPDATE `latest_list` SET `secretkey`='".$Secret_Key."' where `id`='".$_POST['hid']."'");

//$massege="Your submition is approved";

//$massege="Your submition is approved.Your secret key is ".$Secret_Key." .";

//if(mail($to, $subject, $massege))

	//{

	//echo 'Mail sent after approvation from admin, while updation the respective secret key is to be entered';	

	//}else{ echo "Mail Not Send";	

//}	

?>

