<?php
$PageSecurity = 1;
include('include/config.php');
include('includes/ConnectDB.inc');
include('includes/function_lib.php');
include('includes/LanguageSetup.php');
include('includes/DateFunctions.inc');

	$sql = "SELECT T.*, L.locationname FROM tpl_asset_transfer_request T INNER JOIN locations L on L.loccode=T.requested_site";
	$result = DB_query($sql,$db);
	$row = DB_fetch_array($result);
?>
<title>Fixed Asset Transfer Request</title>
<link rel="stylesheet" href="css/purchase_requision_print.css">
<div style="width:1740px;" class="body_contain">
<div class="tab_div">
<?php 
$logo="<div>";
$logo.="<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
$logo.="<tr>";
$logo.="<td align='left'><img src='images/cloud_logo.jpg' /></td>";
$logo.="<td align='right'><img src='images/right_img.jpg' /></td>";
$logo.="</tr>";
$logo.="<tr>";
$logo.="<td colspan='2'><h1>Fixed Asset Transfer Reques</h1></td>";
$logo.="</tr>";
$logo.="<tr>";
$logo.="<td colspan='2' align='center'><strong>".$_SESSION['mess']."</strong></td>";
$logo.="</tr>";
$logo.="</table>";
$logo.="</div>";
echo $logo;
?>
<div id="foo">
  <p align="center"><input type="button" onclick="javascript:toggle_visibility('foo');" value="Print" /></p>
</div>
<br />
<div style="height:1090px;">

<div class="body_contain">
<div class="tab_div">
<table width="100%" cellpadding="3" cellspacing="0" border="0">
<tr class="row1">
	<td class="tabledata1" colspan="4">
		<h3>General Details</h3>
	</td>
</tr>
<tr class="row1">
	<td width="16%" class="tabaledata1">Requested Site</td>
	<td width="23%"><?php echo $row['locationname'];?></td>
	<td width="10%" class="tabledata1">Request No.</td>
	<td width="51%">
	<?php echo $row['request_no'];?>	</td>
</tr>
<tr class="row1">
	<td class="tabledata1">Request Date</td>
	<td><?php echo ConvertSQLDate($row['request_date']); ?></td>
	<td class="tabledata1">Purpose<font style="color:#FF0000;">*</font></td>
	<td><?php echo $row['purpose'];?></td>
</tr>
<tr class="row1">
	<td class="tabledata1">Requested By</td>
	<td><?php echo $row['requested_by'];?></td>
	<td class="tabledata1">Returnable</td>
	<td><?php echo $row['returnable '];?></td>
</tr>
<tr class="row1">
	<td class="tabledata1">Remarks </td>
	<td colspan="3"><?php echo $row['remarks']; ?></td>
</tr>
<tr class="row1">
	<td class="tabledata1" colspan="4">
		<h3>Machine Details</h3>
	</td>
</tr>
<tr class="row1">
	<td class="tabledata1" colspan="4">
	<table width="99%" height="72" border="1" cellpadding="3" cellspacing="0">
<tr class="row1" bgcolor="#e7e7e7">
	<td width="4%" class="tabledata">Sl. No.</td>
	<td width="10%" class="tabledata">Asset Code</td>
	<td width="10%" class="tabledata">Asset Name</td>
	<td width="10%" class="tabledata">Asset Group</td>
	<td width="10%" class="tabledata">Request Qty</td>
	<td width="17%" class="tabledata">Expected Transfer Date</td>
	<td width="15%" class="tabledata">Expected Return Date</td>
	<td width="24%" class="tabledata">Purpose</td>
</tr> 
   
<?php 
$s=new db_query();
$result2=DB_query("select * from tpl_asset_transfer_request_details where asset_req_id='".$_REQUEST['rid']."'",$db);
$i=0;
while($myrow2=DB_fetch_array($result2))
{

$asset_code=$s->GetFieldValue('tpl_fixed_asset_definition',"id='".$myrow2['asset_code']."'",'asset_code_prefix');
$asset_name=$s->GetFieldValue('tpl_fixed_asset_definition',"id='".$myrow2['asset_code']."'",'asset_name');
?>
<tr class="row1">
	<td style="width:1%"><?php echo $i;?></td>
	<td><?php echo $asset_code;?></td>
	<td><?php echo $asset_name;?></td>
	<td><?php echo $myrow2['asset_group'];?></td>
	<td><?php echo $myrow2['required_qty'];?></td>
	<td><?php echo ConvertSQLDate($myrow2['exp_transfer_date']);?></td>
	<td><?php echo ConvertSQLDate($myrow2['exp_return_date']);?></td>
	<td><?php echo $myrow2['purpose'];?></td>
</tr>
<?php $i++;
}  ?>
</table>
</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
  function toggle_visibility(id) {
  var msg=confirm("Please Use Mozilla Firefox And Print In Landscape Mode");
  if(msg){
       var e = document.getElementById(id);
	      e.style.display = 'none';
		       //alert(e.style.display);
			   window.print();
    }
	}
</script>
