esto esta en myajax.php
Código PHP:
function preciosproforma()
{
$total=0;
$totald=0;
for($i=0;$i<count($_SESSION['usuario']['carrito']);$i++)
{
foreach ($_SESSION['usuario']['carrito'][$i] as $k => $v)
{
if($k=='subtotald')
{
$totald+=$v;
$sumas=round($totald,2);
}
}
}
echo"<table width='100%'>
<tr>
<td>
<b>Total US$:</b>
</td>
<td>
<input name='totaldol' class='form' value='$sumas' readonly='yes'></input>
</td>
<td>
<b>Regalos S/.:</b>
</td>
<td>";?>
<input type='text' name='regal' class='form' value='<?php
$miconexion->consulta("select * from obsequios where ob_pas<>1 order by ob_id desc limit 1");
$row5=mysql_fetch_array($miconexion->Consulta_ID);
$ob_id=$row5['ob_id'];
$ob_p=$row5['ob_precio'];
echo "hola--$ob_p--adios";?>' readonly='yes'></input>
<? echo"</td>
<td>
<b>Descuento S/.:</b>
</td>
<td>
<input class='form' name='desc' onKeyUp=\"enviaQuery('divResultadocalc','myajax.php?opcion=calcular_preciofinal&pdUSS='+document.form11.totaldol.value+'&pdesc='+document.form11.desc.value+'&pdreg='+document.form11.regal.value);\">
</td>
</tr></table>";
}
//fin de muestra total