<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cheque Display</title>
</head>


<body>

<style type="text/css">
<!--




</style>



<?php
session_start();
include './connection_sql.php';
if ($_SESSION["CURRENT_USER"] == "") { 
    exit('Please Logging Again..');
} 
if ($_SESSION['company'] == "") { 
    exit('Please Logging Again..');
} 
 
	//$ResponseXML = "";
	//$ResponseXML .= "<salesdetails>";
	$_GET['txt_bea'] = "Test Barer";
	$txt_bea=str_replace("~", "&", $_GET['txt_bea']);
	
	$sql="select * from a_cheque_setup where bank_code='" . trim($_GET["com_bank"]) . "'";
//        echo $sql;
	foreach ($conn->query($sql) as $row) {
		echo "<style type=\"text/css\">

.cl".$row["id"]." {
	font-size: ".$row["font_size"]."px;
	left:".$row["left_loc"]."px;
	top:".$row["top_loc"]."px;
	font-family:".$row["font_name"].";
	position:absolute;
}
</style>";
	
	$name="cl".$row["id"];
                $_GET["chqdate"] = date("Y-m-d");
		if ($row["id"]=="1"){
			echo "<div  id=\"".$row["font_name"]."\" class=\"".$name."\" />".substr($_GET["chqdate"], 2, 1)."</div>";
		}
		
		if ($row["id"]=="2"){
			echo "<div  id=\"".$row["font_name"]."\" class=\"".$name."\" />".substr($_GET["chqdate"], 3, 1)."</div>";
		}	
		
		if ($row["id"]=="3"){
			echo "<div  id=\"".$row["font_name"]."\" class=\"".$name."\" />".substr($_GET["chqdate"], 5, 1)."</div>";
		}
		
		if ($row["id"]=="4"){
			echo "<div  id=\"".$row["font_name"]."\" class=\"".$name."\" />".substr($_GET["chqdate"], 6, 1)."</div>";
		}	
		
		if ($row["id"]=="5"){
			echo "<div  id=\"".$row["font_name"]."\" class=\"".$name."\" />".substr($_GET["chqdate"], 8, 1)."</div>";
		}
		
		if ($row["id"]=="6"){
			echo "<div  id=\"".$row["font_name"]."\" class=\"".$name."\" />".substr($_GET["chqdate"], 9, 1)."</div>";
		}	
		
		if ($row["id"]=="7"){
	
			$_GET["Check1"]="true";
			if ($_GET["Check1"]=="true"){
				echo "<div  id=\"".$row["font_name"]."\" class=\"".$name."\" />A/C Payee Only</div>";
			}	
		}	
		
		if ($row["id"]=="9"){
			echo "<div  id=\"".$row["font_name"]."\" class=\"".$name."\" />".$txt_bea."</div>";
		}
		
		if ($row["id"]=="10"){
                        $_GET["txt_amoinword"] = "Three Thousand Four Hundred Only";
			echo "<div  id=\"".$row["font_name"]."\" class=\"".$name."\" />".$_GET["txt_amoinword"]."</div>";
		}
		
		if ($row["id"]=="12"){
                        $_GET["TXT_DEBTOT"] = 3400;
			echo "<div  id=\"".$row["font_name"]."\" class=\"".$name."\" />".number_format($_GET["TXT_DEBTOT"], 2, ".", ",")."</div>";
		}	
	}

 ?>   

</body>
</html>
