%PDF- %PDF-
| Direktori : /home/tjamichg/portal.tjamich.gob.mx/infofi/modules/consulta/ |
| Current File : /home/tjamichg/portal.tjamich.gob.mx/infofi/modules/consulta/bitxusua_bk.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>";
?>
<br />
<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th class="ctab">Fecha</th>
<th class="ctab">Folio</th>
<th class="ctab">Cargó</th>
<th class="ctab">Año</th>
<th class="ctab">Tabla</th>
<th class="ctab">Fecha Folio</th>
<th class="ctab">Temporalidad</th>
<th class="ctab">Aprobado</th>
<th class="ctab">Acción</th>
<th class="ctab">Modificó</th>
</tr>
</thead>
<tfoot>
<tr>
<th class="ctab">Fecha</th>
<th class="ctab">Folio</th>
<th class="ctab">Cargó</th>
<th class="ctab">Año</th>
<th class="ctab">Tabla</th>
<th class="ctab">Fecha Folio</th>
<th class="ctab">Temporalidad</th>
<th class="ctab">Aprobado</th>
<th class="ctab">Acción</th>
<th class="ctab">Modificó</th>
</tr>
</tfoot>
<tbody>
<?php
while($datos = mysqli_fetch_array($sqlComp))
{
?>
<tr>
<td><?php echo $datos['fecha'] ?></td>
<?php
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);
?>
<td><?php echo $dCarga['0'] ?></td>
<td><?php echo $datos['year'] ?></td>
<td><?php echo $datos['tabla'] ?></td>
<td><?php echo $datos['fechafolio'] ?></td>
<?php
$tempo = $datos['tempo'];
$sTempo = mysqli_query($db, "SELECT * FROM na_temp WHERE id='$tempo'") or die(mysqli_error());
$dTempo = mysqli_fetch_row($sTempo);
?>
<td><?php echo $dTempo['2']; ?></td>
<td><?php echo $datos['apro']; ?></td>
<td><?php echo $datos['accion']; ?></td>
<?php
$modif = $datos['idus'];
$sModif = mysqli_query($db, "SELECT nombre FROM sys_usus WHERE idus='$modif'") or die(mysqli_error());
$dModif = mysqli_fetch_row($sModif);
?>
<td><?php echo $dModif['0']; ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
}
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>