<?php 
$PageSecurity = 11;
include('includes/session.inc');
include('includes/function_lib.php');
include('includes/SQL_CommonFunctions.inc');
global $db;
$po=$_REQUEST['po'];?>
<div style="overflow:auto; width:945px; height:auto">
 	<div id="itemdata">
 	<table width="100%" border="1" cellpadding="3" cellspacing="0">
         <tr class="row1">
			<td class="tabledata"><strong>S. NO. </strong></td>
			<td class="tabledata"><strong></strong></td>
			<td class="tabledata"><strong>ITEM CODE </strong></td>
			<td class="tabledata"><strong>DESCRIPTION</strong></td>  
			<td class="tabledata"><strong>UOM</strong></td>
			<td class="tabledata"><strong>PO QTY</strong></td>
			<td class="tabledata"><strong>PENDING QTY</strong></td>
			<td class="tabledata"><strong>RECEIVED QTY</strong></td>
			<td class="tabledata"><strong>RATE</strong></td>
			<td class="tabledata"><strong>TOTAL AMT</strong></td>
		</tr>
        <?php 
 		$i=0;
		$sql_edit=DB_query("Select * from log_po_details where parent_id='".$po."' and del_status=0",$db);
		while($record_edit=DB_fetch_array($sql_edit))
		{
			if($i%2==0)
				{$bg="#CCCCCC";}
			else
				$bg="#C8BECB";
		?>
		<tr>
			<td><?php echo ++$i; ?></td>
			<td>
				<input  type="hidden"   readonly=""  id="itemdataid1_<?php echo $i; ?>"  name="mst_itemid[<?php echo $i-1; ?>]"  value="<?php echo $record_edit['mst_itemid']; ?>" />
			</td>
			<td>
				<?php echo $s->getField('item_master','id',$record_edit['mst_itemid'],'StockID'); ?>
			</td>
			<td>
				<?php echo $s->getField('item_master','id',$record_edit['mst_itemid'],'item_name'); ?>
			</td>
			<td>
				<?php $unit= $s->getField('item_master','id',$record_edit['mst_itemid'],'mst_unitid'); ?>
				<?php echo $s->getField('unitsofmeasure','unitid',$unit,'unitname');  ?>       	 
			</td>
			<td>
				<input  type="text" name="pqty[<?php echo $i-1; ?>]"  id="pqty_<?php echo $i; ?>" size="20" value="<?php echo $record_edit['qty'];?>" readonly="true"  /></td>
			<td>
				<input  type="text" name="peqty[<?php echo $i-1; ?>]"  id="peqty_<?php echo $i; ?>" size="20" value="<?php echo $record_edit['qty1'];?>" readonly="true"  /></td>
			<td>
				<input  type="text" name="reciveqty[<?php echo $i-1; ?>]"  id="poqty_<?php echo $i; ?>" size="20" value="" onblur="checkqty(this.value,<?php echo $i;?>)"  /></td>
			<td>
				<input  type="text" name="itemrate[<?php echo $i-1; ?>]"  id="porate_<?php echo $i; ?>" size="20"  value="" onkeyup="calamt(this.id,this.value)"  />
			</td>
			<td>
				<input  type="text" name="item_total_rate[<?php echo $i-1; ?>]"  id="itemtotalrate_<?php echo $i; ?>" size="20" value="" readonly  />
			</td>
		</tr>
		<?php } ?>
	</table>
    </div>
  	</div>
  	<input type="hidden" name="" value="<?php echo $i;?>" id="ee_cnt" /> 
  	<input type="hidden" name="" value="<?php echo $i;?>" id="edit_cnt" /> 
  	<input type="hidden" name="hiditemcount" id="hiditemcountnf" value="<?php echo $i;?>" />