<?php
ob_start();
session_name('CAKEPHP'); session_start();
$PageSecurity = 1;
include('config.php');
include('includes/ConnectDB.inc');
include('includes/function_lib.php');
include('includes/LanguageSetup.php');
include('includes/DateFunctions.inc');
?>
<link rel="stylesheet" href="css/new_mxerp.css">
<div class="body_contain">
<div class="tab_div">
<?php

 
$sql1 = "SELECT * FROM companies where CompanyId='".$_SESSION['ACGCompanyId']."'";
$sqlres = DB_query($sql1,$db);
$companyRow = DB_fetch_array($sqlres);
	
	$sql = $_SESSION['trf_req_rep'];
	//unset($_SESSION['trf_req_rep']);
	$sql=DB_query($sql,$db);

	$s=new db_query();
?>
<div><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr>
<td width="75%" align='left'><img src='images/cloud_logo.jpg' /></td>
<td width="25%" align='left'><!--<img src='images/right_img.jpg' />-->
	<?php echo $companyRow['Address1'];
		  echo "<br>".$companyRow['Address2'];
		  echo "<br>".$companyRow['Address3']; 	
	?></td>
</tr>
<tr>
<td colspan='2'><h1>Fixed Asset Transfer Report</h1></td>
</tr>
</table>
</div>
<div style="margin-top:20px;">
<table width="100%" border="1" cellspacing="0" cellpadding="3" style="border:#666666 1px solid;">
  <tr>
    <td width="10%" style="font-family:Arial; font-size:12px;" class="tabledata"><strong>Requested Site</strong></td>
    <td width="15%"><?php echo $s->GetFieldValue('locations',"loccode='".$_REQUEST['site']."'",'locationname'); 	?></td>
    <td width="10%" style="font-family:Arial; font-size:12px;" class="tabledata"><strong>From Date</strong></td>
    <td width="15%"><?php echo $_REQUEST['fromdate']; ?></td>
    <td width="10%" style="font-family:Arial; font-size:12px;" class="tabledata"><strong>To Date</strong></td>
    <td width="15%"><?php echo $_REQUEST['todate']; ?></td>
    <td width="10%" style="font-family:Arial; font-size:12px;" class="tabledata"><strong>Asset Name</strong></td>
    <td><?php if($_REQUEST['asset']=='0')
	{ echo 'All Assets'; } else { echo $s->getField('tpl_fixed_asset_definition','id',$_REQUEST['asset'],'asset_name'); } ?></td>
  </tr>
</table>
	
</div>
<br />

<div id="foo">
  <p align="center"><input type="button" onclick="javascript:toggle_visibility('foo');" value="Print" /></p>
</div>
<br />


<table width="958" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
  <tr style="background-color:#CCCCCC; height: 30px">
  <td width="30" class="jjrs_tablehead" style="text-align:center;"><strong>S. No.</strong></td>
	<td width="50" class="jjrs_tablehead" style="text-align:center;"><strong>job Card No.</strong></td>
     <td width="40" class="jjrs_tablehead" style="text-align:center;"><strong>Date</strong></td>
	  <td width="90" class="jjrs_tablehead" style="text-align:center;"><strong>Receiced From</strong></td>
	  
	  <td style="text-align:center" width="100" class="jjrs_tablehead"><strong>Asset Name</strong></td>
     
	 <td width="130" class="jjrs_tablehead" style="text-align:center"><strong>Breakdown Type</strong></td>
	 <td width="100" class="jjrs_tablehead" style="text-align:center"><strong>Breakdown Sub Type</strong></td>
	 <td width="130" class="jjrs_tablehead" style="text-align:center"><strong>Breakdown Reason</strong></td>
     <td width="100" class="jjrs_tablehead" style="text-align:center"><strong>Technician</strong></td>
	  <td style="text-align:center" class="jjrs_tablehead"><strong> Exp.Com. Date</strong></td>
	

  </tr>

<?php
$result=DB_query($_REQUEST['query'],$db);
$i=0;
$num=DB_num_rows($result);
if($num>0)
{
while($row=DB_fetch_array($result))
{
extract($row);
?>
<tr bgcolor="#FFFFFF">
	<td class="jjrs_tablehead"><?php echo $i+1;?></td>
	<td class="jjrs_tablehead"><?php echo $tt_no;?></td>
	<td class="jjrs_tablehead"><?php echo ConvertSQLDate($asset_rec_date_time);?></td>
	<td class="jjrs_tablehead"><?php echo $rec_from;?></td>
	<td class="jjrs_tablehead">
	<?php if($_REQUEST['asset']=='0')
	{ echo 'All Assets'; } else { echo $s->getField('tpl_fixed_asset_definition','id',$asset_id,'asset_name'); } ?>
	</td>
	<td colspan="5" align="left" valign="top" style="padding:0px;">
	<table cellspacing="0" cellpadding="2" border="1" width="100%" style="border:none;">
		<?php 
	
	$id_query1=DB_query("SELECT * FROM tpl_breakdown_mgmt_details WHERE master_id='".$main_id."'",$db);
	while($id_row_type=DB_fetch_array($id_query1))
		{
		extract($id_row_type);
		?>
<tr>
<td width="129">
	<?php  $break_type;
	echo $s->GetFieldValue('break_down_type',"id='".$break_type."'",'breakdown_reason');
	?>	</td>
	
	
	
	<td width="100">
	<?php  $break_sub_type;
	echo $s->GetFieldValue('tbl_sub_break_type',"id='".$break_sub_type."'",'sub_breaktype');
	?>	</td>
	<td width="130">
	<?php echo $break_reason;
	?>	</td>
	<td width="100">
	<?php $technician;
	echo $s->GetFieldValue('technicians',"id='".$technician."'",'technician');
	?>	</td>
	<td>
	<?php $com_date;
	echo ConvertSQLDate($com_date);
	?>
	</td>
	</tr>
		<?php	
		}
	?>
	
	</table>
		
	</td>
	
	
	
	
</tr>
<?php $i++; }} else { ?>
	<tr><td colspan="10" style="text-align: center;"><font color="#FF0000"><?php echo "No records found"; ?></font></td></tr>	 
	<?php  }?> 
</table>
	</td>
</tr> 
</table>
</div>
</div>
<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>

