<?php
ob_start();
$PageSecurity = 1;
include('config.php');
include('includes/ConnectDB.inc');
include('includes/function_lib.php');
include('includes/LanguageSetup.php');
include('includes/DateFunctions.inc');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Purchase Order</title>
<link href="css/purchses.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" language="javascript">
  function toggle_visibility(id) {
 
	
       var e = document.getElementById("print");
            
	       e.style.display = 'none';
		       //alert(e.style.display);
			   window.print();
    }
</script>



</head>

<body>
<?php 
function convertDate($Dt)
{
	$dateBRK=explode('-',$Dt);
	$newFormat=$dateBRK[2]."/".$dateBRK[1]."/".$dateBRK[0];
	return $newFormat;
}
$sql=DB_query("select * from dbl_dealer_dispatch where id='".$_REQUEST['id']."'",$db);
$row=DB_Fetch_array($sql);
extract($row);

?>

<div id="page">
		
  <div id="form">
	<!-- Start Header --->
  	<div>
  <div style="width:50px; float:left; margin-left:10px;"><img src="images/logo.jpg" width="100" /></div>
<div style="width:483px; float:right; padding-left:0px; margin:0px;"></div>
	<div class="cl"></div>
	  				<h3>PICK LIST - EXCISABLE/NON-EXCISABLE</h3>


<div style="border:#000000 solid 1px;">
	  
<table width="100%" cellspacing="0" cellpadding="2" border="1">
  <tr>
    <td width="20%">Pick List No:</td>
    <td width="30%"><?php echo $pick_list_no; ?></td>
    <td width="20%">Date:</td>
    <td><?php echo convertDate($dispatch_date); ?></td>
  </tr>
  <tr>
    <td>Party Code:</td>
    <td><?php echo $s->getField('clientmaster','id',$customer,'c_name'); ?></td>
    <td>Party Name & Address</td>
    <td><?php echo $s->getField('clientmaster','id',$customer,'pre_address1'); ?></td>
  </tr>
   <tr>
    <td>SOI No:</td>
    <td><?php echo $s->getField('dbl_process_sale_order','id',$SOI_no,'SOI_no'); ?></td>
    <td>SOI Date</td>
    <td><?php echo convertDate($s->getField('dbl_process_sale_order','id',$SOI_no,'SOI_date')); ?></td>
  </tr>
</table>

<br />
<br />
<table width="100%" cellspacing="0" cellpadding="2" border="1">
<tr style="text-align:center; font-weight:bold;">
<td width="10%">Sr. No</td>
<td width="10%">Part No</td>
<td width="30%">Item Name </td>
<td width="10%">Qty</td>
<td>Shelf No:</td>
</tr> 
<?php 
$i=1;
$sql1=DB_query("select * from dbl_dealer_dispatch_details where parentid='".$_REQUEST['id']."'",$db);
$numrow=DB_num_rows($sql1);
while($row1=DB_fetch_array($sql1))
{
?>

 <tr style="text-align:center">
    <td><?php echo $i; ?></td>
    <td><?php echo $s->getField('item_master','id',$row1['mst_itemid'],'StockID'); ?></td>
	<td><?php echo $s->getField('item_master','id',$row1['mst_itemid'],'item_name'); ?></td>
	<td><?php echo $row1['dispatch_qty']; ?></td>
	<td>&nbsp;</td>
	</tr>
 <?php $i++; } ?>
 
 <?php if($numrow<10) {
 for($j=$i;$i<=10;$i++)
 {
 
  ?>  
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
	<td>&nbsp;</td>
	<td>&nbsp;</td>
	</tr>
   <?php } } ?>
    
	</table>



			
		<div class="cl"></div>
	  </div>





	
    
		
		

	

	  </div><!-- end Header -->
	
	
	  </div>
  

	<div align="center" id="foo">
	<a href="#" onclick="toggle_visibility(this.id)" id="print"><input type="button" value="Print" id="print" /></a>
	
	</div>
</div>
	<div class="cl"></div> <!-- end of  T & C -->
</div>
</body>
</html>



