Example #1
0
<?php

session_start();
require_once "../fun_sistema.php";
$ad = new fun_sistema();
$numero = $_POST['fact_numero'];
$clieprove = $_POST['idclieprove'];
$fecha_doc = $ad->cambiaf_a_mysql($_POST['fact_fecha_doc']);
$fecha_plazo = $ad->cambiaf_a_mysql($_POST['fact_fecha_plazo']);
$usuario = $_SESSION['idusuario'];
$empresa = $_POST['empresa'];
$glosa = $_POST['fact_glosa'];
$neto = str_replace(',', '', $_POST['fact_neto']);
$iva = str_replace(',', '', $_POST['fact_iva']);
$total = str_replace(',', '', $_POST['fact_total']);
$consulta = "call insertarfactura(2,{$numero},{$clieprove},'{$fecha_doc}','{$fecha_plazo}',{$usuario},{$empresa},'{$glosa}',{$neto},{$iva},{$total},1);";
$conexion = $ad->Query($consulta);
Example #2
0
<?php

if (isset($_GET["desde"]) || isset($_GET["hasta"])) {
    require_once "fun_sistema.php";
    $ad = new fun_sistema();
    $conexion = $ad->conectarBD();
    $w = '';
    if ($_GET["desde"] && $_GET["hasta"]) {
        //feha desde y hasta
        $desde = $ad->cambiaf_a_mysql($_GET["desde"]);
        $hasta = $ad->cambiaf_a_mysql($_GET["hasta"]);
        //consulta
        $w .= "where (fecha between '{$desde}' and '{$hasta}') ";
    }
    if ($_GET["accion"]) {
        if ($w) {
            $w .= " and (accion='" . $_GET["accion"] . "') ";
        } else {
            $w .= " where (accion='" . $_GET["accion"] . "') ";
        }
    }
    if ($_GET["usuario"]) {
        if ($w) {
            $w .= " and (usuario_id=" . $_GET["usuario"] . ") ";
        } else {
            $w .= " where (usuario_id=" . $_GET["usuario"] . ") ";
        }
    }
    $consulta = "select * from vistahistorial {$w} order by idhistorial;";
    mysqli_set_charset($conexion, "utf8");
    $registro = mysqli_query($conexion, $consulta);