Exemplo n.º 1
0
 case 'get':
     $res = $objcomisiones->searchDB($_POST['id'], 'id', 1);
     if (is_array($res)) {
         $res[0]['id_turno'] = $objturno->searchDB($res[0]['id_turno'], 'id', 1);
         $res[0]['id_turno'] = $res[0]['id_turno'][0];
         $res[0]['id_conductor'] = $objconductor->searchDB($res[0]['id_conductor'], 'id', 1);
         $res[0]['id_conductor'] = $res[0]['id_conductor'][0];
         $res[0]['id_supervisor'] = $objsupervisor->searchDB($res[0]['id_supervisor'], 'id', 1);
         $res[0]['id_supervisor'] = $res[0]['id_supervisor'][0];
         echo json_encode($res[0]);
     } else {
         echo json_encode(0);
     }
     break;
 case 'list':
     $res = $objcomisiones->listDB();
     if (is_array($res)) {
         foreach ($res as &$act) {
             $act['id_turno'] = $objturno->searchDB($act['id_turno'], 'id', 1);
             $act['id_turno'] = $act['id_turno'][0];
             $act['id_conductor'] = $objconductor->searchDB($act['id_conductor'], 'id', 1);
             $act['id_conductor'] = $act['id_conductor'][0];
             $act['id_supervisor'] = $objsupervisor->searchDB($act['id_supervisor'], 'id', 1);
             $act['id_supervisor'] = $act['id_supervisor'][0];
         }
         echo json_encode($res);
     } else {
         echo json_encode(0);
     }
     break;
 case 'search':
Exemplo n.º 2
0
<?php

require_once 'globales_sistema.php';
if (!isset($_COOKIE['nombre_usuario'])) {
    header('Location: index.php');
}
$titulo_pagina = 'Reporte Comisiones';
$titulo_sistema = 'Mamut Peru';
require_once 'recursos/componentes/header.php';
?>
</form>
<hr/>
<?php 
include_once 'nucleo/comisiones.php';
$obj = new comisiones();
$objs = $obj->listDB();
include_once 'nucleo/turno.php';
include_once 'nucleo/conductor.php';
include_once 'nucleo/supervisor.php';
?>
<div class='contenedor-tabla'>
    <table id='tb' class='display' cellspacing='0' width='100%'>
        <thead>
            <tr>
                <th>Id</th>
                <th>Fecha</th>
                <th>Turno</th>
                <th>Conductor</th>
                <th>Vueltas Por Comision</th>
                <th>Monto</th>
                <th>Motivo</th>