<?php if(isset($_SESSION['JBillItemlist']))
{
	$tt=explode("#",$_SESSION['JBillItemlist']);
	
	for($j=0;$j<count($tt);$j++)
	{
		$item_sql="Select * from item_master where StockID ='".$tt[$j]."'";
		$item_result=DB_query($item_sql,$db);
		while($item_row=DB_fetch_array($item_result))
		{
		
		
?>
<tr bgcolor="#FFFFFF">
<td><?php echo $tt[$j];?><input type="hidden" name="itemCode[<?php echo $j;?>]" value="<?php echo $tt[$j];?>"></td>
<td><?php echo $item_row['item_name'];?></td>
<td>
<?php 
$makeSql=DB_query("Select manufacture from item_specification where proc_id='".$tt[$j]."'",$db);
?>
<select name="make[<?php echo $j;?>]" id="" style="width:100px">
<?php 
while($makeRow=DB_fetch_array($makeSql))
{
	$makename=$s->getField('product_manufacture','id',$makeRow['manufacture'],'manufacturer');
?>
<option value="<?php echo $makeRow['manufacture'];?>"><?php echo $makename;?></option>
<?php } ?>
</select>


<td>
<?php 
$colorSql=DB_query("Select color from item_specification where proc_id='".$tt[$j]."'",$db);
?>
<select name="color[<?php echo $j;?>]" id="" style="width:100px">
<?php 
while($colorRow=DB_fetch_array($colorSql))
{
	$colorname=$s->getField('product_color','id',$colorRow['color'],'color');
?>
<option value="<?php echo $colorRow['color'];?>"><?php echo $colorname;?></option>
<?php } ?>
</select>



<td>
<?php
$gradeSql=DB_query("Select grade from item_specification where proc_id='".$tt[$j]."'",$db);
?>
<select name="grade[<?php echo $j;?>]" id="" style="width:100px">
<?php 
while($gradeRow=DB_fetch_array($gradeSql))
{
	$gradername=$s->getField('product_grade','id',$gradeRow['grade'],'grade');
?>
<option value="<?php echo $gradeRow['grade'];?>"><?php echo $gradername;?></option>
<?php } ?>
</select>


<td>
<?php 
$sizeSql=DB_query("Select size from item_specification where proc_id='".$tt[$j]."'",$db);
?>
<select name="size[<?php echo $j;?>]" id="" style="width:100px">
<?php 
while($sizeRow=DB_fetch_array($sizeSql))
{
	$sizename=$s->getField('size_master','id',$sizeRow['size'],'name');
?>
<option value="<?php echo $sizeRow['size'];?>"><?php echo $sizename;?></option>
<?php } ?>
</select>



<td>
<?php

$gsmSql=DB_query("Select gsm from item_specification where proc_id='".$tt[$j]."'",$db);
?>
<select name="gsm[<?php echo $j;?>]" id="" style="width:100px">
<?php 
while($gsmRow=DB_fetch_array($gsmSql))
{
	$gsmname=$s->getField('gsm','id',$gsmRow['gsm'],'gsm');
?>
<option value="<?php echo $gsmRow['gsm'];?>"><?php echo $gsmname;?></option>
<?php } ?>
</select>


<input type="hidden" name="gsm[<?php echo $j;?>]" id="gsm_<?php echo $j;?>" value="<?php echo $details_row2['gsm'];?>" /></td>
<td><?php 
$unitname=$s->getField('unitsofmeasure','unitid',$item_row['unit'],'unitname');
echo $unitname;?></td>
<td><input type="text" name="receivedQty[<?php echo $j;?>]" id="receivedQty_<?php echo $j;?>" value="<?php echo $_REQUEST['receivedQty'][$j];?>" size="15" ></td><!--readonly="true"-->
<td><input type="text" name="rate[<?php echo $j;?>]" id="rate_<?php echo $j;?>" value="<?php echo $_REQUEST['rate'][$j];?>" size="15" ></td>
<td><input type="text" name="totalAmount[<?php echo $j;?>]" id="totalAmount_<?php echo $j;?>" value="<?php echo $_REQUEST['totalAmount'][$j];?>" size="15" onFocus="calculateTotalAmt(<?php echo $j;?>)" readonly="true"></td>
<td><?php echo $item_row['item_desc'];?></td>
<td><?php echo $item_row['item_no'];?></td>   
<td><?php echo $item_row['flexo_offset'];?></td>
<td><?php echo $item_row['serial_no'];?></td>
<td><?php echo $item_row['orig_local'];?></td>
<td><?php echo $item_row['type_name'];?></td>
<td><?php echo $item_row['shade'];?></td>
<td><?php echo $item_row['running_roll'];?></td>
<td><?php echo $item_row['volume'];?></td>
<td><?php echo $item_row['teeth'];?></td>
<td><?php echo $item_row['bcm'];?></td>
<td><?php echo $item_row['ups'];?></td>
<td><?php echo $item_row['quality'];?></td>
</tr>
<?php
		}
	}
}


	



?>