示例#1
0
<?php

include_once "../../login/check.php";
include_once "../../class/gastos.php";
$gastos = new gastos();
extract($_POST);
$CodUsuarioRegistro = $_SESSION['CodUsuarioLog'];
$NivelRegistro = $_SESSION['Nivel'];
$FechaRegistro = fecha2Str("", 0);
$HoraRegistro = date("H:i:s");
/*echo "<pre>";
print_r($_POST);
echo "</pre>";*/
foreach ($m as $p) {
    extract($p);
    if ($producto != "") {
        $Valores = array("Producto" => "'{$producto}'", "Cantidad" => "'{$cantidad}'", "PrecioUnitario" => "'{$preciounitario}'", "Total" => "'{$total}'", "Fecha" => "'{$fecha}'");
        //print_r($Valores);
        $gastos->insertarRegistro($Valores, 1);
    }
}
//$gastos->insertarRegistro($Valores,0);
$Mensajes[] = $idioma["GuardadoCorrectamente"];
$folder = "../../";
header("Location:index.php?e=1");
示例#2
0
        $this->Pagina();
        $this->Ln();
        $this->TituloCabecera(10, "N", 10);
        $this->TituloCabecera(100, "Producto", 10);
        $this->TituloCabecera(30, "Cantidad", 10);
        $this->TituloCabecera(30, "Precio Unitario", 10);
        $this->TituloCabecera(30, "Total", 10);
        $this->TituloCabecera(30, "Fecha", 10);
    }
}
$Producto = $_GET['Producto'];
$FechaInicio = $_GET['FechaInicio'];
$FechaFin = $_GET['FechaFin'];
$pdf = new PDF("L", "mm", "letter");
$pdf->AddPage();
$gastos = new gastos();
$Producto = $Producto != "" ? "%{$Producto}%" : "%";
$FechaInicio = $FechaInicio != "" ? "{$FechaInicio}" : "";
$FechaFin = $FechaFin != "" ? "{$FechaFin}" : "";
$where .= " Producto LIKE '{$Producto}' and Fecha BETWEEN '{$FechaInicio}' and '{$FechaFin}' ";
$gas = $gastos->mostrar($where, "HoraRegistro", 1);
$Nivel = $_SESSION['Nivel'];
$pdf->SetWidths(array(10, 100, 30, 30, 30, 30));
$pdf->Fuente("", 9);
$pdf->SetAligns(array("R", "L", "R", "R", "R", "C", "", "L", "R", "R", "R", "C"));
if (count($gas) == 0) {
    $pdf->CuadroCuerpo(190, "Sin Ordenes");
} else {
    $total = 0;
    $Cantidad = 0;
    $PrecioUnitario = 0;