consulta($insert);
$pedidoid=$db->insert_id();
$productoid= trim($_REQUEST["productoid"]);
$precio=$db->field("precio","productos","productoid",$productoid);
$cantidad= trim($_REQUEST["cantidad"]);
$cantidad=str_replace("undefined","",$cantidad);
$total=$precio*$cantidad;
$insert_producto="INSERT INTO pedido_producto (pedidoid,productoid,cantidad,total)
VALUES (".$pedidoid.",".$productoid.",".$cantidad.",".$total.")";
$db->consulta($insert_producto);
for($x=1;$x<=$cuenta;$x++)
{
$productoid= trim($_REQUEST["productoid".$x]);
if($productoid>0)
{
$precio=$db->field("precio","productos","productoid",$productoid);
$cantidad= trim($_REQUEST["cantidad".$x]);
$cantidad=str_replace("undefined","",$cantidad);
$total=$precio*$cantidad;
$insert_producto="INSERT INTO pedido_producto (pedidoid,productoid,cantidad,total)
VALUES (".$pedidoid.",".$productoid.",".$cantidad.",".$total.")";
$db->consulta($insert_producto);
}
}
?>
GRACIAS POR SU PEDIDO
EN POCOS MINUTOS LLEGARA SU DOMICILIO
RECUERDE EL CODIGO DEL PEDIDO