<?php session_name('CAKEPHP'); session_start();
$PageSecurity = 4;
$PageName = 'Add Products';
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');
if($_REQUEST['Select'])
{
	$FGarray=array();
	$FGarray=$_REQUEST['ItemCode'];
	//print_r($FGarray);	
	$FinalFGArray=implode(',',$FGarray);
	$_SESSION['itemcode']=$FinalFGArray;
	//echo $_SESSION['FinalEnquiryArray'];
if($_REQUEST['action']=='edit')
{?>
<script type="text/javascript" language="javascript">
opener.window.location="index.php?route=edit_quotation_list&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&Id=<?php echo $_REQUEST['Id'];?>&action=edit";
self.close();
</script>
<?php	
} else if($_REQUEST['action']=='add')
{
?>
<script type="text/javascript" language="javascript">
opener.window.location="index.php?route=edit_quotation_list&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&Id=<?php echo $_REQUEST['Id'];?>&action=edit";self.close();
</script>
<?php }
}
$sql="Select * from item_master where CategoryID='FG'";/**/
$result=DB_query($sql,$db);
?>
<h2 align="center">ADD PRODUCTS</h2><br /><br />
<form action="" method="post">
<input type="submit" name="Select" value="Select">
<br>
<br>
<div style="overflow:auto; height:300px">
<table width="100%" border="0" cellspacing="1" cellpadding="2">
  <tr>
  	<th><strong></strong></th>
    <th><strong>SUB CATEGORY </strong></th>
    <th><strong>ITEM CODE </strong></th>
    <th><strong>ITEM NAME </strong></th>
    <th><strong>UNIT</strong></th>
    <th><strong>FLEXO/OFFSET</strong></th>
  </tr>
  <?php 
  $i=0;
  while($myrow=DB_fetch_array($result))
  {
  	if($i%2==0)
	{$bg="#CCCCCC";}
	else
	$bg="#C8BECB";
  ?>
  <tr bgcolor="<?php echo $bg;?>">
  	<td><input type="checkbox" name="ItemCode[<?php echo $i;?>]" id="ItemCode_<?php echo $i;?>" value="<?php echo $myrow['StockID'];?>"></td>
    <td><?php echo $myrow['SubCategoryID']; ?></td>
    <td><?php echo $myrow['StockID']; ?></td>
    <td><?php echo $myrow['item_name']; ?></td>
    <td><?php echo $myrow['unit']; ?></td>
    <td><?php echo $myrow['flexo_offset']; ?></td>
  </tr>
  <?php $i++;} ?>
</table>
</div>
</form>

<?php
include('includes/footer.inc');
?>