Exemplo n.º 1
0
    $weblink = $_POST['ocul_link_' . $i];
    $crud->moneda_dec($_POST['precio_' . $i]);
    $precio = $crud->getValor();
    $cantidad = $_POST['cantidad_' . $i];
    $crud->moneda_dec($_POST['costo_ship_' . $i]);
    $shipping = $crud->getValor();
    $peso = $_POST['peso_' . $i];
    $state = $_POST['state_tax_' . $i];
    $crud->moneda_dec($_POST['pa_' . $i]);
    $precio_web = $crud->getValor();
    $crud->moneda_dec($_POST['flete_' . $i]);
    $flete = $crud->getValor();
    $crud->moneda_dec($_POST['subtotal_' . $i]);
    $total = $crud->getValor();
    $cotizacion_id = $_POST['refe'];
    //quitar las "," de los numeros para guardarlos en la base de datos.
    $valores = $valores . "('" . $tipo_serv . "','" . $descrip . "','" . $weblink . "','" . $precio . "','" . $cantidad . "','" . $shipping . "','" . $precio_web . "','" . $flete . "','" . $total . "','" . $peso . "','" . $state . "','" . $cotizacion_id . "'),";
    $i++;
}
$valores = trim($valores, ",");
$array[0] = $valores;
$campos = "tipo_servicio,descripcion,weblink,precio_articulo,cantidad,shipping,precio_web,flete_smi,total,peso,state_tax,cotizacion_id";
$tabla = "items";
$mensaje = "Datos guardados con exito.";
$crud->insertar2($array, $campos, $tabla, $con->getConection(), $mensaje);
$con->desconectar();
?>



$con->conectar();
$crud2 = new Crud();
//insertamos el orden
$campos = "fecha_captu";
$tabla = "orden_captu";
$mensaje = "ok";
$valores = date('Y-m-d');
//------------
$crud2->insertar($valores, $campos, $tabla, $con->getConnection(), $mensaje, 'captura_id');
$crud = new Crud();
$campos = "contenido,orden_capturas";
$tabla = "capturas";
$mensaje = "Captura(s) guardada(s) con exito.";
$i = 1;
$valores = '';
$ult_id = $crud2->getLastid();
while ($i <= $_POST['control']) {
    if (isset($_POST['sel' . $i])) {
        //$valores = $_POST['vaso'.$i];
        $valores = $valores . "('" . $_POST['vaso' . $i] . "',{$ult_id}),";
    }
    $i++;
    //$crud->insertar2($valores,$campos,$tabla,$con->getConnection(),$mensaje);
}
$valores = trim($valores, ',');
$crud->insertar2($valores, $campos, $tabla, $con->getConnection(), $mensaje);
echo $crud2->getLastid();
$con->desconectar();
?>