<?php
//echo "<pre>";print_r($_REQUEST);
?>
<script>
    var headPrint='<div class="headPrint"><img src="<?php echo $LinksDetails["logo"] ?>" height="60px"><h1><?php echo ucfirst(trim($LinksDetails["site_name"])) ?></h1></div>';
	var root='<?php echo URL_ROOT ?>';
	</script>
<script type="text/javascript" src="<?php echo URL_ROOT ?>js/jquery-1.9.1.js"></script>
<link href='<?php echo URL_ROOT ?>assets/css/print.css' rel='stylesheet'>
<script type="text/javascript" src="<?php echo URL_ROOT ?>js/custom.js"></script>
<?php 
include("../db.php");

?>

<style>
.recept {
font-weight: bold;
font-size: 20px;
color: #FC0D0D;
}
.headprint .logo{
	margin: -5px 10px 0px 0px !important;
}
</style>

<form method="post" action="" id='printMe'>

<div style="display:flex;">
<div style="width:49%; border: 4px solid black;background: #C1CCD8;">
<div class="headPrint" style="background: #C1CCD8; border-bottom: 4px solid black;"> 
<table width="100%">
        <tr>
          <td width="10%"><img style="top:3px;position:relative;" src="<?php echo $LinksDetails["logo"] ?>" class="logo" height="50px" width="70px"></td>
           <td  style="text-align:center"><h5 style="margin:0; padding:0;"><?php echo ucfirst($LinksDetails["site_name"]) ?></h5>
            <span style="text-align:center;font-size:13px;"><?php echo ucfirst(nl2br($LinksDetails["contact_content"])); ?></span>
			</td>
        </tr>
      </table>
  </div>
  <?php $id= $_REQUEST['id'];
         $aryForm= $db->getRow("select * from transaction where id='".$id."'");

  ?>
<table width="100%" style='background: #C1CBD8;font-size:12px;'>
    <tr>
        <td width="20%"><strong>R.No.</strong></td><td><span class="recept"><?= $aryForm['exp_id'] ?></span></td>
        
       
		<td width="20%"><strong>Date</strong></td><td><?php echo date("d-m-Y"); ?></td>
		
    </tr>
    <tr>
        <td><strong>Exp mode</strong></td><td><?php echo $aryForm["tfor"]; ?></td>
       <td><strong>Issued By</strong></td><td><?php 
		$addb=$_SESSION["admin"]["uid"];
		if(isset($_REQUEST["receiptid"]))$addb=$db->getVal("select added_by from receipt where id=".$_REQUEST["receiptid"]);
		echo $db->getVal("select name from users where id=".$addb);
		//echo $db->getLastQuery();
		 ?></td>
     
    </tr>
    
    
    
	<tr>
    <td colspan="4">
    
<?php
echo "<table width='100%' border='1'>
<tr>
	<th>Sr. No</th><th>Exp Detail</th><th>Paid</th>
</tr>";

 ?>

	<tr style="text-align:center;">
            <td><?php  //echo $i;?></td><td ><?php echo  chop($aryForm['detail'], $aryForm['tfor'] ) ?></td><td><?= $aryForm['amount'] ?></td>
        </tr>	

	<tr><th></th><th>Total Paid Amount</th><th><?= $aryForm['amount'] ?></th></tr>
	<?php
	
echo "</table><hr/><div class='footerPrint'><span>Signature...............................</span></div>";//.$isAlreadyEntry;

	echo '<input style="background: firebrick;color: white;height: 26px;width: 53px;border: 2px inset snow;border-radius: 10px;" type="button"  onclick="printDivNoHeader(\'printMe\')" value="Print">';

?>
	</td></tr>
</table>
<span style="color:red;text-align:center;font-size:14px;"><?php echo "[" ?>Note : If any correction,Please consult to fee counter.<?php echo "]" ?></span>
</div>
<!--<br/><br/><br/><div style="border-top:3px dotted black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><br/><br/>-->
<div style="width:49%;float:left;margin-left:10px;border: 4px solid black;background: #C1CCD8;">
<div class="headPrint" style="background: #C1CCD8;border-bottom: 2px solid black;"> <table width="100%">
        <tr>
          <td width="10%"><img style="top:3px;position:relative;" src="<?php echo $LinksDetails["logo"] ?>" class="logo" height="50px" width="70px"></td>
           <td  style="text-align:center"><h5 style="margin:0; padding:0;"><?php echo ucfirst($LinksDetails["site_name"]) ?></h5>
            <span style="text-align:center;font-size:13px;"><?php echo ucfirst(nl2br($LinksDetails["contact_content"])); ?></span>
			</td>
        </tr>
      </table></div>
      <table width="100%" style='background: #C1CBD8;font-size:12px;'>
    <tr>
        <td width="20%"><strong>R.No.</strong></td><td><span class="recept"><?= $aryForm['exp_id'] ?></span></td>
        
       
		<td width="20%"><strong>Date</strong></td><td><?php echo date("d-m-Y"); ?></td>
		
    </tr>
    <tr>
        <td><strong>Exp mode</strong></td><td><?php echo $aryForm["tfor"]; ?></td>
       <td><strong>Issued By</strong></td><td><?php 
		$addb=$_SESSION["admin"]["uid"];
		if(isset($_REQUEST["receiptid"]))$addb=$db->getVal("select added_by from receipt where id=".$_REQUEST["receiptid"]);
		echo $db->getVal("select name from users where id=".$addb);
		//echo $db->getLastQuery();
		 ?></td>
     
    </tr>
   
    
   
    
	<tr>
    <td colspan="4">
    
<?php
echo "<table width='100%' border='1'>
<tr>
	<th>Sr. No</th><th>Exp Detail</th><th>Paid</th>
</tr>";

 ?>

	<tr style="text-align:center;">
            <td><?php  //echo $i;?></td><td ><?php echo  chop($aryForm['detail'], $aryForm['tfor'] ) ?></td><td><?= $aryForm['amount'] ?></td>
        </tr>	

	<tr><th></th><th>Total Paid Amount</th><th><?= $aryForm['amount'] ?></th></tr><?php 
echo "</table><hr/><div class='footerPrint'><span>Signature...............................</span></div>";//.$isAlreadyEntry;

?>
	</td></tr>
</table>
<br/>
<span style="color:red;text-align:center;font-size:14px;"><?php echo "[" ?>Note : If any correction,Please consult to fee counter.<?php echo "]" ?></span>
</div>
</div>
</form>

<script>
function checkreceptNo(id){
	$.post( "<?php echo URL_ROOT ?>ajax.php", { 
			type: "checkreceptNo" ,
			paytype: '<?php echo $_REQUEST["type"] ?>',
			id: id
		} , function( data ) {
		data=data.trim();
		if(data==""){
			$("#saveprintme").click();
		}
		else{
			alert("receipt id already exit");
		}
	});
}
</script>