<?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);
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>"; } } ?> <?php $nombre_tabla = 'reporte_aporte_produccion'; require_once 'recursos/componentes/footer.php'; ?>
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'; ?>
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'; ?>
$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>"; $col3 = $col3 + $viajes; $col4 = $col4 + $kilos; } else { echo "<td></td>"; echo "<td></td>";