<?php session_name('CAKEPHP'); session_start();
$PageSecurity = 4;
$PageName = 'Add Items';
include('includes/DefinePOClass.php');
include('includes/session.inc');
include('includes/SQL_CommonFunctions.inc');
include('includes/DefineSuppTransClass.php');
//include('includes/header.inc');
include('includes/function_lib.php');
?>
<link href="css/professional/default.css" rel="stylesheet" type="text/css" />
<script language="javascript">
function getdata()
{
var k=window.opener.document.getElementById('project').value;
var t=window.opener.document.getElementById('request_date').value;
var t1=window.opener.document.getElementById('remarks').value;
document.getElementById("project").value=k;
document.getElementById("request_date").value=t;
document.getElementById("remarks").value=t1;

}
</script>
<?php 
if($_REQUEST['Select'] != '')
{	
	$item_array=array();
	$item_array=$_REQUEST['row_id'];
	$_SESSION['manvi']=$item_array;
	//print_r($_SESSION['manvi']);	
	$itemlist=implode("#",$_SESSION['manvi']);
	$_SESSION['manvi']=$itemlist;
	?>
<script type="text/javascript">
opener.window.location="index.php?route=ToolPlants/fixed_assets/fixed_assets_log_book_entry&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&lid=<?php echo $_REQUEST['lid']; ?>
&action=<?php echo $_REQUEST['action1']; ?>&NewRequisition=Yes&project=<?php echo $_REQUEST['project']; ?>
&log_book_date=<?php echo $_REQUEST['log_book_date']; ?>";self.close();

</script>
<?php 
}
?>

 

  <?php
 //---------------------------Search Starts here-------------------------------
		$sql_search = "select * from tpl_fixed_asset_definition where 1 ";
		
		//echo $sql_search ;
			$search_result = DB_query($sql_search, $db);
			//echo $sql_search;
	
			
?>
<body onLoad="getdata()">
<form name="form1" action="" method="post">
 <input style="margin:0px 0px 10px 0px;" type="submit" name="Select" id="Select" value="OK">
<input type="text" name="project" value="" id="project"/>
<input type="hidden" name="request_date" value="" id="request_date"/>
<input type="hidden" name="remarks" value="" id="remarks"/>
<div align="center"><div style="overflow:auto; width: 600px; height: 300px;">

  <table width="100%" border="0" cellspacing="3" cellpadding="2" align="center">
        <tr>
          <th width="13%"><strong>SELECT</strong></th>
          <th width="32%"><strong>Assect Group </strong></th>
          <th width="34%"><strong>Material NAME</strong></th>
          <th width="34%"><strong>UOM</strong></th>
          <th width="34%"><strong>Qty</strong></th>
                  </tr>
<?Php
$i=0;
  	if($i%2==0)
	{$bg="#CCCCCC";}
	else
	$bg="#C8BECB";


	if(DB_num_rows($search_result)>0)
	{
	 	while($myrow = DB_fetch_array($search_result))
	 	{?>
        <?php 	
  $parameter=$myrow['id'];
  ?>
        <tr bgcolor="<?php echo $bg;?>">
		 
		  
          <td><input type="checkbox" name="row_id[<?php echo $i;?>]" id="row_id_<?php echo $i;?>" value="<?php echo $parameter;?>"<?php echo $c;?> /></td>
          <td><strong><?php echo $s->getField('tpl_materialcategorydefinition','id',$myrow['asset_group'],'asset_capitalisation'); ?></strong></td>
          <td><?php echo $myrow['asset_name'];?></td>
          <td><?php echo $s->getField('unitsofmeasure','unitid',$myrow['unit_of_measurement'],'unitname'); ?></td>
          <td><?php echo $myrow['asset_qty']; ?></td>         
        </tr>
        <?php $i++;
	 } 
  }
	else
	{?>
	 <tr>
      <td colspan="9"><h3 align="center">No Items Found</h3></td>
    </tr>
        <?php 
	}
?>
</table></div></div>
     

  </form>
</body>
