<?php $PageSecurity = 11;
include('includes/session.inc');
//include('includes/header.inc');
include('includes/SQL_CommonFunctions.inc');

if($_REQUEST['id']=='Consolidate')
{?>
<table width="100%" border="1" cellspacing="0" cellpadding="0" style="border:#666666 solid 1px;">
              <tr class="row1">
                <td class="tabledata">S.No</td>
				 <td class="tabledata"></td>	
				<td class="tabledata" style="width:40px;">Item Code</td>
				<td class="tabledata">Shade/Item Name. </td>
				<td class="tabledata" style="width:250px;">Item Desc. </td>
                <td class="tabledata">Qty</td>
                <td class="tabledata">Price</td>
                <td class="tabledata">Total Amt</td>
                <td class="tabledata">Excise Duty Rate</td>
                <td class="tabledata">ED Amt</td>
                <td class="tabledata">Remarks</td>
              </tr>
			   <tbody id="dataTable">
				<tr class="row1">
<td style="white-space:nowrap;" class="tabledata"><input name="delitem[]" type="checkbox" value="<?php echo $item_row['id'];?>" />
</td>	
<td class="tabledata"><input type="hidden" name="item_code[]" id="itemid" /></td>
<td class="tabledata"><input type="text" name="" value="" id="itemcode" size="6" /></td>
<td class="tabledata" style="white-space:nowrap"><input type="text" name="" value="" id="itemname" /></td>
<td class="tabledata"><input type="text" name="" value="" id="itemdesc" size="40"/></td>
<td class="tabledata"><input type="text" name="Qty[]" value="" id="qty" size="6" /></td>
<td class="tabledata"><input type="text" name="price[]" value="" id="price" onkeyup="calculateTotalAmt(this.value,this.id)" size="6"/></td>
<td class="tabledata"><input type="text" name="stock_qty[]" value="" id="totalamt" readonly="true" size="9"/></td>
<td class="tabledata"><select name="EDRate[]" id="exciserate" style="width:107px" 
		onchange="calculateExcise(this.value,this.id)">
      <option value="0">--Select--</option>
      <?php
    		$ServiceSql="select * from  excise_tax WHERE caption LIKE '%excise%'" ;
			$ServiceRes=DB_query($ServiceSql,$db);
			while($ServiceRow=DB_fetch_array($ServiceRes))
			{
			?>
      <option value="<?php echo $ServiceRow['id']?>" <?php echo($edit_EDRate==$ServiceRow['id']?'selected':'') ?>><?php echo $ServiceRow['caption'];?></option>
      <?php	
			}
    		?>
    </select></td>
   <td class="tabledata"><input type="text" name="EDAmt[]" value="" id="excisevalue" size="5"/></td>
   <td class="tabledata"><textarea  name="remarks[]" value="" id="remarks" size="5"></textarea></td>
  </tr>
 </tbody>
</table>	

<?php } else
 { ?>
 	<table width="100%" border="1" cellspacing="0" cellpadding="0" style="border:#666666 solid 1px;">
               <tr class="row1">
                <td class="tabledata">S.No</td>	
                <td class="tabledata"></td>			
				<td class="tabledata" style="width:40px;">Item Code</td>
				<td class="tabledata">Shade/Item Name. </td>
				<td class="tabledata" style="width:250px;">Item Desc. </td>
                <td class="tabledata">Qty</td>
                <td class="tabledata">Price</td>
                <td class="tabledata">Total Amt</td>
                <td class="tabledata">MRP /Unit</td>
                <td class="tabledata">Ass Price</td>
                <td class="tabledata">Total Ass Value</td>
                <td class="tabledata">Excise Duty Rate</td>
                <td class="tabledata">ED Amt</td>
                <td class="tabledata">Remarks</td>
              </tr>
			   <tbody id="dataTable">
				<tr class="row1">
<td style="white-space:nowrap;" class="tabledata"><input name="delitem[]" type="checkbox" value="<?php echo $item_row['id'];?>" />
</td>	
<td class="tabledata"><input type="hidden" name="item_code[]" id="itemid" /></td>
<td class="tabledata"><input type="text" name="" value="" id="itemcode" size="6" /></td>
<td class="tabledata" style="white-space:nowrap"><input type="text" name="" value="" id="itemname" /></td>
<td class="tabledata"><input type="text" name="" value="" id="itemdesc" size="40"/></td>
<td class="tabledata"><input type="text" name="Qty[]" value="" id="qty" size="6" /></td>
<td class="tabledata"><input type="text" name="price[]" value="" id="price" onkeyup="calculateTotalAmt(this.value,this.id)" size="6"/></td>
<td class="tabledata"><input type="text" name="stock_qty[]" value="" id="totalamt" readonly="true" size="9"/></td>
<td class="tabledata"><input type="text" name="mrp_per[]" value="" id="mrpper"  size="9" onkeyup="calassprice(this.value,this.id)" /></td>
<td class="tabledata"><input type="text" name="ass_price[]" value="" id="ass_price" readonly="readonly"  size="9"/></td>
<td class="tabledata"><input type="text" name="total_ass_price[]" value="" id="totalassamt" readonly="true" size="25" onfocus="calass_amount(this.id)" /></td>

<td class="tabledata"><select name="EDRate[]" id="exciserate" style="width:107px" 
		onchange="calculateExcise1(this.value,this.id)">
      <option value="0">--Select--</option>
      <?php
    		$ServiceSql="select * from  excise_tax WHERE caption LIKE '%excise%'" ;
			$ServiceRes=DB_query($ServiceSql,$db);
			while($ServiceRow=DB_fetch_array($ServiceRes))
			{
			?>
      <option value="<?php echo $ServiceRow['id']?>" <?php echo($edit_EDRate==$ServiceRow['id']?'selected':'') ?>><?php echo $ServiceRow['caption'];?></option>
      <?php	
			}
    		?>
    </select></td>
   <td class="tabledata"><input type="text" name="EDAmt[]" value="" id="excisevalue" size="5"/></td>
   <td class="tabledata"><textarea  name="remarks[]" value="" id="remarks" size="5"></textarea></td>
  </tr>
  </tbody>
</table>	
	
<?php } ?>	


