<table width="100%" border="1" cellspacing="0" cellpadding="0" >
  <tr>
  <td width="3%">&nbsp;</td>
    <td width="16%">Item Code</td>
    <td width="18%">Description</td>
    <td width="9%">Make</td>
    <td width="4%">Color</td>
    <td width="6%">Grade</td>
    <td width="8%">UOM</td>
    <td width="10%">Stock Balance </td>
    <td width="10%">Required Qty </td>
    <td width="8%">Issue Qty </td>
	<td width="8%">Balance </td>
  </tr>
   <tr>

     <td colspan="11"><div style="float:left">
	 <input type="button" class="crmbutton small delete"  onclick="addRow('dataTable')" value="Add" />&nbsp;
	 <input type="button" class="crmbutton small delete"  onclick="deleteRow('dataTable')" value="Delete" />
	 </div>
	 </td>
     </tr>
    <tr>
 <td colspan="11"><table width="100%" border="2" cellspacing="0" cellpadding="0">
 
 <tbody id="dataTable">
 <?php     
 $Select_sql = 'select issueqty.id, 
				 issueqty.issue_id, 
				 issueqty.issue_qty, 
				 issueqty.itemcode, 
				 issueqty.desc, 
				 issueqty.Make, 
				 issueqty.Color, 
				 issueqty.Gread, 
				 issueqty.UOM, 
				 issueqty.StockBlance, 
				 issueqty.issu_qty,
				 issueqty.required_qty,
				 issueqty.Blance from issueqty Where issueqty.issue_id="'.$_GET['issueid'].'"';
			  $sresult = DB_query($Select_sql,$db);
			  $i=1;
			 while ($selectsqlrow=DB_fetch_array($sresult))
			 {
			  
             $id[$i] = $selectsqlrow['id'];
			$i++;
 ?>
   <tr>
     <td width="3%"><input type="checkbox" name="chk" /></td>
	 <td width="2%"><input type="hidden" value="" id="user_shipping" name="user_shipping[]"></td>
	 <td width="3%"><input type="button" name="profile_popup" value="+" id="profile_popup"  onclick="openPopupProfile(this.id);" /> </td>
     <td width="10%">
<input type="text" readonly="" id="washing_profile" name="itemcode[]"size="15" value="<?php echo $selectsqlrow['itemcode']; ?>" />
	 
	 </td>
     <td width="16%"><input type="text" name="desc[]"  id="desc" size="25" value="<?php echo $selectsqlrow['desc']; ?>"/></td>
     <td width="8%">
	 <select name="make[]" id="" >
	 <option name ="">select</option>
	 <?php  $rs=DB_query("select * from product_manufacture", $db);
     while($row=DB_fetch_assoc($rs)) 
	{
	$selectmake = $selectsqlrow['Make'];
	
	 
     ?>
	  <option name ="<?php echo $row['id'];?>" <?php if($row['manufacturer'] == $selectmake) { ?> selected="selected" <? } ?>><?=$row['manufacturer'];?></option>
	 <?php } ?>
	 </select></td>
     <td width="8%"> <select name="color[]" id="" >
	 <option name ="">select</option>
	 <?php  $rs=DB_query("select * from product_color", $db);
     while($row=DB_fetch_assoc($rs)) 
	{
	  $selectColor = $selectsqlrow['Color'];
     ?>
	  <option name ="<?=$row['id'];?>" <?php if($selectColor ==$row['color']) {  echo "selected"; } ?>><?=$row['color'];?></option>
	 <?php } ?>
	 </select></td>
     <td width="8%"> <select name="gread[]" id="" >
	 <option name ="">select</option>
	  <?php  $rs=DB_query("select * from product_grade", $db);
     while($row=DB_fetch_assoc($rs)) 
	{
	 $selectgread = $selectsqlrow['Gread'];
     ?>
	  <option name ="<?=$row['id'];?>" <?php if($selectgread ==$row['grade']) {  echo "selected"; } ?>><?=$row['grade'];?></option>
	 <?php } ?>
	 </select></td>
     <td width="8%"> <select name="uom[]" id="">
	 <option name ="">select</option>
	  	<?php  $rs=DB_query("Select unitid,unitname from unitsofmeasure ", $db);
		 while($row=DB_fetch_assoc($rs)) 
		{
		 $selectUOM = $selectsqlrow['UOM'];
     	?>
	 <option name ="<?=$row['unitid'];?>" <?php if($selectUOM ==$row['unitname']) {  echo "selected"; } ?>><?=$row['unitname'];?></option>
	   <?php } ?>
	   	 </select></td>
		 <?php 
	    $StockSql="SELECT *FROM stockmaster WHERE stockid =''";
		$Stockresult = DB_query($StockSql,$db);	
		while($mystockrow=DB_Fetch_array($Stockresult))
		{
		?>
     <td width="10%" align="center">
	 <input type="text" name="descriptionW"  size="15" value="<?php if($_GET['issueid'] !='') {echo $selectsqlrow['StockBlance'];} else { echo $mystockrow['maxlevel']; } ?>"/>	 </td>
	 <?php } ?>
     <td width="7%" align="center">
	<input name="Stockblance[]" type="text" id="" value="<?php //echo $selectsqlrow['issu_qty']; ?>"  size="10"/>
	 </td>
     <td width="7%" align="center"><input type="text" name="reqiredbalance[]" value="<?php echo $selectsqlrow['required_qty']; ?>"  size="10"/></td>
     <td width="4%" align="center"><input type="text" name="issuebalanc[]" value="<?php echo $selectsqlrow['issu_qty']; ?>"  size="10"/></td>
     <td width="6%" align="center"><input type="text" name="remaningbalance[]" value="<?php echo $selectsqlrow['Blance']; ?>"  size="10"/></td>
   </tr>
   <?php  }  ?>
   </tbody>
 </table></td>
  </tr>
  
  
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
	  <td>&nbsp;</td>
   </tr>
  </table>