<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript" src="jquery-barcode.js"></script>
<?php
//include('barcode/barcode.inc.php');
//include('barcode/BarcodeGenerator.php');
//include('barcode/BarcodeGeneratorHTML.php');
include('../db_con.php');
include('methodlist.php');

$res = mysqli_query($con,"select app_id, surname, givenname, passport_no, visa_type, total_fee, v_uid, refer_no from applicant_table where app_id='$_GET[appid]'");
$resrow=mysqli_fetch_array($res);

$gname=$resrow["givenname"];
$sname=$resrow["surname"];
$code=$resrow["refer_no"];
$passport=$resrow["passport_no"];
$visatypename=get_visatype_name($resrow["visa_type"],$con);
$visafee=get_visa_fee($resrow["visa_type"],$con);
$totalfee=$resrow["total_fee"];

echo "<div style='padding: 15px; line-height: 25px; width:250px;'>";

echo "<div style='text-align:center; margin-top:-20px;'>";
echo "<br/><b>Saimon Visa Application Center";
echo "<br/>Application Fee Reciept</b>";
echo "<br/><br/></div>";

echo "<div style='margin-top: -20px; font-size: 14px; line-height: 25px; text-align:left;'>";
echo "<br/><b> Applicant Name: ".$gname." ".$sname."</b>";
echo "<br/><b> Reference No: </b>".$code;
echo "<br/><b> Passport No: </b>".$passport;
echo "<br/><b> Visa Category: </b>".$visatypename;

echo "<br/><b> Visa Fee: </b>".number_format($visafee,2)."/- BDT <br/><br/>";

$child=0;
$countres = mysqli_query($con,"select app_id from  applicant_table where parent='$resrow[app_id]'");
$child=mysqli_num_rows($countres);

if($child>0){

	while($countrow=mysqli_fetch_array($countres)){

		$childres = mysqli_query($con,"select surname, givenname, passport_no, visa_type, refer_no from applicant_table where app_id='$countrow[app_id]'");
		$childrow=mysqli_fetch_array($childres);

		$gname=$childrow["givenname"];
		$sname=$childrow["surname"];
		$code=$childrow["refer_no"];
		$passport=$childrow["passport_no"];
		$visatypename=get_visatype_name($childrow["visa_type"],$con);
		$visafee=get_visa_fee($childrow["visa_type"],$con);
		

		echo "<div style='margin-top: -20px; font-size: 13px; line-height: 25px; text-align:left;'>";
		echo "<br/><b> Applicant Name: ".$gname." ".$sname."</b>";
		echo "<br/><b> Reference No: </b>".$code;
		echo "<br/><b> Passport No: </b>".$passport;
		echo "<br/><b> Visa Category: </b>".$visatypename;

		echo "<br/><b> Visa Fee: </b>".number_format($visafee,2)."/- BDT <br/><br/>";
	}

}

echo "<br/>We acknowledge the receipt of ".number_format($totalfee,2)."/- BDT As Visa Fees on behalf of Royal Thai Embassy, Bangladesh.";
echo "<br/><br/><b>ACKNOWLEDGEMENT: </b>";
echo "<br/><br/>1. All payments are non-refundable.";
echo "<br/>2. All Applicants or the applicants agents acknowledge that is thier responsibilities to ensure that the information on the ICR and visas attached is correct and matched with the passports and to notify Saimon officers about any mistakes or misprints in visas UPON COLLECTING THE PASSPORTS.";
echo "<br/>3. The Royal Thai Embassy and Saimon Group will not bear any responsibilities for any damages or cost of additional expenses(ticket, accommodation, and etc.) caused by the above mentioned mistakes and misprints in visas issued.";

echo "<br/><br/>Applicants Signature <br/> Date:<br/><br/>";

echo "<br/>SO Officers signature: ";
echo "<br/><b> For more information </b> and our disclaimer Please visit www.saimongroup.com 
</br> or Email: info@saimongroup.com
<br/> or Call on: 88-02-9882273-74";

echo "<br/><br/>Proper authorization is mandatory as mentioned on notice board.<br/><br/><br/><br/><br/>";

echo "<br/>Important Note: <br/> The Royal Thai Embassy reserves the rights to withhold any application for further consideration.<br/>";

$child=$child+1;
$sql = "SELECT * FROM `setting_table` order by s_id";
$sresult = mysqli_query($con,$sql);
while($srow = mysqli_fetch_array($sresult)){

	echo "<br/>".$srow["setting_name"]." (x".$child.") :".$srow["value"]*$child."/- BDT ";	
}

echo "<br/><br/> Total Payment Received: ".number_format($totalfee,2)."/- BDT <br/> All the service charges are inclusive of VAT";
//echo "<b> Printed: </b>".$dt->format('Y-m-d H:i:s');
echo "</div>";

?>
