<link rel="stylesheet" type="text/css" href="css/table_frize_1.css">
<link rel="stylesheet" href="css/new_mxerp.css">
<div class="body_contain">
<div class="tab_div">
<h1>Payment Advise</h1>
<?php if($_SESSION['frmcreate']=='1'){?>
<p align="left"><a href="index.php?route=HRModule/paymentadvise&modid=<?php echo $_REQUEST['modid']; ?>&frmid=<?php echo $_REQUEST['frmid']; ?>"><input type="button" name="Add" value="Add New" class="search" /></a></p>
<?php } ?>
    <?php 
//unset($_SESSION['employee_code']);
//error_reporting(0);
include('./includes/fun-php.php');
include('./includes/fun-HRClass.php');
$modid=$_REQUEST['modid'];
$frmid=$_REQUEST['frmid'];
$monthdata=array("1"=>"January","2"=>"February","3"=>"March","4"=>"April","5"=>"May"
  ,"6"=>"June","7"=>"July","8"=>"August","9"=>"September","10"=>"October"
  ,"11"=>"November","12"=>"December");
?>

  <?php
	$filter="1=1";
	
?>
<table width="100%" border="0" cellspacing="0" cellpadding="3" class="thborder">
  <tr>
    <th width="5%">S. No.</th>
    <th width="10%">Month</th>
    <th width="10%">Advice No.</th>
    <th width="10%">Advice Date</th>
    <th>Bank Name</th>
    <th width="10%">Total Amt.</th>
	  <th width="10%">Lock Status</th>
    <th width="5%">Excel</th>
  </tr>
  <?php 
  $i=1;
  $sql=DB_query("SELECT * FROM payment_revised where $filter ",$db);
  if(DB_num_rows($sql)>0){
  while($row=DB_fetch_array($sql))
  {
  $netsal=DB_fetch_array(DB_query("SELECT sum(Net_sal) AS Net_sal FROM payment_revised_details WHERE payment_revised_id='".$row['id']."'",$db));
  
  ?>
 <tr>
    <td><?php echo $i; ?></td>
    <td><?php echo $monthdata[$row['payment_month']]; ?></td>
    <td><?php echo $row['bk_advice_no']; ?></td>
    <td><?php echo $row['bk_advice_date'];?></td>
    <td><?php echo $s->getField('accountledger','AccountsID',$row['bank'],'AccountName');?></td>
    <td><?php echo $netsal['Net_sal']; ?></td>
	  <td><?php echo 'Y'?></td>
    <td><a href="print_paymtadvice.php?id=<?php echo $row['id']; ?>" target="_blank"><img src="images/excel.png"  height="18" width="18" ></a></td>
  </tr>
 <?php $i++; }}else{?>
 <tr><td colspan="8" style="text-align:center;"> Sorry !! No Data Found.</td></tr>
 <?php } ?>
</table>
<script language="javascript">
function FProfileMaster(str)
{

   myCheckboxArray = document.frm.elements["frmnamerole[]"];
	var t=myCheckboxArray.length;

	if(document.getElementById('assigned_site').checked==true)
	{	
	
	if(t==undefined)	
	document.getElementById('frmname_'+1).checked=true;
	for (var i = 1; i <=t; i++)
	{
	document.getElementById('frmname_'+i).checked=true;	
	}	
	}
	else
	{
	if(t==undefined)	
	document.getElementById('frmname_'+1).checked=false;
	for (var i = 1; i <= t; i++)
	{
	document.getElementById('frmname_'+i).checked=false;	
	}
	}
}
</script>
</div>
</div>