%PDF- %PDF-
Direktori : /home/tjamichg/portal.tjamich.gob.mx/infofi/modules/consulta/ |
Current File : /home/tjamichg/portal.tjamich.gob.mx/infofi/modules/consulta/bitxusua.php |
<?php require("conn.php"); $token = $_GET['token']; ?> <br /> <div class="content"> <div class="titulo">Consulta de Bitácora por Usuario</div><br /> <form name="carga" method="post" action="" enctype="multipart/form-data"> <div class="fcampo"> <select name="nombre" onchange="location = 'index.php?token=<?php echo $_GET['token'] ?>&mod=bitxusuario&tab=' + this.options[this.selectedIndex].value" required> <option value="">- SELECCIONA EL USUARIO -</option> <?php mysqli_query($db, "SET NAMES 'utf8'"); $exFormat = mysqli_query($db, "SELECT * FROM sys_usus ORDER BY nombre ASC"); while($f = mysqli_fetch_array($exFormat)) { //if($f['idus'] == $_SESSION['idus']){ if($_GET['tab'] == $f['idus']) { echo "<option value='".$f['idus']."' selected>".$f['nombre']."</option>"; } else { echo "<option value='".$f['idus']."'>".$f['nombre']."</option>"; } //} } ?> </select> </div> <?php if(isset($_GET['tab'])) { ?> <br/> <form name="porfecha" action="" method="post"> <div class="fcampo">Del: <input type="date" name="del" required /> al: <input type="date" name="al" required /> <input type="submit" value="Consultar" /></div> </form> <br /> <hr /> <br /> <?php if(isset($_POST['del']) && isset($_POST['al'])) { if(!empty($_POST['del']) && !empty($_POST['al'])) { $rol = $_SESSION['rol']; $idus = $_SESSION['idus']; $del = $_POST['del']; $al = $_POST['al']; $de = $del . " 00:00:00"; $a = $al . " 23:59:59"; $sqlComp = mysqli_query($db, "SELECT * FROM bitacora WHERE fecha BETWEEN '$de' AND '$a' AND idus =".$_GET['tab']); echo "<p><b><i>Consulta por fechas del ".$del." al ".$al."</i></b></p>"; echo "<table class='tablas'>"; echo "<tr>"; echo "<td class='ctab'>Fecha</td>"; echo "<td class='ctab'>Folio</td>"; echo "<td class='ctab'>Cargó</td>"; echo "<td class='ctab'>Año</td>"; echo "<td class='ctab'>Tabla</td>"; echo "<td class='ctab'>Fecha Folio</td>"; echo "<td class='ctab'>Temporalidad</td>"; echo "<td class='ctab'>Aprobado</td>"; echo "<td class='ctab'>Acción</td>"; echo "<td class='ctab'>Modificó</td>"; echo "</tr>"; while($datos = mysqli_fetch_array($sqlComp)) { echo "<tr>"; echo "<td>".$datos['fecha']."</td>"; if ($datos['apro'] == 'N') { echo "<td><a href='index.php?token=".$_GET['token']."&tabla=".$datos['tabla']."&action=ver&mod=folios&folio=".$datos['folio']."®=men'>".$datos['folio']."</a></td>"; } else { echo "<td><a href='index.php?token=".$_GET['token']."&tabla=".$datos['tabla']."&action=ver&mod=foliosa&folio=".$datos['folio']."®=men'>".$datos['folio']."</a></td>"; } $carga = $datos['folio']; $sCarga = mysqli_query($db, "SELECT nombre FROM sys_usus u INNER JOIN nfolios f ON u.idus = f.idus WHERE f.folio='$carga'") or die(mysqli_error()); $dCarga = mysqli_fetch_row($sCarga); echo "<td>".$dCarga['0']."</td>"; echo "<td>".$datos['year']."</td>"; echo "<td>".$datos['tabla']."</td>"; echo "<td>".$datos['fechafolio']."</td>"; $tempo = $datos['tempo']; $sTempo = mysqli_query($db, "SELECT * FROM na_temp WHERE id='$tempo'") or die(mysqli_error()); $dTempo = mysqli_fetch_row($sTempo); echo "<td>".$dTempo['2']."</td>"; echo "<td>".$datos['apro']."</td>"; echo "<td>".$datos['accion']."</td>"; $modif = $datos['idus']; $sModif = mysqli_query($db, "SELECT nombre FROM sys_usus WHERE idus='$modif'") or die(mysqli_error()); $dModif = mysqli_fetch_row($sModif); echo "<td>".$dModif['0']."</td>"; echo "</tr>"; } echo "</table>"; } } else { echo "Necesitas tener un rango de fechas completo para poder realizar tu consulta."; } ?> <script> $(document).ready(function() { $('#example').DataTable( { "language": { "sProcessing": "Procesando...", "sLengthMenu": "Mostrar _MENU_ registros", "sZeroRecords": "No se encontraron resultados", "sEmptyTable": "Ningún dato disponible en esta tabla", "sInfo": "Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros", "sInfoEmpty": "Mostrando registros del 0 al 0 de un total de 0 registros", "sInfoFiltered": "(filtrado de un total de _MAX_ registros)", "sInfoPostFix": "", "sSearch": "Buscar:", "sUrl": "", "sInfoThousands": ",", "sLoadingRecords": "Cargando...", "oPaginate": { "sFirst": "Primero", "sLast": "Último", "sNext": "Siguiente", "sPrevious": "Anterior" }, "oAria": { "sSortAscending": ": Activar para ordenar la columna de manera ascendente", "sSortDescending": ": Activar para ordenar la columna de manera descendente" } } }); } ); </script> <?php } ?> </form> </div> </div>