<?php session_name('CAKEPHP'); session_start();
$PageSecurity = 4;
$PageName = 'Add Products';
include('includes/session.inc');
include('includes/header.inc');
include('includes/function_lib.php');
if($_REQUEST['Select'])
{
	$_SESSION['EONumber']=$_REQUEST['orderNo'];
	echo $_SESSION['EONumber'];
	
if($_REQUEST['action']=='edit')
{?>
<script type="text/javascript" language="javascript">
opener.window.location="index.php?route=EditSalesOrder&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&EditID=<?php echo $_REQUEST['EditID'];?>&act=edit";
self.close();
</script>
<?php	
} else if($_REQUEST['action']=='add')
{
?>
<script type="text/javascript" language="javascript">
opener.window.location="index.php?route=export_proforma_invoice&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>";self.close();
</script>
<?php }
}

$sql="Select * from export_sales_order";
$result=DB_query($sql,$db);

?>
<h2 align="center">Export Sales Orders</h2><br /><br />
<form action="" method="post">
<p align="center"><input type="submit" name="Select" value="Select"></p>
<div align="center">
<div style="overflow:auto; height:300px">
<table width="100%" border="0" cellspacing="1" cellpadding="2">
  <tr>
  	<th><strong></strong></th>
    <th><strong>Export Order No.</strong></th>
    <th><strong>Party</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="radio" name="orderNo" id="orderNo_<?php echo $i;?>" value="<?php echo $myrow['id'];?>"></td>
    <td><?php echo $myrow['EONumber']; ?></td>
    <td><?php echo $myrow['consignee']; ?></td>
  </tr>
  <?php $i++;} ?>
</table>
</div>
</div>
</form>