<?php $PageSecurity = 11;
include('includes/session.inc');
include('includes/header.inc');
include('includes/SQL_CommonFunctions.inc');
include('includes/function_lib.php');
if($_REQUEST['q']!='')
{
	$sql="Select * from export_order_details where parentId='".$_REQUEST['q']."'";
	$result=DB_query($sql,$db);
?>
<table width="100%" border="0" cellpadding="2" cellspacing="2" style="border: solid 1px #CCC">
    <tr>
      <th>Item Code</th>
      <th width="18%">Item Name</th>
      <th>Unit</th>
      <th width="8%">Order Qty</th>
      <th width="8%">Dispatch Qty</th>
      <th>Packing Type</th>
      <th nowrap="nowrap">Pkg. Dimension</th>
      <th nowrap="nowrap">Box Detail</th>
      <th width="8%">Qty Per Box</th>
      <th width="8%">Total Box</th>
      <th width="8%">Loose Box</th>
      <th width="8%">Act. Net Wt</th>
      <th width="8%">Act. Gr. Wt</th>
      </tr>
    <?php $i=0;
    while($myrow=DB_fetch_array($result))
    {
    	$item_sql=DB_query("Select * from item_master where StockID='".$myrow['itemCode']."'",$db);
		$item_row=DB_fetch_array($item_sql);
    ?>
    <tr bgcolor="#FFFFFF">
      <td><?php echo $myrow['itemCode'];?><input type="text" name="rowId[<?php echo $i;?>]" value="<?php echo $myrow['id'];?>"/><input type="hidden" name="itemCode[<?php echo $i;?>]" id="itemCode[<?php echo $i;?>]" value="<?php echo $myrow['itemCode'];?>" /></td>
      <td width="20%"><?php echo $item_row['item_name'];?></td>
      <td><?php $unitName=$fnLib->getField('unitsofmeasure','unitid',$item_row['unit'],'unitname');echo $unitName;?></td>
      <td><input type="text" name="orderQty[<?php echo $i;?>]" id="orderQty_<?php echo $i;?>" value="<?php echo $myrow['quantity']?>"/></td>
      <td><input type="text" name="dispatchQty[<?php echo $i;?>]" id="dispatchQty_<?php echo $i;?>" value="" /></td>
      <td><select name="packingType[<?php echo $i;?>]" id="packingType_<?php echo $i;?>" style="width: 100%">
              <option value="Mixed">Mixed</option>
              <option value="Standard">Standard</option>
            </select></td>
      <td nowrap="nowrap" >
      	<input type="text" name="packageLength[<?php echo $i;?>]" id="packageLength_<?php echo $i;?>" value="" style="width:33%;"/>
        <input type="text" name="packageBreadth[<?php echo $i;?>]" id="packageBreadth_<?php echo $i;?>" value="" style="width:33%;" />
        <input type="text" name="packageHeight[<?php echo $i;?>]" id="packageHeight_<?php echo $i;?>" value="" style="width:30%;" /></td>
      <td><input type="text" name="boxDetailA[<?php echo $i;?>]" id="boxDetailA_<?php echo $i;?>" value="1" style="width:45%;" readonly/>*<input type="text" name="boxDetailB[<?php echo $i;?>]" id="boxDetailB_<?php echo $i;?>" value="" style="width:45%;"/>
        </td>
      <td><input type="text" name="qtyPerBox[<?php echo $i;?>]" id="qtyPerBox_<?php echo $i;?>" value="" onfocus="calculateQtyPerBox(<?php echo $i;?>)" /></td>
      
      <td><input type="text" name="totalFilledBox[<?php echo $i;?>]" id="totalFilledBox_<?php echo $i;?>" value=""/></td>
      <td><input type="text" name="totalLooseBox[<?php echo $i;?>]" id="totallooseBox_<?php echo $i;?>" value="" /></td>
      
      <td><input type="text" name="netWeight[<?php echo $i;?>]" id="netWeight_<?php echo $i;?>" value="" /></td>
      <td><input type="text" name="grossWeight[<?php echo $i;?>]" id="grossWeight_<?php echo $i;?>" value="" /></td>
      </tr>
<?php $i++;} ?>
    <input type="hidden" name="count" id="count" value="<?php echo $i;?>" />
  </table>
<?php 
}
?>