<?php 
$url_cancel= "index.php?route=ToolPlants/maintenance/tpl_maintenace_bill_posting_index".$rurl;
$url_add= "index.php?route=ToolPlants/maintenance/assets_maintenance_bill_posting".$rurl;

//echo $rurl;
?>
<?php

	if($_REQUEST['action']=='delete' && !empty($_REQUEST['mid']))
	{
		if($s->DeleteRecord('tpl_maintenace_billposting',"id=".$_REQUEST['mid']))
		{
			
			$_SESSION['success_msg']="Delete Successfully";
		
		}
	}

if($_REQUEST['Cancel']!='')
{
	unset($_REQUEST);
}
?>

<table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr>
    <td style="padding:5px"><!-- General details -->
      <table width="100%" cellspacing="0" cellpadding="0" border="0" class="small">
        <tr>
          <td style="padding:5px; text-align:right;" colspan="4" align="center">
	<div align="center">
		
		<a href="<?php echo $url_add;?>">Add New</a></div>
        </tr>
        <tr>
          <td class="detailedViewHeader"  style="text-align:center;" colspan="4"><b>Fixed Asset Maitenance Bill Posting</b></td>
        </tr>
       
   <tr>
	<td><table width="100%" border="1" cellspacing="1" cellpadding="5" align="center">
  	<tr>
  		<th><strong>Sl. No.</strong></th>
	  	<th><strong>Voucher Date</strong></th>
	  		   
	   	<th colspan="2"><strong>Action</strong></th>
   </tr>
              <tr>
              	<?php 
              	$record=$s->GetRecordById('tpl_maintenace_billposting',1);
              	// $record=DB_query("select * from tpl_maintenace_billposting",$db);
  					$i=0;
					while($row=DB_fetch_array($record))
					{
						$i++;
						extract($row);
              	?>
	           	<td><?php  echo "<b>". $i." : </b>";?></td>
	            <td><?php  if($voucher_date!='') echo date('d/m/y',strtotime($voucher_date)); else echo ""; ?> </td>
                
                 <td><a href="<?php echo $url_add;?>&action=edit&mid=<?php echo $id;?>"><img src="images/icon-edit.png" width="10" height="10" ></a> </td><td>
				<a href="<?php echo $url_cancel;?>&action=delete&mid=<?php echo $id;?>" onClick="return confirm('Are you sure you wish to delete this Record?')"><img src="images/Icon_Delete.png" width="10" height="10"></a></td>
              </tr><?php 
				} 
              ?>
            
            </table></td>
        </tr>
        <tr>
          <td style="padding:5px; text-align:right;" colspan="4" align="right"></td>
        </tr>
      </table></td>
  </tr>
</table>
<?php if(isset($_SESSION['success_msg']))
{ ?>
	<script> alert("<?php echo ($_SESSION['success_msg']);?>");</script>
<?php 
}	unset($_SESSION['success_msg']);
?>



