<?php ob_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');
$sql=DB_query("Select stockid,maincategoryid,categoryid,description from stockmaster",$db);

if($_REQUEST['Select'] != '')
{
	$item_array=array();
	$item_array=$_REQUEST['row_id'];
	$itemlist=implode(",",$item_array);
	$_SESSION['itemlist']=$itemlist;
	//print_r($_SESSION['itemlist']);
?>
<script type="text/javascript">
//var requisition=document.getElementById("requisition").value;
//alert(requisition);
opener.window.location="MR_Edit_Header.php?RequisitionNo="+<?php echo $_GET['id'];?>+"&update=1";self.close();
</script>
<?php 
}
?>
<link rel="stylesheet" href="css/jquery.ui.all.css">
<script src="js/jquery-1.5.1.js"> </script>
<script src="ui/jquery.ui.core.js"> </script>
<script src="ui/jquery.ui.widget.js"></script>


<h2 align="center">ADD ITEMS</h2><br /><br />
<form name="form1" action="" method="post">
<input type="submit" name="Select" id="Select" value="Select">
<input type="hidden" name="requisition" value="<?php echo $_GET['id'];?>" id="requisition">
<div style="overflow:scroll; width:600px; height:300px">
<table width="80%" border="0" cellspacing="1" cellpadding="2" align="center">
  <tr>
  	<th><strong>SELECT</strong></th>
    <th><strong>ITEM CODE</strong></th>
    <th><strong>ITEM NAME</strong></th>
  </tr>
  <?php 
  $i=1;
  while($myrow=DB_fetch_array($sql))
  {
  ?>
  <tr>
    <td><input type="checkbox" name="row_id[<?php echo $i;?>]" id="row_id_<?php echo $i;?>" value="<?php echo $myrow['stockid'];?>"></td>
	<td><?php echo $myrow['stockid'];?></td>
    <td><?php echo $myrow['description'];?></td>
  </tr>
<?php $i++;} ?>
<input type="hidden" name="row_count" id="row_count" value="<?php echo $i;?>">
</table>
</div>
</form>
<?php
include('includes/footer.inc');
?>