<table width="100%" border="1" cellspacing="0" cellpadding="3">
<tr class="row1">
<td colspan="10"><strong>Pending List of All Issued Assets</strong></td>
</tr>
<tr bgcolor="#CCCCCC">
	<td width="3%"><strong>S. No.</strong></td>
	<td><strong>Issued Branch</strong></td>
	<td width="10%"><strong>ARN No.</strong></td>
	<td width="10%"><strong>ARN Date</strong></td>
	<td width="10%"><strong>ATN No.</strong></td>
	<td width="10%"><strong>ATN Date</strong></td>
	<td width="10%"><strong>ATR No. </strong></td>
	<td width="10%"><strong>ATR Date</strong></td>
	<td width="10%"><strong>Issued By</strong></td>
	<td width="10%"><strong>Action</strong></td>
</tr>
<?php 
$SQL = "select I.issue_no, I.issue_date, I.site, I.created_by, T.id, T.request_no, T.request_date, R.*, R.id as RECID 
		from tpl_asset_transfer_issue I  
		INNER JOIN tpl_asset_transfer_request T ON I.transfer_reqno=T.id 
		LEFT JOIN tpl_asset_transfer_receive R ON R.issue_id=I.id
		WHERE T.CompanyId='".$_SESSION['ACGCompanyId']."' and 
		I.issue_date BETWEEN '".$_SESSION['financialYrStart']."' AND '".$_SESSION['financialYrEnd']."'
		 and T.received_status<>'Pending' and R.id IS NOT NULL ORDER BY I.id desc";
$record = DB_query($SQL,$db);
if(DB_num_rows($record)>0){
$i=0;
while($row=DB_fetch_array($record))
{
$i++;
extract($row);

?>
<tr bgcolor="#FFFFFF">
<td><?php  echo $i;?></td>
<td><?php  echo $s->GetFieldValue('locations','loccode="'.$site.'"','loccode');?> </td>
<td><?php  echo $receive_no;?> </td>
<td><?php  if($receive_date!='') echo date('d/m/y',strtotime($receive_date)); else echo ""; ?> </td>
<td><?php  echo $issue_no;?> </td>
<td><?php  if($issue_date!='') echo date('d/m/y',strtotime($issue_date)); else echo ""; ?> </td>
<td><?php  echo $request_no;?></td>
<td><?php  if($request_date!='') echo date('d/m/y',strtotime($request_date)); else echo "";?> </td>
<td><?php  echo $s->GetFieldValue('www_users','id="'.$created_by.'"','realname');?></td>
<td><a target="_blank" href="arn_print.php?rid=<?php echo $row['id'];?>"><img width="18" height="18" src="images/icon_print.jpg"></a></td>
</tr><?php 
} 
}else{
?>
<tr>
<td colspan="9"><font color="#FF0000">No Record Found</font></td>
</tr>
<?php }?>
</table>