if (isset($_GET["fac"])) {
        $sql_where .= " AND r.facturado = '" . $_GET["fac"] . "'";
    }
    if (isset($_GET["nfac"])) {
        if ($_GET["nfac"] !== "") {
            $sql_where .= " AND r.numero_facturacion = '" . $_GET["nfac"] . "'";
        }
    }
}
$objsupervisor = new supervisor();
$sups = $objsupervisor->listDB();
$pesos = $objsupervisor->consulta_arreglo("Select sum(r.peso_neto) as kil from registro r, configuracion_vehiculo cv, unidad u where r.id_configuracion_vehiculo = cv.id AND cv.id_unidad = u.id" . $sql_where);
$total_mes = floatval($pesos["kil"]);
if (is_array($sups)) {
    foreach ($sups as $su) {
        $objtu = new registro();
        echo "<tr>";
        echo "<td>" . $su["nombres"] . " " . $su["apellidos"] . "</td>";
        $nombres[] = $su["nombres"] . " " . $su["apellidos"];
        $peso1 = $objtu->consulta_arreglo("Select sum(r.peso_neto) as kil from registro r, configuracion_vehiculo cv, unidad u where r.id_configuracion_vehiculo = cv.id AND cv.id_unidad = u.id" . $sql_where . " AND r.id_supervisor = '" . $su["id"] . "'");
        echo "<td>" . floatval($peso1["kil"]) . "</td>";
        $turno1 = $objtu->consulta_arreglo("Select count(DISTINCT r.id_turno, r.fecha) as cnt from registro r, configuracion_vehiculo cv, unidad u where r.id_configuracion_vehiculo = cv.id AND cv.id_unidad = u.id" . $sql_where . " AND r.id_supervisor = '" . $su["id"] . "'");
        echo "<td>" . floatval($turno1["cnt"]) . "</td>";
        echo "<td>" . round(floatval($peso1["kil"]) / floatval($turno1["cnt"]), 2) . "</td>";
        $promedios[] = floatval($peso1["kil"]) / floatval($turno1["cnt"]);
        echo "<td>" . round(floatval($peso1["kil"]) / $total_mes * 100, 2) . "</td>";
        $aportes[] = round(floatval($peso1["kil"]) / $total_mes * 100, 2);
        echo "</tr>";
    }
}
?>
Example #2
0
<?php

include_once 'nucleo/registro.php';
$obj = new registro();
include_once 'nucleo/registro_proceso.php';
include_once 'nucleo/registro_proceso_valor_proceso.php';
$pendientes = $obj->consulta_matriz("Select * from importacion");
if (is_array($pendientes)) {
    foreach ($pendientes as $pen) {
        $objreg = new registro();
        $objrgbus = new registro();
        $rc = $objrgbus->consulta_arreglo("Select id from conductor where codigo = '" . $pen["cod_conductor"] . "'");
        if (!is_array($rc)) {
            echo "codigo no encontrado: " . $pen["cod_conductor"];
        }
        $objreg->setIdConductor($rc["id"]);
        $objreg->setIdSupervisor($pen["id_supervisor"]);
        $objreg->setIdTurno($pen["id_turno"]);
        $objreg->setIdTrayecto("1");
        $objreg->setFecha($pen["fecha"]);
        $objreg->setIdConfiguracionVehiculo($pen["id_configuracion"]);
        $objreg->setPesoBruto($pen["bruto"]);
        $objreg->setPesoNeto($pen["neto"]);
        $objreg->setTara($pen["tara"]);
        $objreg->setIdEstadoCarga($pen["estado_carga"]);
        $objreg->setVar("facturado", "1");
        $objreg->setVar("numero_facturacion", "IMP");
        $id_registro = $objreg->insertDB();
        //registro proceso llegada
        $objregproc = new registro_proceso();
        $objregproc->setIdRegistro($id_registro);
    <div class='control-group'>
    <p></p>
    <button type='button' class='btn btn-danger' onclick='filtrar()'>Filtrar</button>
    </div>
</div>
<hr/>
<?php 
$sql_where = "";
if (isset($_GET["fb"])) {
    $sql_where .= " AND fecha = '" . $_GET["fb"] . "'";
}
if (isset($_GET["tu"])) {
    $sql_where .= " AND id_turno = '" . $_GET["tu"] . "'";
}
include_once 'nucleo/registro.php';
$obj = new registro();
$objs = $obj->consulta_matriz("Select * from registro where peso_bruto is null" . $sql_where);
include_once 'nucleo/conductor.php';
include_once 'nucleo/supervisor.php';
include_once 'nucleo/turno.php';
include_once 'nucleo/trayecto.php';
include_once 'nucleo/configuracion_vehiculo.php';
include_once 'nucleo/estado_carga.php';
include_once 'nucleo/acople.php';
?>
<div class='contenedor-tabla'>
    <table id='tb' class='display' cellspacing='0' width='100%'>
        <thead>
            <tr>
                <th>Id</th>
                <th>Turno</th>
<?php

require_once '../nucleo/registro_proceso.php';
$objregistro_proceso = new registro_proceso();
require_once '../nucleo/registro.php';
$objregistro = new registro();
require_once '../nucleo/proceso.php';
$objproceso = new proceso();
require_once '../nucleo/registro_proceso_valor_proceso.php';
$objvalor = new registro_proceso_valor_proceso();
if (isset($_POST['op'])) {
    switch ($_POST['op']) {
        case 'add':
            $objregistro_proceso->setVar('id', $_POST['id']);
            $objregistro_proceso->setVar('id_registro', $_POST['id_registro']);
            $objregistro_proceso->setVar('id_proceso', $_POST['id_proceso']);
            $objregistro_proceso->setVar('fecha_inicio', $_POST['fecha_inicio']);
            $objregistro_proceso->setVar('hora_inicio', $_POST['hora_inicio']);
            $objregistro_proceso->setVar('fecha_fin', $_POST['fecha_fin']);
            $objregistro_proceso->setVar('hora_fin', $_POST['hora_fin']);
            $id = $objregistro_proceso->insertDB();
            //si es que es necesario registramos valores
            if (intval($_POST["tipo_extra"]) > 0) {
                $objvalor->setIdRegistroProceso($id);
                $objvalor->setIdProceso($_POST["id_proceso"]);
                $objvalor->setIdValorProceso($_POST["id_valor_proceso"]);
                $objvalor->setDato($_POST["dato"]);
                $objvalor->insertDB();
            }
            echo json_encode($id);
            break;
<div class='control-group'>
    <p></p>
    <button type='button' class='btn btn-danger' onclick='filtrar()'>Filtrar</button>
</div>
</form>
<hr/>
<?php 
include_once 'nucleo/registro.php';
include_once 'nucleo/conductor.php';
include_once 'nucleo/turno.php';
include_once 'nucleo/configuracion_vehiculo.php';
include_once 'nucleo/estado_carga.php';
include_once 'nucleo/unidad.php';
include_once 'nucleo/tipo_unidad.php';
include_once 'nucleo/registro_proceso.php';
$obj = new registro();
$objs = null;
$sql = "Select r.* from registro r, configuracion_vehiculo cv, unidad u where r.id_configuracion_vehiculo = cv.id AND cv.id_unidad = u.id";
if (isset($_GET["fi"])) {
    if ($_GET["fi"] !== "") {
        if ($_GET["ff"] !== "") {
            $sql .= " AND r.fecha BETWEEN '" . $_GET["fi"] . "' AND '" . $_GET["ff"] . "'";
        } else {
            $sql .= " AND r.fecha >= '" . $_GET["fi"] . "'";
        }
    }
    if (isset($_GET["tu"])) {
        if ($_GET["tu"] !== "0") {
            $sql .= " AND u.id_tipo_unidad = '" . $_GET["tu"] . "'";
        }
    }
}
if (is_array($uns)) {
    foreach ($uns as $u) {
        $total = 0;
        echo "<tr>";
        echo "<td>" . $u["placa"] . "</td>";
        $objtu = new tipo_unidad();
        $objtu->setId($u["id_tipo_unidad"]);
        $objtu->getDB();
        echo "<td>" . $objtu->getNombre() . "</td>";
        if (isset($_GET["fi"])) {
            if ($_GET["fi"] !== "" && $_GET["ff"] !== "") {
                $fecha1 = $_GET["fi"];
                $fecha2 = $_GET["ff"];
                for ($i = $fecha1; $i <= $fecha2; $i = date("Y-m-d", strtotime($i . "+ 1 days"))) {
                    $objreg = new registro();
                    $conteo = $objreg->consulta_arreglo("Select count(r.id) as cnt from registro r, configuracion_vehiculo cv where r.id_configuracion_vehiculo = cv.id AND cv.id_unidad = '" . $u["id"] . "' AND r.fecha = '" . $i . "'");
                    echo "<td>" . intval($conteo["cnt"]) . "</td>";
                    $total = $total + intval($conteo["cnt"]);
                }
            }
        }
        echo "<td>" . $total . "</td>";
        echo "</tr>";
    }
}
?>
            <?php 
$nombre_tabla = 'reporte_presencia_de_flota';
require_once 'recursos/componentes/footer.php';
?>
Example #7
0
if (is_array($cons)) {
    foreach ($cons as $co) {
        $total = 0;
        echo "<tr>";
        echo "<td>" . $co["codigo"] . "</td>";
        echo "<td>" . $co["nombres"] . " " . $co["apellidos"] . "</td>";
        $objgc = new grupo_conductor();
        $objgc->setId($co["id_grupo_conductor"]);
        $objgc->getDB();
        echo "<td>" . $objgc->getNombre() . "</td>";
        if (isset($_GET["fi"])) {
            if ($_GET["fi"] !== "" && $_GET["ff"] !== "") {
                $fecha1 = $_GET["fi"];
                $fecha2 = $_GET["ff"];
                for ($i = $fecha1; $i <= $fecha2; $i = date("Y-m-d", strtotime($i . "+ 1 days"))) {
                    $objreg = new registro();
                    $conteo = $objreg->consulta_arreglo("Select count(id) as cnt from registro WHERE id_conductor = '" . $co["id"] . "' AND fecha = '" . $i . "'");
                    echo "<td>" . intval($conteo["cnt"]) . "</td>";
                    $total = $total + intval($conteo["cnt"]);
                }
            }
        }
        echo "<td>" . $total . "</td>";
        echo "</tr>";
    }
}
?>
            <?php 
$nombre_tabla = 'reporte_viajes';
require_once 'recursos/componentes/footer.php';
?>
Example #8
0
 if ($_GET["fi"] !== "" && $_GET["ff"] !== "") {
     $fecha1 = $_GET["fi"];
     $fecha2 = $_GET["ff"];
     $objturno = new turno();
     $turnos = $objturno->listDB();
     $cturno = count($turnos);
     $j = 0;
     $viajes = 0;
     $kilos = 0;
     for ($i = $fecha1; $i <= $fecha2; $i = date("Y-m-d", strtotime($i . "+ 1 days"))) {
         if (is_array($turnos)) {
             $j = 0;
             $viajes = 0;
             $kilos = 0;
             foreach ($turnos as $tr) {
                 $objreg = new registro();
                 $j = $j + 1;
                 echo "<tr>";
                 echo "<td>" . $i . "</td>";
                 echo "<td>" . $tr["nombre"] . "</td>";
                 $vueltas = $objreg->consulta_arreglo("Select count(r.id) as cnt from registro r, configuracion_vehiculo cv, unidad u where r.id_configuracion_vehiculo = cv.id AND cv.id_unidad = u.id AND r.id_turno = '" . $tr["id"] . "' AND r.fecha = '" . $i . "'" . $sql_where);
                 echo "<td>" . $vueltas["cnt"] . "</td>";
                 $viajes = $viajes + intval($vueltas["cnt"]);
                 $col1 = $col1 + intval($vueltas["cnt"]);
                 $pesos = $objreg->consulta_arreglo("Select sum(r.peso_neto) as kil from registro r, configuracion_vehiculo cv, unidad u where r.id_configuracion_vehiculo = cv.id AND cv.id_unidad = u.id AND r.id_turno = '" . $tr["id"] . "' AND r.fecha = '" . $i . "'" . $sql_where);
                 echo "<td>" . $pesos["kil"] . "</td>";
                 $kilos = $kilos + floatval($pesos["kil"]);
                 $col2 = $col2 + floatval($pesos["kil"]);
                 if ($j === $cturno) {
                     echo "<td>" . $viajes . "</td>";
                     echo "<td>" . $kilos . "</td>";
Example #9
0
<?php

require_once '../nucleo/registro.php';
$objregistro = new registro();
require_once '../nucleo/conductor.php';
$objconductor = new conductor();
require_once '../nucleo/supervisor.php';
$objsupervisor = new supervisor();
require_once '../nucleo/turno.php';
$objturno = new turno();
require_once '../nucleo/trayecto.php';
$objtrayecto = new trayecto();
require_once '../nucleo/configuracion_vehiculo.php';
$objconfiguracion_vehiculo = new configuracion_vehiculo();
require_once '../nucleo/estado_carga.php';
$objestado_carga = new estado_carga();
if (isset($_POST['op'])) {
    switch ($_POST['op']) {
        case 'add':
            $objregistro->setVar('id', $_POST['id']);
            $objregistro->setVar('id_conductor', $_POST['id_conductor']);
            $objregistro->setVar('id_supervisor', $_POST['id_supervisor']);
            $objregistro->setVar('id_turno', $_POST['id_turno']);
            $objregistro->setVar('id_trayecto', $_POST['id_trayecto']);
            $objregistro->setVar('fecha', $_POST['fecha']);
            $objregistro->setVar('id_configuracion_vehiculo', $_POST['id_configuracion_vehiculo']);
            $objregistro->setVar('peso_bruto', $_POST['peso_bruto']);
            $objregistro->setVar('tara', $_POST['tara']);
            $objregistro->setVar('peso_neto', $_POST['peso_neto']);
            $objregistro->setVar('id_estado_carga', $_POST['id_estado_carga']);
            $objregistro->setVar('facturado', $_POST['facturado']);
Example #10
0
    </a>
  </h4>
</div>
<div id="cp1" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="hp1">
  <div class="panel-body">
      <iframe style='width: 100%;height:700px;' frameborder="0" id="frame_procesos"></iframe>
      <button type='button' class='btn btn-danger' onclick='fin()'>Finalizar</button>
      <button type='button' class='btn btn-warning' onclick='cancelar()'>Cancelar</button>
  </div>
</div>
</div>
</form>
<hr/>
<?php 
include_once 'nucleo/registro.php';
$obj = new registro();
$objs = $obj->listDB();
include_once 'nucleo/conductor.php';
include_once 'nucleo/supervisor.php';
include_once 'nucleo/turno.php';
include_once 'nucleo/trayecto.php';
include_once 'nucleo/configuracion_vehiculo.php';
include_once 'nucleo/estado_carga.php';
include_once 'nucleo/acople.php';
?>
<div class='contenedor-tabla'>
    <table id='tb' class='display' cellspacing='0' width='100%'>
        <thead>
            <tr>
                <th>Id</th>
                <th>Conductor</th>
Example #11
0
                <th>OPC</th>
            </tr>
        </thead>
        <tbody>
            <?php 
if (is_array($objs)) {
    foreach ($objs as $o) {
        ?>
                    <tr>
                        <td><?php 
        echo $o['id'];
        ?>
</td>
                        <td>
                        <?php 
        $objregistro = new registro();
        $objregistro->setVar('id', $o['id_registro']);
        $objregistro->getDB();
        echo $objregistro->getVar($gl_registro_proceso_id_registro);
        ?>
</td>
                        <td>
                        <?php 
        $objproceso = new proceso();
        $objproceso->setVar('id', $o['id_proceso']);
        $objproceso->getDB();
        echo $objproceso->getNombre();
        ?>
</td>
                        <td><?php 
        echo $o['fecha_inicio'];