<?php $PageSecurity = 4;
global  $db;
include('includes/session.inc');
include('includes/function_lib.php');
include('includes/stockcalculation.php');

$function_filter[]=$_REQUEST['site'];
$function_filter[]=$_REQUEST['store'];
$function_filter[]=FormatDateForSQL($_REQUEST['date']); 
$function_filter[]=FormatDateForSQL($_REQUEST['date']); 
?>

<link rel="stylesheet" href="css/new_mxerp.css">
<div class="body_contain">
<div class="tab_div">
<h1>Pick Items</h1>
<form name="form1" action="" method="post">
<table width="100%" border="0" align="center" cellspacing="0" cellpadding="3">
<tr class="row1">
	<!-- <td><strong>Group </strong></td>
	<td>
		<select style="width:70px;" name="under_group" id="under_group">
		<option value="0">Select</option>
		<?php $sql="select * from machine_group_master";
		$query=DB_query($sql,$db);
		while($row1=DB_fetch_array($query))
		{
      $t1='';
      if($row1['id']==$_REQUEST['under_group'])
       $t1="selected";
			?>
			<option value="<?php echo $row1['id']; ?>" <?php echo $t1; ?>><?php echo $row1['machine_gp_location']; ?></option>
		<?php }	?>  
      	</select>
    </td> -->
    <td width="13%" align="right">Asset Code</td>
	<td width="35%"><input name="asset_code" type="text" id="asset_code" /></td>
	<td width="13%" align="right">Asset Name</td>
	<td><input name="asset_name" type="text" id="asset_name" /></td>
</tr>
<tr class="row1">
   <td colspan="4" align="center"><input name="site" type="hidden" id="site" value="<?php echo $_REQUEST['site']; ?>"  /> <input type="button" onclick="getdataforSearch()" value="Search" class="search" /></td> 
</tr>
</table>
<p></p>
<div id="ItemListDiv" class="overpan">

<table width="100%" border="0" align="left" cellspacing="0" cellpadding="3" class="thborder">
<tr>
	<th width="7%">Select</th>
	<th width="13%">Asset Code</th>
	<th>Asset Name</th>
	<th width="9%">UOM</th>
</tr>
<?php // echo "Select * from machine_center where working='y' and sale_status='NS' and availability_status='0' and location='".$_REQUEST['site']."' ";
$sql=DB_query("Select * from machine_center where working='Y' and sale_status='NS' and availability_status='0' and location='".$_REQUEST['site']."' ",$db); 
$i=0;
if(DB_num_rows($sql)>0)
{
	while($myrow=DB_fetch_array($sql))
	{ 	
	 	 $parameter=$myrow['id'];	
		$unitname=$s->getField('unitsofmeasure','unitid',$myrow['unit'],'unitname');
?>
<tr>
	<td><input type="checkbox" name="row_id[<?php echo $i;?>]" id="row_id_<?php echo $i;?>" value="<?php echo $parameter;?>" 
		onclick="getItemsList('<?php echo $parameter;?>','<?php echo $myrow['code'];?>','<?php echo  htmlspecialchars($myrow['name'], ENT_QUOTES);?>','Nos','<?php echo $i;?>')"></td>
	<td><?php echo $myrow['code'];?></td>
	<td><?php echo  $myrow['name'];?></td>
	<td><?php  echo $unitname;?></td>
</tr>
	<?php $i++;} }?>
 </table>

</div>
</form>

</div>
</div>
