<!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">
<?php include "../header.php";
if(isset($_GET['uid'])){
 $billdetails=$Admin_core->GetRecord("select * from view_workorderbill where md5(id::text)=$1",array($_GET['uid']));
//echo $Admin_core->getlastquerypreview();
} ?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript">
function original()
{
document.getElementById("original").style.display="block";
document.getElementById("duplicate").style.display="none";
document.getElementById("triplicate").style.display="none";
}

function duplicate()
{
document.getElementById("original").style.display="none";
document.getElementById("duplicate").style.display="block";
document.getElementById("triplicate").style.display="none";
}


function triplicate()
{
document.getElementById("original").style.display="none";
document.getElementById("duplicate").style.display="none";
document.getElementById("triplicate").style.display="block";
}

</script>


</head>

<body>

    <div class="col-sm-10">
    <div class="row">
  <div class="col-md-12 col-sm-12 col-xs-12">
  <div class="panel">
  <div class="panel-heading"><strong>BILL VIEW </strong><span style="float:right"> <a href="workbill_order_list.php" style="color:#333333; text-decoration:none">Go Back</a> </span> </div>
  
  <div id="printableArea">
  <style media="print">

  [background-color] {
        z-index: 0; background:#FFFFFF;
        position: relative;
        -webkit-print-color-adjust: exact !important;
    }

  </style>
  <style>
  h1,h2{ margin:0px;}

table{ border-collapse:collapse; }

.table-bdr tr td{  border-bottom:hidden; border-right:1px #000000 solid }
#table-bdr-in{ border:#333333 solid 1px;}
.st-code{border:#000000 solid 1px; padding:3px; width:120px; float:right; margin-right:5px; border-bottom:none}
#btr-hdn{border:hidden}

  </style>
  <div class="panel" style="text-align:center">
  <span class="btn btn-info" onclick="original()"> Original For Receipient </span>
   <span class="btn btn-primary" onclick="duplicate()"> Duplicate for Supplier/Transporter </span>
    <span class="btn btn-success" onclick="triplicate()"> Triplicate for Supplier </span>
  
  </div>
<div style="width:205mm; height:auto; margin:10px auto; font-family:Calibri;">

<table width="100%" border="0">
  <tr>
    <td height="81" align="center" valign="top">
	<h1>SPARROW SOFTECH PVT. LTD. </h1>
    
	MIG.HI.181 Harmu Housing Colony,Ranchi - 834002, Jharkhand.
</td>
  </tr>
  </table>
<table width="100%" border="1" style="font-size:12px;" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">
	<h2>INVOICE</h2>
	
  <span id="original">Original For Receipient</span> 
  <span id="duplicate" style="display:none">Duplicate for Supplier/Transporter</span> 
  <span id="triplicate" style="display:none">Triplicate for Supplier</span>
  
  	</td>
  </tr>
  <tr>
    <td><table width="100%" border="1" class="table-bdr" cellpadding="0" cellspacing="0" style="border:hidden"> 
      <tr>
        <td width="12%">Reverse Charge </td>
        <td width="2%" align="center" id="btr-hdn">:</td>
        <td width="36%">&nbsp;</td>
        <td width="16%">Transportation Mode </td>
        <td width="2%" align="center" id="btr-hdn">:</td>
        <td width="32%"><?php if($billdetails['trans_mode']<>''){echo $billdetails['trans_mode'];}?></td>
      </tr>
      
      <tr>
        <td>Invoice No </td>
        <td align="center" id="btr-hdn">:</td>
        <td><strong><?=$billdetails['bill_no']?></strong></td>
        <td>Vehicle Number </td>
        <td align="center" id="btr-hdn">:</td>
        <td><?php if($billdetails['vehicle_no']<>''){echo $billdetails['vehicle_no'];}?></td>
      </tr>
      <tr>
        <td>Invoice Date </td>
        <td align="center" id="btr-hdn">:</td>
        <td><strong><?=$Admin_core->IntToDate($billdetails['bill_date']);?></strong></td>
        <td>Date of Supply </td>
        <td align="center" id="btr-hdn">:</td>
        <td><?php if($billdetails['supply_date']<>''){echo $Admin_core->IntToDate($billdetails['supply_date']);}?></td>
      </tr>
      <tr>
        <td>Bill Period </td>
        <td align="center" id="btr-hdn">:</td>
        <td><strong><?=$billdetails['valid_desc']?></strong></td>
        <td></td>
        <td align="center" id="btr-hdn"></td>
        <td></td>
      </tr>
      <tr>
        <td valign="top"  id="table-bdr-in" style="border-right:hidden">State</td>
        <td align="center" valign="top"  id="table-bdr-in">:</td>
        <td  id="table-bdr-in" style="border-left:hidden"><strong> Jharkhand</strong>
  <div class="st-code"> State Code : 20</div></td><td  id="table-bdr-in">Place of Supply</td>
        <td align="center"  id="table-bdr-in" style="border-left:hidden">:</td>
        <td  id="table-bdr-in"  style="border-left:hidden"><?php if($billdetails['supply_place']<>''){echo $billdetails['supply_place'];}?></td>
      </tr>
      <tr>
        <td colspan="6"  id="table-bdr-in">&nbsp;</td>
        </tr>
      <tr>
        <td colspan="3" align="center" id="table-bdr-in">Details of Receiver | Billed to : </td>
        <td colspan="3" align="center" id="table-bdr-in">Details of Consignee | Shipped to : </td>
        </tr>
      <tr>
        <td>Name</td>
        <td align="center" id="btr-hdn" style="border-top:#000000 solid 1px;">:</td>
        <td><strong><?=$billdetails["customer_name"]?></strong></td>
        <td>Name</td>
        <td align="center" id="btr-hdn" style="border-top:#000000 solid 1px;">:</td>
        <td><strong></strong></td>
      </tr>
      <tr>
        <td>Address</td>
        <td align="center" id="btr-hdn">:</td>
        <td><strong><?=stripslashes($billdetails["address"])?></strong></td>
        <td>Address</td>
        <td align="center" id="btr-hdn">:</td>
        <td><strong></strong></td>
      </tr>
      <tr>
        <td>GSTIN</td>
        <td align="center" id="btr-hdn">:</td>
        <td>&nbsp;</td>
        <td>GSTIN</td>
        <td align="center" id="btr-hdn">:</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td valign="top">State</td>
        <td align="center" valign="top" style="border-left:hidden">:</td>
        <td valign="bottom" style="border-left:hidden"><strong><?=$billdetails["state"]?></strong>          <div class="st-code"> State Code : <?=$billdetails["state_code"]?></div></td>
        <td valign="top">State</td>
        <td align="center" valign="top" style="border-left:hidden">:</td>
        <td style="border-left:hidden">&nbsp;
  <div class="st-code">State Code : </div></td></tr>
    </table></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>
	<table width="100%" border="1" class="table-bdr" style="border:hidden">
      <tr>
        <td rowspan="2" id="table-bdr-in">Sr No. </td>
        <td rowspan="2" id="table-bdr-in">Name of Product / Service </td>
        <td rowspan="2" id="table-bdr-in">HSN ACS </td>
        <td rowspan="2" id="table-bdr-in">UOM</td>
        <td rowspan="2" id="table-bdr-in">Qty</td>
        <td rowspan="2" id="table-bdr-in"> Rate</td>
        <td rowspan="2" id="table-bdr-in">Amount</td>
        <td rowspan="2" id="table-bdr-in">Less: Discount </td>
        <td rowspan="2" id="table-bdr-in">Taxable Value </td>
        <td colspan="2" align="center" id="table-bdr-in">CGST</td>
        <td colspan="2" align="center" id="table-bdr-in">SGST</td>
        <td colspan="2" align="center" id="table-bdr-in">IGST</td>
        <td rowspan="2" align="right" id="table-bdr-in">Total</td>
      </tr>
      <tr>
        <td id="table-bdr-in">Rate </td>
        <td id="table-bdr-in">Amount</td>
        <td id="table-bdr-in">Rate</td>
        <td id="table-bdr-in">Amount</td>
        <td id="table-bdr-in">Rate</td>
        <td id="table-bdr-in"> Amount</td>
        </tr>
	<?php
    
    if(isset($_GET["uid"]))
    {
		$counter=0;$sum_total=0;$c=0; $t_total=0;$t_cgst=0;$t_igst=0;$grand_total=0;$qty=0;$unit_rate=0;$t_dis=0;
		$query_details=$Admin_core->GetResultSet("SELECT * FROM tbl_workorderbill_det where md5(workorderbill_id::text)=$1 order by id",array($_GET["uid"]));
		while($row_details=pg_fetch_array($query_details))
		{
		 $gst=$Admin_core->GetRecord("SELECT * FROM tbl_gst_master where id=$1",array($row_details['tbl_gst_mstr_id']));
    ?>
        
        
      <tr>
        <td align="center" id="table-bdr-in"><?=++$counter;?></td>
        <td id="table-bdr-in"><?php echo $row_details["work_name"]; ?></td>
        <td id="table-bdr-in"><?php echo $row_details["hsn_acs"]; ?></td>
        <td id="table-bdr-in"><?php echo $row_details["unit"]; ?></td>
        <td id="table-bdr-in"><?php echo $row_details["quantity"]; $qty=$qty+$row_details["quantity"];?></td>
        <td id="table-bdr-in"><?php echo $row_details["unit_rate"]; $unit_rate=$unit_rate+$row_details["unit_rate"];if($row_details["percentage_status"]==1)
			  {echo "%";}?></td>
        <td id="table-bdr-in">
        <?php 
	  $total=0;
	  $ch_month=0;
	  if($row_details["percentage_status"]==0)
			  {
				 $total=$row_details["quantity"]*$row_details["unit_rate"];
				 $sum_total=$sum_total+$total;
			  }
			  else
			  {
				$total=($row_details["quantity"]*$row_details["unit_rate"])/100;
				$sum_total=$sum_total+$total;
			 }?>
	  <strong><?=number_format($total,2)?></strong>
        
        </td>
        <td id="table-bdr-in">	
        <?php
		if($row_details["dis_per_status"]==1)
		{
			$amount=($total*$row_details["discount_amt"])/100;
			$dis_amount=$total-$amount;
			$t_dis=$t_dis+$amount;
		}
		elseif(($row_details["dis_per_status"]==0) && $row_details["discount_amt"]>0)
		{
			 $amount=$row_details["discount_amt"];
			 $dis_amount=$total-$amount;
			 $t_dis=$t_dis+$amount;
		}
		else
		{
			$amount=0;
			$dis_amount=$total-$row_details["discount_amt"];
			$t_dis=$t_dis+$amount;
		}
		echo number_format($amount,2);
		?></td>
        <?php 
		if($row_details["dis_per_status"]<>'')
		{
			
		 $t_total=($t_total+$dis_amount);
		}
		else
		{
		 $t_total=($t_total+$total);	
		}
		?>
        <td id="table-bdr-in"><?=number_format($dis_amount,2)?></td>
        <td id="table-bdr-in">
		<?php 
		if($row_details['igst']==0)
		{ 
		$tax=$gst['gst_percentage']/2;
		$cgst_amt=($dis_amount*$tax)/100;
		$check=$tax.'%';
		$t_cgst= $t_cgst+$cgst_amt;
		}
		else
		{
			$cgst_amt=0;
			$check=0;
		}
		echo $check;
		?></td>
        <td id="table-bdr-in"><?=number_format($cgst_amt,2);?></td>
        <td id="table-bdr-in"><?=$check;?></td>
        <td id="table-bdr-in"><?=number_format($cgst_amt,2);?></td>
        <td id="table-bdr-in"><?php 
		if($row_details['igst']==1)
		{ 
			$tax_igst=$gst['gst_percentage'];
			$igst_amt=($dis_amount*$tax_igst)/100;
			$check_igst=$tax_igst.'%';
			$t_igst= $t_igst+$igst_amt;
			echo $check_igst;
		}
		else
		{
			echo 0;
			$igst_amt=0;
		}
		
		?></td>
        <td id="table-bdr-in"><?=$igst_amt?></td>
        <?php 
		$item_total=$dis_amount+($cgst_amt*2)+$igst_amt;
		$grand_total=$grand_total+$item_total;
		?>
        <td align="right" id="table-bdr-in"><?=number_format($item_total,2)?></td>
      </tr>
	  
	  
      <?php }}?>
    <!-- <tr>
        <td>2</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right">&nbsp;</td>
      </tr>
      <tr>
        <td>3</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right">&nbsp;</td>
      </tr>
      <tr>
        <td>4</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right">&nbsp;</td>
      </tr>
      <tr>
        <td>5</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right">&nbsp;</td>
      </tr>
      <tr>
        <td>6</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right">&nbsp;</td>
      </tr>
      <tr>
        <td>7</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right">&nbsp;</td>
      </tr>
      <tr>
        <td>8</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>

        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right">&nbsp;</td>
      </tr>
      <tr>
        <td>9</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right">&nbsp;</td>
      </tr>
      <tr>
        <td>10</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right">&nbsp;</td>
      </tr>
      <tr>
        <td>11</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right">&nbsp;</td>
      </tr>
      <tr>
        <td>12</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right">&nbsp;</td>
      </tr>
      <tr>
        <td>13</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right">&nbsp;</td>
      </tr>
      <tr>
        <td>14</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right">&nbsp;</td>
      </tr>
      <tr>
        <td id="table-bdr-in">15</td>
        <td id="table-bdr-in">&nbsp;</td>
        <td id="table-bdr-in">&nbsp;</td>
        <td id="table-bdr-in">&nbsp;</td>
        <td id="table-bdr-in">&nbsp;</td>
        <td id="table-bdr-in">&nbsp;</td>
        <td id="table-bdr-in">&nbsp;</td>
        <td id="table-bdr-in">&nbsp;</td>
        <td id="table-bdr-in">&nbsp;</td>
        <td id="table-bdr-in">&nbsp;</td>
        <td id="table-bdr-in">&nbsp;</td>
        <td id="table-bdr-in">&nbsp;</td>
        <td id="table-bdr-in">&nbsp;</td>
        <td id="table-bdr-in">&nbsp;</td>
        <td id="table-bdr-in">&nbsp;</td>
        <td align="right" id="table-bdr-in">&nbsp;</td>
      </tr>-->
      <tr style="font-weight:bold">
        <td height="25" colspan="4" align="right"  ><strong>Total : </strong></td>
        <td><?=$qty?></td>
        <td><?=number_format(round($unit_rate),2)?></td>
        <td><?=number_format(round($sum_total),2)?></td>
        <td><?=number_format(round($t_dis),2)?></td>
        <td><?=number_format(round($t_total),2)?></td>
        
        <td colspan="2" align="center"><strong><?=number_format(round($t_cgst),2)?></strong></td>
        <td colspan="2" align="center"><strong><?=number_format(round($t_cgst),2)?></strong></td>
        <td colspan="2" align="center"><strong><?=number_format(round($t_igst),2)?></strong></td>
        <td align="right"><strong><?=number_format(round($grand_total),2)?></strong></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><table width="100%" border="1" style="border:hidden; border-color:#000000">
      <tr>
        <td colspan="2" rowspan="5" align="center" valign="top"><strong>Total Invoice Amount in Words : </br></strong>
		<?php  $words=intval(round($grand_total));  echo $Admin_core->Inwords($words); ?> Rupees Only.&nbsp;&nbsp;</td>
        <td width="21%">Total Amount Before Tax </td>
        <td width="2%" align="center">:</td>
        <td width="16%"><?=number_format(round($t_total),2)?></td>
      </tr>
      <tr>
        <td>Add : CGST </td>
        <td align="center">:</td>
        <td><?=number_format($t_cgst,2)?></td>
      </tr>
      <tr>
        <td>Add : SGST </td>
        <td align="center">:</td>
        <td><?=number_format($t_cgst,2)?></td>
      </tr>
      <tr>
        <td>Add : IGST </td>
        <td align="center">:</td>
        <td><?=number_format($t_igst,2)?></td>
      </tr>
      <tr>
        <td>Tax Amount : GST </td>
        <td align="center">:</td>
        <td><?php 
		$total_tax=($t_cgst*2)+$t_igst;
		?>
        <strong><?=number_format(round($total_tax),2);?></strong></td>
      </tr>
      <tr>
        <td width="46%" rowspan="3"><table width="100%" height="71" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td colspan="3" align="center"><strong>: Bank Details : </strong></td>
            </tr>
          <tr>
            <td width="36%" height="25">Bank Account Number </td>
            <td width="4%">:</td>
            <td width="60%"><?=$billdetails["acc_no"];?> </td>
          </tr>
          <tr>
            <td>Bank Branch IFSC </td>
            <td>:</td>
            <td><?=$billdetails["ifsc_code"];?></td>
          </tr>
        </table></td>
        <td width="15%" rowspan="4" align="center" valign="bottom">(Common Seal)</td>
        <td>Total Amount After Tax </td>
        <td align="center">:</td>
        <td><?php 
		$total=$t_total+$total_tax;
		?><strong><?=number_format(round($total),2);?></strong></td>
      </tr>
      <tr>
        <td colspan="3">&nbsp;</td>
        </tr>
      <tr>
        <td><strong>GST Payable on Reverse Charge </strong></td>
        <td align="center">:</td>
        <td>&nbsp;</td>
      </tr>
      
      <tr>
             
        <td align="center" valign="top">
		
	
		<table width="100%" border="1" style="border:hidden; border-color:#000000">
		<tr><td colspan="2" align="center"><strong>: Terms and Conditions :</strong></td></tr>
		  <?php 
		if(isset($_GET['uid'])){
		$exe_tempterm=$Admin_core->GetResultSet("SELECT * FROM tbl_workbill_term where md5(work_master_id::text)=$1",array($_GET["uid"]));
		if(pg_num_rows($exe_tempterm)>0)
		{$k=1;
		$lst=pg_num_rows($exe_tempterm);
		while($rstempterm=pg_fetch_array($exe_tempterm)){ 
		
		$term_id=$rstempterm["term_id"];
		$rs=$Admin_core->GetRecord("select * from tbl_term_condition where id=$1",array($term_id));
	
		// echo $Admin_core->getlastquerypreview();
		 ?> 
		<tr>
		<td width="8%" align="center"><?=$k.'.'?></td>  
		<td width="92%"><?=$rs["description"];?></td>
		</tr>
		  <?php  $k++;}}}?>
		</table>
		
		
		</td>
		
		
		

  
        <td colspan="3" nowrap="nowrap" align="center">Certified that the perticulars given above are true and correct. 
		<br />

<strong>  For, COMPANY NAME</strong>
<br />
<br />
<br />
<br />
Authorised Signatory		</td>
        </tr>
    </table></td>
  </tr>
</table>
</div>
</div>
<div align="center"><span class="btn btn-info" onClick="printDiv('printableArea')">Print</span></div>

</div></div></div></div>
</body>
</html>
