rpv_sen 59 Junior Poster

HI

Sorry for opening the thread,

i have some issue please help me in solving the below one

Javascript

<script language="javascript">
function line(elem,amt,res_elem) 
{
	var qty=document.getElementById(elem).value;
	var tot_amt=qty*amt;
	//document.getElementById(res_elem).value = tot_amt;
	document.getElementById(res_elem).value = Math.round(tot_amt*100)/100;
}
</script>

PHP

<?php $cate_code=$_GET['ct'];
  		$civrform=$_GET['vrform'];
		$site=$_GET['site_name'];
		$desr="select * from site_rate where category_code='$cate_code' AND sitename='$site' order by item_code";
		//echo $desr;
	  	$r=mysql_query($desr,$conn);
	  	$i=1;
		while($m=mysql_fetch_array($r))
		{  
			$item_code1=$m["item_code"];
			$prate=$m["bgt_rate"];
			$bdata="select sum(curr_qty), sum(curr_amount) from billingdata where item_code='$item_code1' AND site='$site' AND vrform='$civrform'";
			//echo $bdata;
			$bdatar=mysql_query($bdata,$conn);
			$bdatam=mysql_fetch_array($bdatar);
			//$thisamt=($prate*$m['thisqty']);
			$pqty = $bdatam["sum(curr_qty)"];
			$pamt = $bdatam["sum(curr_amount)"];
			//$uqty = $pqty+$thisqty;
			
		?>
        
    <td class="qty"><?php echo $i; ?></td>
    <td width="250" height="30" class="textinner"><textarea name="item_1" rows="1" readonly="readonly" class="textinner" id="item_1"><?php echo $m["category_item"];?></textarea></td>
    <td class="units"><?php echo $m["item_code"];?></td>
    <td class="units"><?php echo $m["uom"];?> </td>
    <td class="rate"><input name="prate" type="text" class="prate" value="<?php echo $prate;?>" readonly="readonly" /></td>
    <td class="rate"><input name="pqty" type="text" class="prate" id="pqty" value="<?php echo $pqty;?>" readonly="readonly" size="12" /></td>
    <td class="rate" width="94"><?php echo $pamt;?></td>
    <td align="center" ><input name="thisqty" type="text" class="thisqty" id="thisqty<?php echo $i;?>" value="<?php echo $m["thisqty"];?>" size="12" onBlur="line(this.id,'<?php echo $prate;?>','<?php echo "thisamt".$i;?>')" /></td>
<td align="right"><input name="thisamt" type="text" class="thisamt" id="thisamt<?php echo $i;?>" value="<?php echo $thisamt; ?>" readonly="readonly";/></td>
    <td class="qty"><input name="uqty" type="text" class="prate" id="uqty" value="<?php echo $uqty;?>" readonly="readonly" size="12"/></td>
    <td><input name="uamt" type="text" class="prate" id="uqty" value="<?php echo $uamt;?>" readonly="readonly" size="12"/></td>
    </tr>
  <?php $i++; } ?>
</table>

Note : qty of previous Bill and this Bill section is added and show the total in update bill Qty like wise previous bill amt and this bill amt is added and show the total in update bill amt section.

I have attached the screen shot for reference.
Pls any help me

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.