<?php 
$url_cancel= "index.php?route=ToolPlants/Transaction/fixed_assets_transfer_receipt_entry_index".$rurl;
$url_add= "index.php?route=ToolPlants/Transaction/fixed_assets_transfer_receipt_entry".$rurl;

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

if($_REQUEST['Cancel']!='')
{
	unset($_REQUEST);
}
?>
<link rel="stylesheet" href="css/new_mxerp.css">
<div class="body_contain">
<div class="tab_div">
<h2 align="center"><strong><?php echo $s->GetFieldValue('modules_form',"id='".$_REQUEST['frmid']."'",'description'); ?></strong></h2>
<p align="left">
<a href="<?php echo $url_add;?>"><input type="button" name="Add New" value="Add New" class="search" /></a>
</p>
<table width="100%" border="1" cellspacing="0" cellpadding="3">
<tr class="row1">
	<td class="tabledata">S.No.</td>
	<td class="tabledata">Branch</td>
	<td class="tabledata">Receipt Branch</td>
	<td class="tabledata">Transfer Receipt No.</td>
	<td class="tabledata">Transfer Issue No.</td>
	<td class="tabledata">Receipt Date</td>
	<td class="tabledata" colspan="2">Action</td>
</tr>
<?php 
$record=$s->GetRecordById('tpl_asset_transfer_receipt',1);
// $record=DB_query("select * from tpl_asset_transfer_receipt",$db);
$i=0;
while($row=DB_fetch_array($record))
{
extract($row);
$asset=DB_query("select * from tpl_materialcategorydefinition where id='".$asset_type."' ",$db);
$asset1=DB_fetch_array($asset);
$assetgroupt=$asset1['asset_capitalisation'];  
$i++;
$transfer_issueno=DB_fetch_array($s->GetRecordById('tpl_asset_transfer_issue','id='."'$transfer_issueno'"));	
?>
<tr class="row1">
	<td><?php  echo "<b>". $i." : </b>";?></td>
	<td><?php  echo $s->GetFieldValue('locations',"loccode='".$site."'",'locationname');?> </td>
	<td><?php  echo $s->GetFieldValue('locations',"loccode='".$receipt_site."'",'locationname');?> </td>
	<td><?php  echo $transfer_issueno['issue_no'];?> </td>
	<td><?php  echo $transfer_receiptno;?> </td>
	<td><?php  if($transfer_receipt_date!='') echo date('d/m/y',strtotime($transfer_receipt_date)); else echo ""; ?> </td>
	<td><a href="<?php echo $url_add;?>&action=edit&reid=<?php echo $id;?>"><img src="images/icon-edit.png" width="10" height="10"></a> </td><td>
	<a href="<?php echo $url_cancel;?>&action=delete&reid=<?php echo $id;?>"><img src="images/Icon_Delete.png" width="10" height="10" onClick="return confirm('Are you sure you wish to delete this Record?')"></a></td>
</tr>
<?php } ?>
</table>
<?php if(isset($_SESSION['success_msg']))
{ ?>
	<script> alert("<?php echo ($_SESSION['success_msg']);?>");</script>
<?php 
}	unset($_SESSION['success_msg']);
?>
