示例#1
0
<?php

if (isset($_GET['idclie']) && isset($_GET['estado'])) {
    session_start();
    $idprove = $_GET['idclie'];
    $estado = $_GET['estado'];
    $idempresa = $_SESSION['empresa_def_id'];
    require "fun_sistema.php";
    $ad = new fun_sistema();
    $conexion = $ad->conectarBD();
    $sqlprove = $idprove == 0 ? "" : "clieprove_id={$idprove} and ";
    $sqlestado = $estado == 0 ? "estado!=3" : "estado={$estado}";
    $consulta = "select * from vistafactura where tipo=2 and ({$sqlprove} {$sqlestado}) and clieprove_id in(select clieprove from emp_clieprove where empresa={$idempresa} ) order by fecha_plazo";
    mysqli_set_charset($conexion, "utf8");
    $registro = mysqli_query($conexion, $consulta);
    $tabla = "";
    if ($registro) {
        $i = 0;
        //1 pendiente, 2 pagada , 3 eliminada
        while ($row = mysqli_fetch_array($registro)) {
            $boton = "";
            $check = "";
            $estado = "";
            $estado_pago = $row['estado'];
            //deshabilitar check box dependiendo del estado
            if ($estado_pago == 1) {
                $check = "<input name='" . $row['iddocumento'] . "' id='" . $row['iddocumento'] . "' type='checkbox'>";
            } else {
                if ($row['estado'] == 2) {
                    $check = "<input type='checkbox' disabled>";
                }
示例#2
0
 function getListadoEmpresasDisponibles($usuario)
 {
     require_once "fun_sistema.php";
     $ad = new fun_sistema();
     $conexion = $ad->conectarBD();
     $consulta = "select*from empresa where idempresa not in(select empresa from usu_emp where usuario={$usuario});";
     mysqli_set_charset($conexion, "utf8");
     $registro = mysqli_query($conexion, $consulta);
     $i = 0;
     $tabla = "";
     while ($row = mysqli_fetch_array($registro)) {
         echo "<option value='" . $row['idempresa'] . "'>" . $row['nombre'] . "</option>";
     }
 }