%PDF- %PDF-
| Direktori : /home/tjamichg/intranet.tjamich.gob.mx/intranet/sistemas/usuarios/ |
| Current File : /home/tjamichg/intranet.tjamich.gob.mx/intranet/sistemas/usuarios/content_find_solicitudes_area.php |
<?php
$error = isset($_REQUEST['error']) ? $_REQUEST['error'] : '0';
$conf = new Configuracion();
$conf->conectarBD();
?>
<script type="text/javascript">
$(document).ready(function () {
$('#table_id').DataTable({
dom: 'Bfrtip',
buttons: [
'print'
]
});
});
</script>
<div class="page-content">
<a href="../../page_home.php" class="btn btn-pink">Regresar <i class="fa fa-mail-reply"></i></a>
<!-- <a href="reporte_plantilla.php" target="_blank" class="btn btn-pink">Imprimir <i class="fa fa-mail-reply"></i></a> -->
<br> <br>
<div class="row">
<?php
if ($error == 1) {
?>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8">
<div class="alert alert-danger">
<strong>Error!</strong> El número de empleado ya existe, por favor verifiquelo.
</div>
</div>
<div class="col-md-2">
</div>
</div>
<?php
} else if ($error == 2) {
?>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8">
<div class="alert alert-success">
<strong>Hecho!</strong> Se ha registrado correctamente el movimiento.
</div>
</div>
<div class="col-md-2">
</div>
</div>
<?php
}
?>
<div class="col-md-12">
<div id="generalTabContent" class="tab-content">
<div id="tab-messages" class="tab-pane fade in active">
<div class="portlet box">
<div class="portlet-header">
<div class="caption">Historial de solicitudes de movimientos </div>
</div>
<div class="portlet-body">
<?php
if (1 == 1) {
echo '<div class="panel-body">
<div class="demo-btn">
<div class="row mbm center">
<a href="../usuarios/page_solicitar_rh.php?app=2" class="btn btn-success">Generar nueva solicitud
<i class="fa fa-plus"></i></a><br><br>
</div></div></div>';
}
?>
<div class="row mbm">
<div class="col-lg-12">
<div class="table-responsive">
<table id="data_table" style="border-bottom:1px solid #ddd"
class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>#</th>
<th>Movimiento</th>
<th>Oficio</th>
<th>Empleado</th>
<th>Area - Puesto</th>
<th>Fecha de registro</th>
<th>Status</th>
<!-- <th>PDF</th> -->
<th></th>
</tr>
</thead>
<tbody>
<?php
$consulta1 = "SELECT e.*, e.tipo AS idtipo2, a.tipo AS tipomovimiento, s.estatus AS estatustipo
FROM tjam_areas_solicitudes e
JOIN tjam_areas_solicitudes_tipo a ON e.tipo = a.id_tipo
JOIN tjam_areas_solicitudes_estatus s ON e.id_estatus = s.id_estatus
WHERE e.habilitado = '1'
ORDER BY e.fecha_registro DESC, e.fecha_mod DESC";
$rst1 = $conf->consulta($consulta1);
$id_contrato = '0';
for ($i = 0; $i < count($rst1); $i++) {
echo "<tr>";
echo "<td>" . ($i + 1) . "</td>";
echo "<td>" . $rst1[$i]["tipomovimiento"] . "</td>";
echo "<td>" . $rst1[$i]["oficioa"] . "</td>";
if ($rst1[$i]["idtipo2"] == 7) {
echo "<td>" . $rst1[$i]["nombre_empleado"] . " / SOLICITA - " . $rst1[$i]["nombre_n"] . " " . $rst1[$i]["apellidop_n"] . " " . $rst1[$i]["apellidom_n"] . "</td>";
} else {
echo "<td>" . $rst1[$i]["nombre_empleado"] . "</td>";
}
if ($rst1[$i]["idtipo2"] == 2) {
echo "<td>ACTUAL / " . $rst1[$i]["areaoldnew"] . " - " . $rst1[$i]["puestooldnew"] . "</td>";
} elseif ($rst1[$i]["idtipo2"] == 7) {
echo "<td>" . $rst1[$i]["area"] . " - " . $rst1[$i]["puesto"] . " / " . $rst1[$i]["areaoldnew"] . " - " . $rst1[$i]["puestooldnew"] . "</td>";
} else {
echo "<td>" . $rst1[$i]["area"] . " - " . $rst1[$i]["puesto"] . "</td>";
}
echo "<td>" . $rst1[$i]["fecha_registro"] . "</td>";
// COMPROBAR ESTADO
$id_solicitud2 = $rst1[$i]['id_solicitud'];
$consulta1est = "SELECT e.*
FROM tjam_areas_solicitudes_bitacora e
WHERE e.id_solicitud = '$id_solicitud2' AND e.estatus = 5";
$rst1est = $conf->consulta($consulta1est);
$completadocheck = $rst1est[0]["completado"];
if ($completadocheck == 1) {
echo '<td><span class="label label-success">Finalización de Solicitud</span></td>';
} else {
// SEGUNDA COMPROBACIÓN DESPUES DE COMRPOBACIÓN GENERAL
if ($rst1[$i]["id_estatus"] == 6) {
echo '<td><span class="label label-danger">' . $rst1[$i]["estatustipo"] . '</span></td>';
} elseif ($rst1[$i]["id_estatus"] == 5) {
$consulta1f = "SELECT e.*
FROM tjam_areas_solicitudes_bitacora e
WHERE e.id_solicitud = '$id_solicitud2' AND e.estatus = 5 LIMIT 1";
$rst1f = $conf->consulta($consulta1f);
$firma = $rst1f[$i]["firma"];
if ($firma == 1) {
echo '<td><span class="label label-success">' . $rst1[$i]["estatustipo"] . '</span></td>';
} else {
echo '<td><span class="label label-warning">En espera de firma - ' . $rst1[$i]["estatustipo"] . '</span></td>';
}
} elseif ($rst1[$i]["id_estatus"] == 4) {
echo '<td><span class="label label-info">' . $rst1[$i]["estatustipo"] . '</span></td>';
} else {
echo '<td><span class="label label-warning">' . $rst1[$i]["estatustipo"] . '</span></td>';
}
}
echo '<td><div class="btn-group">
<button data-toggle="dropdown" class="btn btn-sm dropdown-toggle btn-blue">
<i class="fa fa-cog"></i> Opciones <span class="caret"></span>
</button>
<ul class="dropdown-menu pull-right">';
echo '<li><a target="_blank" href="../usuarios/page_seguimiento_rh.php?id_solicitud=' . $rst1[$i]['id_solicitud'] . '" target="_blank">
<i class="fa fa-share"></i><span class="divider-text"></span>Seguimiento</a></li>';
echo '</ul></div></td>';
echo '</tr>';
}
$conf->desconectarDB();
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
/**
* Inicializa laas librerías correspondientes
*/
document.addEventListener("DOMContentLoaded", function (event) {
$('#data_table').DataTable(); // inicializa datatable
});
</script>