<?php
	//Connects to your Database
	include "../db_connection/db_connection.php";
	include "../config/config.php";		
	$party_id	=	base64_decode(base64_decode(base64_decode($_GET['party_id']))); 
	$bal_amt	=	base64_decode(base64_decode(base64_decode(base64_decode($_GET['bal_amt']))));
	
	$pag_id = base64_encode(base64_encode(base64_encode(base64_encode(1))));  
	
	$SLCT_tp = "SELECT * FROM party_det WHERE party_det_id = '$party_id'";
	//echo $SLCT_tp;
	$QURY_tp = mysqli_query($connect,$SLCT_tp);
	$FTCH_tp = mysqli_fetch_object($QURY_tp);
	$mobile_no=$FTCH_tp->con_no_1;
	$cli_emailid = $FTCH_tp->email_id_1;
	$com_name 	=	$FTCH_tp->cmp_name;
	
	include "../mail/reminder_temp_mail.php";
	//echo $mail_body;
	$tto=$cli_emailid;
	$subject="Reg:Payment Remainder";
	$headers = "MIME-Version: 1.0" . "\r\n";
	$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
	// More headers
	$headers .= 'From: Thahaayaa Accounts <accounts@thahaayaa.com>' . "\r\n";		
	$headers .= 'Bcc:'.$cc_id. "\r\n";	
	
	mail("$tto",$subject,$mail_body,$headers);
	//echo $mail_body;
	
	if($mobile_no!='')
	{
		$to  = $mobile_no;
		$sms = "Dear Sir,We are accept Rs500 & Rs1000 Currency Notes,Kindly Use this Wonderful Chance to Clear your balance Rs.".$bal_amt."/- Thahaayaa Accounts Dept 9843018906";
		$sms_url   	= 	sprintf($sms_domain, $workingkey, $to , $senderid, urlencode($sms));
		$rslt = openurl($sms_url);
		//echo $rslt;
	}                 
	//exit;
?>
<script type="text/javascript">
	//alert("Data inserted successfully");
	//history.back();
	window.location='../balance_list.php?page_id=<?php echo $pag_id; ?>';
</script>
