<?php $PageSecurity = 11;
include('includes/session.inc');
include('includes/SQL_CommonFunctions.inc');
include('includes/function_lib.php');
$_REQUEST['AdvoiceNo'];
if($_REQUEST['AdvoiceNo']!=''){
$disSql=DB_query("select * from dispatch where id='".$_REQUEST['AdvoiceNo']."'",$db);
$disRow=DB_fetch_array($disSql);
extract($disRow);
 ?>
<input type="hidden" name="dispatch_id" value="<?php echo $_REQUEST['AdvoiceNo']; ?>" />
<table width="100%" border="0" cellspacing="0" cellpadding="3">
	<tr class="row1">
	<td class="tabledata1">Branch<span style="color:#FF0000">*</span></td> 
	<td  class="tabledata1">
	<?php 
	$site_sql=DB_query("Select loccode, locationname from locations  where CompanyId='".$_SESSION['ACGCompanyId']."'",$db);?>
	<select name="site" id="site" >
 	<?php while($site_row=DB_fetch_array($site_sql)){?>
	<option value="<?php echo $site_row['loccode']?>"<?php echo(site==$site_row['loccode']?'selected':'')?>><?php echo   $site_row['locationname']?></option>
	<?php }?>
	</select></td>
	<td style="width:100px;">Advice No.<span style="color:#FF0000">*</span></td>
	<td id="adviceId">
	<input name="adviceNo" id="adviceNo" type="text" value="<?php echo $adviceNo;?>" style="width:150px;" readonly /></td>
	</tr>
	<tr class="row1">
	<td class="tabledata1">Party<span style="color:#FF0000">*</span></td>
	<td class="tabledata1"><input name="" type="text" readonly="" value="<?php echo $s->GetFieldValue('clientmaster',"id='".$party."'",'c_name'); 	?>"  style="width:150px;" />
	<input name="party" id="party" type="hidden" value="<?php  echo $party;?>" /> </td>
	<td class="tabledata1">Dispatch Date<span style="color:#FF0000">*</span></td>
	<td  class="tabledata1"><input name="dispatchDate" type="text" value="<?php echo ConvertSQLDate($dispatchDate); ?>" class="datepicker"  style="width:150px;"/></td>
	</tr> 
	<tr class="row1">
	<td class="tabledata1">Address<span style="color:#FF0000">*</span></td>
	<td class="tabledata1"><input type="text" value="<?php echo $s->GetFieldValue('clientmaster',"id='".$party."'",'pre_address1'); 	?>"  style="width:150px;" readonly="" />
	</td>
	<td class="tabledata1">City<span style="color:#FF0000">*</span></td>
	<td  class="tabledata1"><input name="" type="text" value="<?php echo $city=$s->getField('city_master','id',$s->GetFieldValue('clientmaster',"id='".$party."'",'pre_city'),'city'); 	?>" readonly=""   style="width:150px;"/>
	<input type="hidden" name="city" value="<?php echo $s->GetFieldValue('clientmaster',"id='".$party."'",'pre_city') ?>"/>	
	</td>
	</tr> 
	<tr class="row1">
	<td class="tabledata1">State<span style="color:#FF0000">*</span></td>
	<td class="tabledata1"><input name="" type="text" value="<?php echo $city=$s->getField('state_master','id',$s->GetFieldValue('clientmaster',"id='".$party."'",'pre_state'),'state');?>" readonly=""  style="width:150px;" />
	 <input type="hidden" name="state" value="<?php echo $s->GetFieldValue('clientmaster',"id='".$party."'",'pre_state') ?>"/>
	 </td>
	<td class="tabledata1">Country<span style="color:#FF0000">*</span></td>
	<td  class="tabledata1"><input name="" type="text" value="<?php echo $city=$s->getField('country_master','id',$s->GetFieldValue('clientmaster',"id='".$party."'",'pre_country'),'country');?>" readonly=""  style="width:150px;"/>
		<input type="hidden" name="county" value="<?php echo $s->GetFieldValue('clientmaster',"id='".$party."'",'pre_country') ?>"/>
	</td>
	</tr> 	
	<tr class="row1">
	<td class="tabledata1">Name of commodity </td>
	<td class="tabledata1"><!--<input name="name_of_commodity" type="text" value="<?php echo $name_of_commodity;?>" />-->
	<select name="excisableComm" style="width:150px;" onchange="getTarrifHeading(this.value)" >
		<option value="">Select</option>
		<?php 
		$excisableSql=DB_query("Select * from excisable_commodity_master",$db);
		while($excisableRow=DB_fetch_array($excisableSql))
		{?>
			<option value="<?php echo $excisableRow['id']?>"<?php echo ($name_of_commodity==$excisableRow['id']?'selected':'')?>><?php echo $excisableRow['commodityName']?></option>
		<?php 	
		}
		?>
	</select>
	</td>
	<td  class="tabledata1">Dispatch Mode <span style="color:#FF0000">*</span></td>
	<td  class="tabledata1">
	<select name="dispatch_mode" style="width:150px;">
	<option value="">Select</option>	
	<?php
	$sql1=DB_query("select * from transport_master where CompanyId='".$_SESSION['ACGCompanyId']."' and Site='".$site."'",$db);
	while($row1=DB_fetch_array($sql1))
	{
	?>
	<option value="<?php echo $row1['id']; ?>"<?php echo($dispatch_mode==$row1['id']?'selected':''); ?>><?php echo $row1['TransportName']; ?></option>
	<?php } ?>	
	</select>
		<!--<input name="dispatch_mode" type="text" value="<?php echo $dispatch_mode;?>" style="width:150px;" />&nbsp;--></td>
	</tr>
	<tr class="row1">
	<td  class="tabledata1">Tarrif Heading  </td>
			<?php 
	$tariffSql=DB_query("Select tarrifHeading from excisable_commodity_master where id='".$excisableComm."'",$db);
	$tariffRow=DB_fetch_array($tariffSql);
		?>
	<td  class="tabledata1" id="commID"><input type="text" name="tarrifHeading" value="<?php echo $tarrif_heading;?>" style="width:150px;" readonly=""/></td>
	<td  class="tabledata1">Vendor Code</td>
	<td  class="tabledata1"><input name="da_refno" type="text" value="<?php echo $da_refno;?>" style="width:150px;" readonly="" /></td>	
	  </td>		
	</tr>
	<tr class="row1">
	<td  class="tabledata1">Payment Terms </td>
	<td  class="tabledata1">
		<select name="payment_term" style="width:150px;">
	<option value="">Select</option>	
	<?php
	
	$sql2=DB_query("select * from paymentterms",$db);
	while($row2=DB_fetch_array($sql2))
	{
	?>
	<option value="<?php echo $row2['termsindicator']; ?>"<?php echo($payment_term==$row2['termsindicator']?'selected':''); ?>><?php echo $row2['terms']; ?></option>
	<?php } ?>	
	</select>
	<!--	<input name="payment_term" type="text" value="<?php echo $payment_term;?>" style="width:150px;" />--> </td>	
	
	<td  class="tabledata1">Destination<span style="color:#FF0000">*</span></td>
	<td  class="tabledata1"><input name="desitination" type="text" value="<?php echo $desitination;?>" style="width:150px;"  /> </td>	
	</tr>
	<!--<tr class="row1">
	<td  class="tabledata1">PO No. </td>
	<td ><input name="po_orderno" type="text" value="<?php //echo $po_orderno;?>" />&nbsp;</td>
	<td  class="tabledata1"></td><td  class="tabledata1"></td>
	</tr>-->
<tr  class="row1">
	<td  class="tabledata1">CST Vat No </td>
	<?php
	 
	$tinno=$s->GetFieldValue('clientmaster',"id='".$party."'",'tin_no');
	
	?>
	<td  class="tabledata1"><input name="cst_vatno" type="text" value="<?php echo $tinno;?>" style="width:150px;" readonly="" /></td>
	
	<td  class="tabledata1"> Customer Group </td>
	<td  class="tabledata1">
	<?php 
	$zone=$s->GetFieldValue('clientmaster',"id='".$party."'",'Zone');
	$ex_group=$s->GetFieldValue('zone_master',"id='".$zone."'",'ZoneTitle');
?>
<input type="text" name="ex_cust_group" id="ex_cust_group" value="<?php echo $ex_group; ?>" style="width:150px;" readonly="" />
	  </td>		
	</tr>
	<tr class="row1">
	<td  class="tabledata1">ECC No </td>
	<?php
	$cstno1=$s->GetFieldValue('clientmaster',"id='".$party."'",'excies_no');
	?>
	<td  class="tabledata1" ><input name="ecc_no" type="text" value="<?php echo $ecc_no;?>" style="width:150px;" readonly="" /></td>
	<td  class="tabledata1">Our Ref No</td>
	<td  class="tabledata1"><input type="text" name="our_refno" value="<?php echo $our_refno; ?>" style="width:150px;" readonly="" /></td>	
	</tr>
	<tr class="row1">
	<td  class="tabledata1">Form </td>
	<td  class="tabledata1">
	<select name="form_status" style="width:150px;">
	<option value="Yes" <?php  echo  $form_status=='Yes'?'selected':'' ?>>Yes</option>
	<option value="No" <?php  echo $form_status=='No'?'selected':'' ?> >No</option>
	</select>
	 </td>
	 <td  class="tabledata1">Form No</td>
	 <td  class="tabledata1"><input type="text" name="form_no" value="<?php echo $form_no; ?>"  style="width:150px;" readonly="" /></td>	
	</tr>
<tr class="row1">
	<td  class="tabledata1">Freight Type</td>
	<td colspan="3"><select style="width:150px;" name="freight">
                          <option value="0">Select</option>
						  <option value="Paid"<?php echo($freight=='Paid'?'selected':''); ?>>Paid</option>
						  <option value="topay"<?php echo($freight=='topay'?'selected':''); ?>>To Pay</option>
						  <option value="Nill"<?php echo($freight=='Nill'?'selected':''); ?>>Nill</option>
                        </select></td>
</tr>
	<tr class="row1">
	<td colspan="4"  class="tabledata1">
	<table width="100%" cellpadding="1" cellspacing="1">
	<tr class="row1">
	<td nowrap="nowrap" scope="row"   class="tabledata1">Against Single/Multiple S. O. P.</td>
	<?php ?>
	<td nowrap="nowrap"  class="tabledata1">
	<div style="overflow:auto; height:100px; width:383px; border:1px solid; " >
	<?php $OrderNoA=$s->GetFieldValue('salesorder',"id='".$againstSOP."'",'orderNo');
		  $PORefNoA=$s->GetFieldValue('salesorder',"id='".$againstSOP."'",'PORefNo') ?>
 		&nbsp;&nbsp;<input name="againstSOP" value="<?php echo $againstSOP;?>" type="hidden">
	 <?php echo $OrderNoA?><?php echo '--'.'&nbsp;&nbsp;'.$PORefNoA; ?> 
	</div>    </td>
	</tr>
	</table>	    </td>
	</tr>
<tr class="row1">
	<td colspan="4"><h3>Items Details</h3></td>
</tr>
</table>
<table width="100%" cellpadding="3" cellspacing="3" border="0">
		<tr class="row1">
			<td  class="tabledata">Sno.</td>
			<td  class="tabledata">Code</td>
			<td  class="tabledata">Item/Shade Name </td>
			<td  class="tabledata">Item Desc</td>
			<td  class="tabledata">Unit</td>
			<td  class="tabledata">T.O No.</td>			
			<td  class="tabledata"> Order Qty</td>
			<td  class="tabledata"> Approved Qty</td>
			<td  class="tabledata">Dispatch Qty </td>
			<td  class="tabledata"> Price</td>	<td  class="tabledata"> Ass. Value</td>
			<!--<td  class="tabledata">Pending Qty</td>-->
			 <?php if($order_type!='Consolidate' && $order_type!='') {  ?>
			<td class="tabledata">MRP /Unit</td>
            <td class="tabledata">Ass Price</td>
            <td class="tabledata">Total Ass Value</td>
            <?php } ?>
			<td  class="tabledata">EDRate</td><td  class="tabledata">EDAmount</td>
			<!--<td  class="tabledata">Box Details</td>
			<td  class="tabledata">Weight</td>
			<td  class="tabledata">Piece Per Box</td>-->
		</tr>
		<?php $details_data=DB_query("Select * from salesorder where id in (".$againstSOP.") and CompanyId='".$_SESSION['ACGCompanyId']."'",$db);
				$row=DB_fetch_array($details_data);
				 $test_amit=$row['Sale_Key_Exec']; 
$GetDisp=DB_query("select * from dispatch_details where parentId='".$id."'",$db);
if(DB_num_rows($GetDisp)>0)	{
$j=0; 
while($details_row=DB_fetch_array($GetDisp)){	

$item_sql=DB_query("Select item_name,unit,StockID,item_desc from item_master where  id='".$details_row['item']."'",$db);
$item_row=DB_fetch_array($item_sql);
$aprqty=DB_query("select * from salesorder_details where masterId='".$details_row['SOPNo']."' and ItemCode='".$details_row['item']."'",$db);
$aprFetch=DB_fetch_array($aprqty);

$sqldispatch=DB_query("select SUM(dispatchQty) as TOTALDIS from dispatch_details where SOPNo='".$details_row['SOPNo']."' and item='".$details_row['item']."'",$db);
if(DB_num_rows($sqldispatch)>0)
{
	$sqldispatchRow=DB_fetch_array($sqldispatch);
	$finalAprqty=$aprFetch['Approved_qty']-$sqldispatchRow['TOTALDIS'];
}
else
{
	$finalAprqty=$details_row['Approved_qty'];
}
?>
		<tr bgcolor="#FFFFF" valign="top">
		<td  class="tabledata">
		<input type="hidden" name="saleorderid[<?php echo $j;?>]" value="<?php echo $aprFetch['id']; ?>" />
		<input type="hidden" name="totaldispatchaks[<?php echo $j;?>]" value="<?php echo $sqldispatchRow['TOTALDIS']; ?>" />
		<input type="hidden" name="starting_ord_qty[<?php echo $j;?>]" value="<?php echo $details_row['OrderQty']; ?>" />
		<?php echo $j+1;?><input type="hidden" name="rowId[<?php echo $j;?>]" value="<?php echo $details_row['id']?>" /><input type="hidden" name="item[<?php echo $j;?>]" value="<?php echo $details_row['item']?>" size="10" /></td>
		<td  class="tabledata"><?php echo $item_row['StockID']?></td>
		<td  class="tabledata"><?php echo $item_row['item_name']?></td>
		<td  class="tabledata"><?php echo $item_row['item_desc']?></td>
		<td  class="tabledata"><?php echo	$unitName=$s->GetFieldValue('unitsofmeasure',"unitid='".$item_row['unit']."'",'unitname');	 ?></td>
		<td  class="tabledata"><?php echo $SOPCode=$s->GetFieldValue('salesorder',"id='".$details_row['SOPNo']."'",'orderNo');
		?><input type="hidden" name="SOPNo[<?php echo $j;?>]" id="SOPNo_<?php echo $j;?>" value="<?php echo $details_row['SOPNo'];?>" /></td>
		<td  class="tabledata"><?php echo $details_row['OrderQty']?></td>
		<td  class="tabledata"><?php echo $finalAprqty;?>
		<input type="hidden" name="ApprorderQty[<?php echo $j;?>]" id="ApprorderQty_<?php echo $j;?>" value="<?php echo $finalAprqty;?>"  size="10"  />
		</td>
		<td  class="tabledata">
		<input type="text" name="dispatchQty[<?php echo $j;?>]"  id="dispatchQty_<?php echo $j;?>" style="width:80px;" value="<?php echo $details_row['dispatchQty']; ?>"  onblur="calqty(<?php echo $j;?>)"/>
		<input type="hidden" name="dispatchQty1[<?php echo $j;?>]"  id="dispatchQty1_<?php echo $j;?>"    size="10" value="<?php echo $details_row['dispatchQty']; ?>" /></td>
		
		<td  class="tabledata"><input type="text" name="Rate[<?php echo $j;?>]" id="Rate_<?php echo $j;?>" value="<?php  echo $details_row['Price']?>"  style="width:65px;"/>
		</td>
		<td  class="tabledata">
		<input  type="text"  style="width:80px;" name="assable_value[<?php echo $j;?>]" value="<?php echo $details_row['AssValue']; ?>" id="assable_value_<?php echo $j;?>" readonly />
		</td>
		<!--<td  class="tabledata1"><?php echo $aprFetch['pendingQty']; ?><input type="hidden" name="pendingQty[<?php echo $j;?>]" id="pendingQty_<?php echo $j;?>" value="<?php echo $aprFetch['pendingQty']; ?>"  /></td>-->
		 <?php if($order_type!='Consolidate' && $order_type!='') {  ?>
		 	<td class="tabledata"><input type="text" name="mrp_per[<?php echo $j;?>]" value="<?php echo $details_row['mrp_unit']; ?>" id="mrpper_<?php echo $j;?>"  style="width:65px;" readonly="readonly"  /></td>
<td class="tabledata"><input type="text" name="ass_price[<?php echo $j;?>]" value="<?php echo $details_row['mass_value']; ?>" id="ass_price_<?php echo $j;?>" readonly="readonly"  style="width:80px;"/></td>
<td class="tabledata"><input type="text" name="total_ass_price[<?php echo $j;?>]" value="<?php echo $details_row['total_ass_value']; ?>" id="totalassamt_<?php echo $j;?>" readonly="true" style="width:85px;"  /></td>

   <td class="tabledata">
   <select name="EDRate[<?php echo $j;?>]" id="EDRate_<?php echo $j?>" style="width:80px;"
		onchange="calculateItemExcise(this.value,<?php echo $j;?>)">
    		<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($details_row['EdRate']==$ServiceRow['id']?'selected':'');?>><?php echo $ServiceRow['caption']?>
		  </option>
			<?php }?>
    		</select>
   <input type="hidden" name="HidRate[<?php echo $j;?>]" id="HidRate_<?php echo $j;?>" value="<?php  echo $s->getField('excise_tax','id',$details_row['EDRate'],'def_rate');?>"   />
   </td>
   <td class="tabledata" >
   
   <input type="text" name="EDamount[<?php echo $j;?>]" id="EDAmt_<?php echo $j;?>" value="<?php echo $details_row['EDamount']; ?>" onfocus="calculateExciseAMt1(<?php echo $j?>)" style="width:65px;"/>
   
   
   </td>
    <?php } else {?> 	
		<td  class="tabledata">
				<select name="EDRate[<?php echo $j;?>]" id="EDRate_<?php echo $j?>" style="width:80px;" 
		onchange="calculateItemExcise(this.value,<?php echo $j;?>)">
    		<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($details_row['EdRate']==$ServiceRow['id']?'selected':'');?>><?php echo $ServiceRow['caption']?>
		  </option>
			<?php	
			}
    		
    		?>
    		</select>
 		 <input type="hidden" name="HidRate[<?php echo $j;?>]" id="HidRate_<?php echo $j;?>" value="<?php  echo $s->getField('excise_tax','id',$details_row['EDRate'],'def_rate');?>"   />
		 </td>
		 <td  class="tabledata">
 		<input type="text" name="EDamount[<?php echo $j;?>]" id="EDAmt_<?php echo $j;?>" value="<?php echo $details_row['EDamount']; ?>" onfocus="calculateExciseAMt(<?php echo $j;?>)" style="width:65px;" />
		</td>
		<?php } ?>
		<!--<td  class="tabledata1"><input type="text" name="boxDetails[<?php echo $j;?>]" value=""   size="10"  /></td>
		<td  class="tabledata1"><input type="text" name="weight[<?php echo $j;?>]" value=""   size="10"  /></td>
		<td  class="tabledata1"><input type="text" name="piecePerBox[<?php echo $j;?>]" value=""   size="10"  /></td>	-->
		</tr>
		<?php $j++;} ?>
		<input type="hidden" name="count"  id='count' value="<?php echo $j;?>"/>
	</table>
	
<table width="100%" cellpadding="3" cellspacing="0" border="0">
<tr class="row1">
	<td width="50%" align="left">&nbsp;</td>
	<td width="50%" align="right"><table width="100%" border="0" cellspacing="0" cellpadding="3">
					<tr class="row1">
				<td style="text-align:center;" colspan="2">Amount And Taxes</td>
			</tr>
			
		  <tr class="row1">
					<td  class="tabledata1">Value Of Goods<label><font color="#FF0000">*</font></label></td>
					<td  class="tabledata1"><input name="basicAmount" type="text"   onfocus="calculateBasic()" id="basicAmount" value="<?php  echo $basicAmount;?>" style="width:150px;"/></td>
		  </tr>
				  <tr class="row1">
					<td nowrap="nowrap">Excise Duty<label><font color="#FF0000">*</font></label></td>
					<td  class="tabledata1">
						<?php if($order_type=='Consolidate' && $order_type!='') {  ?>
					<select name="EDRate1" id="EDRate1" style="width:150px" onchange="calculateBillExcise(this.value)">
    		<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))
			{
			$selak='';
			if($Excise_duty==$ServiceRow['id'])
			$selak='selected';
			?>
			<option value="<?php echo $ServiceRow['id'];?>"<?php echo $selak; ?>><?php echo $ServiceRow['caption'];?></option>
			<?php	
			}
    		
    		?>
    	</select><?php } ?>
					<input name="totalDiscountedPrice" id="totalDiscountedPrice" type="text"   onfocus ="calculateDiscounted()" value="<?php  echo $totalDiscountedPrice;?>" readonly style="width:150px;"/>
					
					
					</td>
					
				</tr>
				 
					 
					
					 <tr class="row1">
					<td  class="tabledata1">E-Cess</td>
					<td  class="tabledata1">
						<input type="hidden" name="ECessID" value="<?php echo $ECessID;?>">
						<input name="ECessPercentage" id="ECessPercentage" type="text" value="<?php echo $ECessPercentage;?>"  readonly style="width:150px;" />
						<input name="ECessValue" id="ECessValue" type="text"   readonly onFocus="calculateECess()" value="<?php echo $ECessValue;?>"style="width:150px;" /></td>
					</tr>
					<tr class="row1">
					<td nowrap="nowrap" class="tabledata1">SHE-E Cess </td>
					<td  class="tabledata1" >
						<input type="hidden" name="SHECessId" value="<?php echo $SHECessId;?>">
						
						<input name="SAHCessPercentage" id="SAHCessPercentage" type="text" value="<?php echo $SAHCessPercentage;?>" style="width:150px;" readonly/>
						<input name="SAHCessValue" id="SAHCessValue" type="text" style="width:150px;" readonly onFocus="calculateSAHCess()" value="<?php echo $SAHCessValue;?>"/></td>
					</tr>
				  
				  
		   <tr class="row1">
			<td  class="tabledata1">Taxable Amount<label><font color="#FF0000">*</font></label></td>
			<td  class="tabledata1"><input name="taxableAmount" id="taxableAmount" type="text"  onFocus="calculateTaxable()" value="<?php echo $taxableAmount;?>"style="width:150px;" /></td>
		   </tr>
				  <tr class="row1">
					<td  class="tabledata1">VAT/CST</td>
					<td  class="tabledata1">
					<select name="VatCst" id="value3" style="width:150px;" onChange="calculateVATCST(this.value)">
					<option value="0" >Select</option>
					<?php 
					$salesSql=DB_query("Select * from sales_tax_master",$db);
					while($salesRow=DB_fetch_array($salesSql))
					{?>
						<option value="<?php echo $salesRow['salestax_id'];?>" <?php echo  $VatCst==$salesRow['salestax_id']?'selected':''?>><?php echo $salesRow['tax_code'];?></option>
					<?php 	
					}
					?>
				  </select>
				  <input type="hidden" name="" id="rate" value="<?php echo $editsalid;?>" /> 
		<div id="VATId"><input name="VatCstValue" id="VatCstValue" type="text" value="<?php echo $VatCstValue; ?>" onfocus="CalculateVatCstValue()" size="25" style="width:150px;" readonly /></div>
		
		
		</td>
 				</tr>
 				<tr class="row1">
					<td  class="tabledata1">Grand Total<label><font color="#FF0000">*</font></label></td>
					<td  class="tabledata1"><input name="grandTotal" id="grandTotal" type="text"   onFocus="calculateGrand()" readonly="readonly"  value="<?php    echo $grandTotal;  ?>" style="width:150px;"/></td>
					
				</tr>
	  </table></td>
</tr>
</table>	

 
<table width="100%" cellpadding="3" cellspacing="0" border="0">
<tr class="row1">
	<td  class="tabledata1">Remarks</td>
	<td  class="tabledata1"><textarea name="remarks" cols="133" rows="7"><?php echo $remarks; ?></textarea></td>
</tr>
<tr class="row1">
	<td colspan="2"><p align="center"><input type="submit" name="Update" value="Update" class="search" /></p></td>
</tr>
</table> 
 

<?php } }?>