%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/tjamichg/intranet.tjamich.gob.mx/intranet/sistemas/usuarios/
Upload File :
Create Path :
Current File : /home/tjamichg/intranet.tjamich.gob.mx/intranet/sistemas/usuarios/content_seguimiento_rh.php

<?php



$error = isset($_REQUEST['error']) ? $_REQUEST['error'] : '0';

$id_solicitud = isset($_REQUEST['id_solicitud']) ? $_REQUEST['id_solicitud'] : '0';



$id_usuario = $_SESSION['id_usuario'];





$conf = new Configuracion();

$conf->conectarBD();





// VERIFICAR SOLICITUD

$consulta1 = "SELECT e.*, 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.id_solicitud = '$id_solicitud' ORDER BY e.fecha_registro DESC";

$rst1 = $conf->consulta($consulta1);



$id_plantilla = $rst1[0]["id_plantilla"];

$tipomovimiento2 = $rst1[0]["tipomovimiento"];

$estatustipo = $rst1[0]["estatustipo"];



$id_empleado = $rst1[0]["id_empleado"];

$id_puesto = $rst1[0]["id_puesto"];

$id_area = $rst1[0]["id_area"];

$id_puestooldnew = $rst1[0]["id_puestooldnew"];

$id_areaoldnew = $rst1[0]["id_areaoldnew"];

$tipo_solicitud = $rst1[0]["tipo"];

$nombre_empleado = $rst1[0]["nombre_empleado"];

$area = $rst1[0]["area"];

$rfc = $rst1[0]["rfc"];

$rfc_n = $rst1[0]["rfc_n"];

$nss_n = $rst1[0]["nss_n"];

$fecha_registro = $rst1[0]["fecha_registro"];

$fecha_inicio = $rst1[0]["fecha_inicio"];

$fecha_fin = $rst1[0]["fecha_fin"];

$fecha_oficio = $rst1[0]["fecha_oficio"];

$oficioa = $rst1[0]["oficioa"];

$oficiob = $rst1[0]["oficiob"];

$oficioc = $rst1[0]["oficioc"];



$nombre_n = $rst1[0]["nombre_n"];

$apellidop_n = $rst1[0]["apellidop_n"];

$apellidom_n = $rst1[0]["apellidom_n"];

$observaciones = $rst1[0]["observaciones"];

// $id_area = 11;





// OBTENER PASO ACTUAL

$consulta1m = "SELECT e.*, a.estatus AS estatusmovimiento, e.estatus AS estatustipo

            FROM tjam_areas_solicitudes_bitacora e

            JOIN tjam_areas_solicitudes_estatus a ON e.estatus = a.id_estatus

            WHERE e.id_solicitud = '$id_solicitud' AND e.completado = '0' ORDER BY e.estatus ASC LIMIT 1";

$rst1m = $conf->consulta($consulta1m);



$id_bitacora = $rst1m[0]["id_bitacora"];

$tipomovimiento = $rst1m[0]["tipomovimiento"];

$estatus = $rst1m[0]["estatus"];



// $id_bitacora_firma = $id_bitacora;





if ($id_solicitud > 999) {

    $oficioautomatico = 'TJAM-SA/RH/' . $id_solicitud . '/' . date("Y");

} elseif ($id_solicitud > 99 && $id_solicitud < 1000) {

    $oficioautomatico = 'TJAM-SA/RH/' . substr_replace($id_solicitud, '0', 0, 0) . '/' . date("Y");

} elseif ($id_solicitud > 9 && $id_solicitud < 100) {

    $oficioautomatico = 'TJAM-SA/RH/' . substr_replace($id_solicitud, '00', 0, 0) . '/' . date("Y");

} elseif ($id_solicitud > 0 && $id_solicitud < 10) {

    $oficioautomatico = 'TJAM-SA/RH/' . substr_replace($id_solicitud, '000', 0, 0) . '/' . date("Y");

}





// EVIDENCIAS ADJUNTAS

$sql12 = "SELECT * FROM tjam_areas_solicitudesarchivos WHERE id_solicitud = '$id_solicitud' AND habilitado = 1";

$res12 = $conf->consulta($sql12);





// VERIFICAR ROL - USUARIO LOGGEADO

$consultau = "SELECT id_rol, solicitud_presidencia, solicitud_rol, solicitud_firma

        FROM tjam_empleados

        WHERE id = '$id_usuario' LIMIT 1";

$rst1u = $conf->consulta($consultau);



$id_rol = $rst1u[0]["id_rol"];

$solicitud_presidencia = $rst1u[0]["solicitud_presidencia"];

$solicitud_rol = $rst1u[0]["solicitud_rol"];

$solicitud_firma = $rst1u[0]["solicitud_firma"];







// OMITIR MODAL AL CANCELAR

if ($estatus == 0 || $estatus >= 6) {

    // No mas opciones

} else {

    include 'modal_proceso.php';

    include 'modal_proceso2.php';

}



include 'modalFirmaSolicitud.php';





switch ($tipo_solicitud) {

    case '1':

        $label1 = 'contrato';

        break;

    case '2':

        $label1 = 'contrato';

        break;

    case '3':

        $label1 = 'permiso';

        break;

    case '4':

        $label1 = 'permiso';

        break;

    case '5':

        $label1 = 'permiso';

        break;

    case '6':

        $label1 = 'contrato';

        break;

    case '7':

        $label1 = 'contrato';

        break;

    default:

        # code...

        break;

}



?>



<script type="text/javascript">

    $(document).ready(function () {

        $('#table_id').DataTable({

            dom: 'Bfrtip',

            buttons: [

                'print'

            ]

        });

    });

</script>



<div class="page-content">



    <a href="page_find_solicitudes_area.php" class="btn btn-pink">Regresar <i class="fa fa-mail-reply"></i></a>

    <br> <br>



    <form data-toggle="validator" method="post" role="form" enctype="multipart/form-data">

        <!-- action="./agregar_solicitud_area.php" onsubmit="return checkForm(this);" -->

        <div class="portlet box portlet-gray">



            <div class="portlet-header">

                <div class="caption"><strong>

                        <?php echo $tipomovimiento2 . ' - ' . $nombre_empleado . ' - ' . $rfc . ' - ' . $area . ' - ' . $oficioa; ?>

                    </strong>

                </div>



            </div>



            <div class="portlet-body">



                <div class="row">



                    <input type="hidden" name="tipo_solicitud" value="<?php echo $tipo_solicitud; ?>" />

                    <input type="hidden" name="id_plantilla" value="<?php echo $id_plantilla; ?>" />





                    <div class="col-md-6">

                        <div class="form-group"><label for="inputName" class="control-label">

                                <dt>Tipo de solicitud</dt>

                            </label>

                            <select readonly class="select2-multi-value form-control" required name="id_tipo_contrato"

                                id="id_tipo_contrato">

                                <?php

                                $consultac = "SELECT * FROM tjam_areas_solicitudes_tipo

                                                WHERE id_tipo = '$tipo_solicitud'";

                                $rst1c = $conf->consulta($consultac);



                                for ($i = 0; $i < count($rst1c); $i++) {

                                    echo '<option selected value="' . $rst1c[$i]["id_tipo"] . '">' . $rst1c[$i]["tipo"] . '</option>';

                                }

                                ?>

                            </select>

                        </div>

                    </div>

                    <div class="col-md-6">

                        <div class="form-group"><label for="inputName" class="control-label">

                                <dt>Fecha de registro</dt>

                            </label>

                            <div class="input-icon left"><i class="fa fa-edit"></i><input readonly id="cliente"

                                    type="date" value="<?php echo $fecha_registro; ?>" name="fecha_registro"

                                    class="form-control" minlength="13" />

                            </div>

                        </div>

                    </div>



                    <div class="col-md-4">

                        <div class="form-group"><label for="inputName" class="control-label">

                                <dt>Nombre de Empleado </dt>

                            </label>

                            <select readonly class="select2-multi-value form-control" name="id_personal" required>

                                <?php

                                $consultac = "SELECT id,num_empleado,nombre,apellido1,apellido2

                                                    FROM tjam_empleados

                                                    WHERE id = '$id_empleado' ORDER BY nombre ASC";

                                $rst1c = $conf->consulta($consultac);



                                for ($i = 0; $i < count($rst1c); $i++) {

                                    echo '<option selected value="' . $rst1c[$i]["id"] . '" selected>' . $rst1c[$i]["nombre"] . ' ' . $rst1c[$i]["apellido1"] . ' ' . $rst1c[$i]["apellido2"] . '</option>';

                                }

                                ?>

                            </select>

                        </div>

                    </div>







                    <div class="col-md-4">

                        <div class="form-group"><label for="inputName" class="control-label">

                                <dt>Puesto</dt>

                            </label>

                            <select readonly class="select2-multi-value form-control" required name="id_puesto">

                                <?php

                                $consultac = "SELECT id_puesto,puesto FROM tjam_puestos

                                                WHERE id_puesto = '$id_puesto'";

                                $rst1c = $conf->consulta($consultac);



                                for ($i = 0; $i < count($rst1c); $i++) {

                                    echo '<option selected value="' . $rst1c[$i]["id_puesto"] . '">' . $rst1c[$i]["puesto"] . '</option>';

                                }

                                ?>

                            </select>

                        </div>

                    </div>



                    <div class="col-md-4">

                        <div class="form-group"><label for="inputName" class="control-label">

                                <dt>Área</dt>

                            </label>

                            <select readonly class="select2-multi-value form-control" required name="id_area"

                                id="id_area">

                                <?php

                                $consultac = "SELECT id_area,area FROM tjam_areas

                                                WHERE id_area = '$id_area'";

                                $rst1c = $conf->consulta($consultac);



                                for ($i = 0; $i < count($rst1c); $i++) {

                                    echo '<option selected value="' . $rst1c[$i]["id_area"] . '">' . $rst1c[$i]["area"] . '</option>';

                                }

                                ?>

                            </select>

                        </div>

                    </div>







                    <?php

                    if ($tipo_solicitud == 7) {

                        ?>

                        <div class="col-md-12">

                            <div class="form-group"><label for="inputName" class="control-label">

                                    <dt>Empleado que ingresará</dt>

                                </label>

                            </div>

                        </div>



                        <div class="col-md-4">

                            <div class="form-group"><label for="inputName" class="control-label">

                                    <dt>Nombre</dt>

                                </label>

                                <div class="input-icon left"><i class="fa fa-edit"></i><input id="cliente" type="text"

                                        value="<?php echo $nombre_n; ?>" name="nombre_n" class="form-control" minlength="13"

                                        readonly />

                                </div>

                            </div>

                        </div>

                        <div class="col-md-4">

                            <div class="form-group"><label for="inputName" class="control-label">

                                    <dt>Apellido Paterno</dt>

                                </label>

                                <div class="input-icon left"><i class="fa fa-edit"></i><input id="cliente" type="text"

                                        value="<?php echo $apellidop_n; ?>" name="apellidop_n" class="form-control"

                                        minlength="13" readonly />

                                </div>

                            </div>

                        </div>

                        <div class="col-md-4">

                            <div class="form-group"><label for="inputName" class="control-label">

                                    <dt>Apellido Materno</dt>

                                </label>

                                <div class="input-icon left"><i class="fa fa-edit"></i><input id="cliente" type="text"

                                        value="<?php echo $apellidom_n; ?>" name="apellidom_n" class="form-control"

                                        minlength="13" readonly />

                                </div>

                            </div>

                        </div>



                        <div class="col-md-6">

                            <div class="form-group"><label for="inputName" class="control-label">

                                    <dt>RFC</dt>

                                </label>

                                <div class="input-icon left"><i class="fa fa-edit"></i><input id="cliente" type="text"

                                        value="<?php echo $rfc_n; ?>" name="rfc_n" class="form-control" minlength="13"

                                        readonly />

                                </div>

                            </div>

                        </div>

                        <div class="col-md-6">

                            <div class="form-group"><label for="inputName" class="control-label">

                                    <dt>NSS</dt>

                                </label>

                                <div class="input-icon left"><i class="fa fa-edit"></i><input id="cliente" type="text"

                                        value="<?php echo $nss_n; ?>" name="nss_n" class="form-control" minlength="13"

                                        readonly />

                                </div>

                            </div>

                        </div>



                        <div class="col-md-6">

                            <div class="form-group"><label for="inputName" class="control-label">

                                    <dt>Puesto actual</dt>

                                </label>

                                <select readonly class="select2-multi-value form-control" required name="id_puestooldnew">

                                    <?php

                                    $consultac = "SELECT id_puesto,puesto FROM tjam_puestos

                                                WHERE id_puesto = '$id_puestooldnew'";

                                    $rst1c = $conf->consulta($consultac);



                                    for ($i = 0; $i < count($rst1c); $i++) {

                                        echo '<option selected value="' . $rst1c[$i]["id_puesto"] . '">' . $rst1c[$i]["puesto"] . '</option>';

                                    }

                                    ?>

                                </select>

                            </div>

                        </div>

                        <div class="col-md-6">

                            <div class="form-group"><label for="inputName" class="control-label">

                                    <dt>Área actual</dt>

                                </label>

                                <select readonly class="select2-multi-value form-control" required name="id_areaoldnew"

                                    id="id_area">

                                    <?php

                                    $consultac = "SELECT id_area,area FROM tjam_areas

                                                WHERE id_area = '$id_areaoldnew'";

                                    $rst1c = $conf->consulta($consultac);



                                    for ($i = 0; $i < count($rst1c); $i++) {

                                        echo '<option selected value="' . $rst1c[$i]["id_area"] . '">' . $rst1c[$i]["area"] . '</option>';

                                    }

                                    ?>

                                </select>

                            </div>

                        </div>

                        <?php

                    } else {

                        // Omitir

                    }

                    ?>

















                    <?php

                    if ($tipo_solicitud == '6') {

                        // Omitir si es baja

                    } elseif ($tipo_solicitud == '2') {

                        ?>

                        <div class="col-md-4">

                            <div class="form-group"><label for="inputName" class="control-label">

                                    <dt>Puesto anterior</dt>

                                </label>

                                <select readonly class="select2-multi-value form-control" required name="id_puestooldnew">

                                    <?php

                                    $consultac = "SELECT id_puesto,puesto FROM tjam_puestos

                                                WHERE id_puesto = '$id_puestooldnew'";

                                    $rst1c = $conf->consulta($consultac);



                                    for ($i = 0; $i < count($rst1c); $i++) {

                                        echo '<option selected value="' . $rst1c[$i]["id_puesto"] . '">' . $rst1c[$i]["puesto"] . '</option>';

                                    }

                                    ?>

                                </select>

                            </div>

                        </div>

                        <div class="col-md-4">

                            <div class="form-group"><label for="inputName" class="control-label">

                                    <dt>Área anterior</dt>

                                </label>

                                <select readonly class="select2-multi-value form-control" required name="id_areaoldnew"

                                    id="id_area">

                                    <?php

                                    $consultac = "SELECT id_area,area FROM tjam_areas

                                                WHERE id_area = '$id_areaoldnew'";

                                    $rst1c = $conf->consulta($consultac);



                                    for ($i = 0; $i < count($rst1c); $i++) {

                                        echo '<option selected value="' . $rst1c[$i]["id_area"] . '">' . $rst1c[$i]["area"] . '</option>';

                                    }

                                    ?>

                                </select>

                            </div>

                        </div>

                        <?php

                    } else {

                        ?>

                        <div class="col-md-4">

                            <div class="form-group"><label for="inputName" class="control-label">

                                    <dt>Fecha de inicio de

                                        <?php echo $label1; ?>

                                    </dt>

                                </label>

                                <div class="input-icon left"><i class="fa fa-edit"></i><input readonly id="cliente"

                                        type="date" value="<?php echo $fecha_inicio; ?>" name="fecha_inicio"

                                        class="form-control" minlength="13" />

                                </div>

                            </div>

                        </div>

                        <?php

                    }

                    ?>

                    <div class="col-md-4">

                        <div class="form-group"><label for="inputName" class="control-label">

                                <dt>Fecha de fin de

                                    <?php echo $label1; ?>

                                </dt>

                            </label>

                            <div class="input-icon left"><i class="fa fa-edit"></i><input readonly id="cliente"

                                    type="date" value="<?php echo $fecha_fin; ?>" name="fecha_fin" class="form-control"

                                    minlength="13" />

                            </div>

                        </div>

                    </div>

                    <!--<div class="col-md-4">-->

                    <!--    <div class="form-group"><label for="inputName" class="control-label">-->

                    <!--            <dt>Oficio</dt>-->

                    <!--        </label>-->

                    <!--        <div class="input-icon left"><i class="fa fa-edit"></i><input readonly id="cliente"-->

                    <!--                type="text" value="<?php //echo $oficioa; ?>" name="oficioa" class="form-control"-->

                    <!--                minlength="9" />-->

                    <!--        </div>-->

                    <!--    </div>-->

                    <!--</div>-->



                    <?php

                    if ($tipo_solicitud == '-1') {

                        ?>

                        <!--<div class="col-md-4">-->

                        <!--    <div class="form-group"><label for="inputName" class="control-label">-->

                        <!--            <dt>Fecha recibida en presidencia</dt>-->

                        <!--        </label>-->

                        <!--        <div class="input-icon left"><i class="fa fa-edit"></i><input readonly id="cliente"-->

                        <!--                type="date" value="<?php //echo $fecha_oficio; ?>" name="fecha_oficio"-->

                        <!--                class="form-control" minlength="13" />-->

                        <!--        </div>-->

                        <!--    </div>-->

                        <!--</div>-->

                        <!--<div class="col-md-4">-->

                        <!--    <div class="form-group"><label for="inputName" class="control-label">-->

                        <!--            <dt>Oficio de presidencia</dt>-->

                        <!--        </label>-->

                        <!--        <div class="input-icon left"><i class="fa fa-edit"></i><input readonly id="cliente"-->

                        <!--                type="text" value="<?php //echo $oficiob; ?>" name="oficiob" class="form-control"-->

                        <!--                minlength="9" />-->

                        <!--        </div>-->

                        <!--    </div>-->

                        <!--</div>-->

                        <!--<div class="col-md-4">-->

                        <!--    <div class="form-group"><label for="inputName" class="control-label">-->

                        <!--            <dt>Expediente</dt>-->

                        <!--        </label>-->

                        <!--        <div class="input-icon left"><i class="fa fa-edit"></i><input readonly id="cliente"-->

                        <!--                type="text" value="<?php //echo $oficioc; ?>" name="oficioc" class="form-control"-->

                        <!--                minlength="9" />-->

                        <!--        </div>-->

                        <!--    </div>-->

                        <!--</div>-->



                        <?php

                    }

                    ?>





                    <div class="col-md-12">

                        <div class="form-group"><label for="inputName" class="control-label">

                                <dt>Observaciones</dt>

                            </label>

                            <div class="input-icon left">

                                <textarea readonly class="form-control" id="observaciones" name="observaciones" rows="5"

                                    cols="33"><?php echo $observaciones; ?></textarea>

                            </div>

                        </div>

                    </div>



                </div>















                <?php

                if (count($res12) == 0) {



                } else {

                    ?>

                    <div class="row">



                        <!-- ESPACIO PARA ADJUNTAR OPCIONAL -->

                        <div class="form-group">

                            <label for="InputText">

                                <h4>

                                    <dt> Documentos adjuntos</dt>

                                </h4>

                            </label><br>

                        </div>



                        <?php

                        for ($i = 0; $i < count($res12); $i++) {

                            if (strpos($res12[$i]["url_archivo"], '.pdf') !== false) {

                                echo '<div class="col-md-1">

                                    <div class="form-group"><label for="inputName" class="control-label"><dt>Imagen</dt></label>

                                    <a target="_Blank" href="../pdf_solicitudes/' . $res12[$i]["url_archivo"] . '"><img height="50" src="./img/pdf.png" alt=""></a>

                                </div>

                            </div>';

                            } else {

                                echo '<div class="col-md-1">

                                    <div class="form-group"><label for="inputName" class="control-label"><dt>Imagen</dt></label>

                                    <a target="_Blank" href="../pdf_solicitudes/' . $res12[$i]["url_archivo"] . '"><img height="50" src="../pdf_solicitudes/' . $res12[$i]["url_archivo"] . '" alt=""></a>

                                </div>

                            </div>';

                            }

                        }



                        ?>



                    </div>

                    <br>

                    <?php

                }

                ?>















                <!-- OPCIONES -->

                <!-- OPCIONES -->

                <!-- OPCIONES -->

                <!-- OPCIONES -->

                <!-- OPCIONES -->

                <?php

                // COMPROBAR CANCELACION

                $consultaopc = "SELECT e.*

                FROM tjam_areas_solicitudes_bitacora e

                WHERE e.id_solicitud = '$id_solicitud' AND e.estatus = '6' AND e.completado = '1' LIMIT 1";

                $rst1opc = $conf->consulta($consultaopc);



                $estatusopc = $rst1opc[0]["estatus"];



                if ($estatusopc == 6) {

                    // Omitir opciones

                } else {

                    ?>



                    <div class="row">

                        <div class="row mt-5 justify-content-center">



                            <?php



                            // RH PERMISOS

                            if (($estatus == 2 || $estatus == 4) && ($solicitud_rol == '2')) {

                                echo '<div class="col-lg text-center">

                                        <div class="btn-group me-3"> <button type="button" data-target="#modal_proceso"

                                            data-toggle="modal" class="btn btn-info">Procesar solicitud <i

                                                class="fa fa-plus"></i></button></div>

                                        </div><br>';



                                // PRESIDENCIA PERMISOS

                            } elseif (($estatus == 3 || $estatus == 5) && ($solicitud_rol == '3')) {

                                echo '<div class="col-lg text-center">

                                        <div class="btn-group me-3"> <button type="button" data-target="#modal_proceso"

                                            data-toggle="modal" class="btn btn-info">Procesar solicitud <i

                                                class="fa fa-plus"></i></button></div>

                                        </div><br>';

                            } else {

                                // Sin permiso

                            }



                            // echo '<div class="col-lg text-center">

                            //     <div class="btn-group me-3"> <button type="button" data-target="#modal_proceso2"

                            //             data-toggle="modal" class="btn btn-danger">Cancelar solicitud <i

                            //                 class="fa fa-ban"></i></button></div>

                            // </div><br>';

                        

                            ?>



                        </div>

                        <br>

                    </div>



                    <?php

                }

                ?>











                <!-- TABLA PROCEDIMIENTO -->

                <!-- TABLA PROCEDIMIENTO -->

                <!-- TABLA PROCEDIMIENTO -->

                <!-- TABLA PROCEDIMIENTO -->

                <!-- TABLA PROCEDIMIENTO -->

                <div class="row">



                    <div class="col-lg-12">

                        <div class="table-responsive">

                            <table id="table_id" style="border-bottom:1px solid #ddd"

                                class="table table-striped table-bordered table-hover">

                                <!--<thead>

                                    <tr>

                                        <th>#</th>

                                        <th>Área</th>

                                        <th>Puesto</th>

                                        <th>Nombre</th>

                                    </tr>

                                </thead>-->

                                <tbody>

                                    <?php



                                    // echo "<tr>";

                                    // echo "<td><strong>Lista de procesos</strong></td>";

                                    // echo "</tr>";

                                    

                                    $consulta1 = "SELECT e.*, a.estatus AS estatusmovimiento, e.estatus AS estatustipo

                                                FROM tjam_areas_solicitudes_bitacora e

                                                JOIN tjam_areas_solicitudes_estatus a ON e.estatus = a.id_estatus

                                                WHERE e.id_solicitud = '$id_solicitud' ORDER BY e.estatus ASC";

                                    $rst1 = $conf->consulta($consulta1);



                                    echo "<thead>";

                                    echo "<th>#</th>";

                                    echo "<th>Proceso</th>";

                                    echo "<th>Folio</th>";

                                    echo "<th>Observaciones</th>";

                                    echo "<th>Fecha</th>";

                                    echo "<th>PDF</th>";

                                    echo "<th>Estatus</th>";

                                    echo "<th>Firma</th>";

                                    echo '</thead>';



                                    // IDENTIFICAR SI LA SOLICITUD FUE CANCELADA

                                    // IDENTIFICAR SI LA SOLICITUD FUE CANCELADA

                                    // IDENTIFICAR SI LA SOLICITUD FUE CANCELADA

                                    // IDENTIFICAR SI LA SOLICITUD FUE CANCELADA

                                    // IDENTIFICAR SI LA SOLICITUD FUE CANCELADA

                                    if ($rst1[5]["estatustipo"] == '6' && $rst1[5]["completado"] == 1) {

                                        for ($i = 0; $i < count($rst1); $i++) {



                                            switch (($i + 1)) {

                                                case '1':

                                                    $oficiob = 'I';

                                                    break;

                                                case '2':

                                                    $oficiob = 'II';

                                                    break;

                                                case '3':

                                                    $oficiob = 'III';

                                                    break;

                                                case '4':

                                                    $oficiob = 'IV';

                                                    break;

                                                case '5':

                                                    $oficiob = 'V';

                                                    break;

                                                case '6':

                                                    $oficiob = 'VI';

                                                    break;

                                                default:

                                                    # code...

                                                    break;

                                            }



                                            echo "<tr>";



                                            echo "<td>" . ($i + 1) . "</td>";

                                            echo "<td>" . $rst1[$i]["estatusmovimiento"] . "</td>";

                                            echo "<td>" . $oficioa . "-" . $oficiob . "</td>";

                                            echo "<td>" . $rst1[$i]["observaciones"] . "</td>";

                                            if ($rst1[$i]["completado"] == 1) {

                                                echo "<td>" . $rst1[$i]["fecha_registro"] . "</td>";

                                            } else {

                                                echo "<td></td>";

                                            }



                                            // DOCUMENTOS CANCELADOS

                                            // DOCUMENTOS CANCELADOS

                                            // DOCUMENTOS CANCELADOS

                                            // DOCUMENTOS CANCELADOS

                                            if ($estatusopc == 6) {



                                                // DOCUMENTO PARTICULAR CANCELADO

                                                // DOCUMENTO PARTICULAR CANCELADO

                                                // DOCUMENTO PARTICULAR CANCELADO

                                                if ($rst1[$i]["estatustipo"] == 6) {



                                                    // SIEMPRE MOSTRAR PDF - HABRÁ IMAGEN DE SIN VALOR LEGAL PARA PROTEGER

                                                if ($rst1[$i]["completado"] == 1 && $rst1[$i]["estatustipo"] <= '6') {

                                                    if ($rst1[$i]["url_pdf"] == '' || $rst1[$i]["url_pdf"] == NULL) {

                                                        echo '<td><a href="../recursoshumanos/pdfprocedimiento.php?id_bitacora=' . $rst1[$i]["id_bitacora"] . '&app=1&opc=2" target="_BLANK" > <img src="../recursoshumanos/img/pdf.png" title="Expediente" height="50" width="50" />  </a></td>';

                                                    } else {

                                                        echo '<td><a href="../intranet/doc_firmados/'.$rst1[$i]["url_pdf"].'" target="_BLANK" > <img src="../recursoshumanos/img/pdf.png" title="Expediente" height="50" width="50" /> </a></td>';

                                                    }

                                                } elseif ($rst1[$i]["completado"] == 0) {

                                                    echo '<td></td>';

                                                }



                                                // FIRMAR OPCION Y ESTATUS

                                                // VERIFICAR FIRMA

                                                $id_bitacora2 = $rst1[$i]["id_bitacora"];



                                                $consulta1f = "SELECT tf.id_firma, tf.id_usuario, tf.fecha_firma, tf.firma, tf.id_bitacora

                                                            FROM tjam_empleados_solicitudes_firmas tf

                                                            WHERE tf.id_bitacora = '$id_bitacora2' ORDER BY tf.id_firma ASC";

                                                $rst1f = $conf->consulta($consulta1f);

                                                $id_usuario2 = $rst1f[0]["id_usuario"];

                                                $id_firma2 = $rst1f[0]["id_firma"];

                                                $firma2 = $rst1f[0]["firma"];





                                                if ($rst1[$i]["completado"] == 1 && $rst1[$i]["estatustipo"] == '6') {

                                                    if ($firma2 > 0) {

                                                        echo '<td><span class="label label-success">Completado</span></td>';

                                                    } else {

                                                        // if (($estatus == 2 || $estatus == 4) && ($solicitud_rol == '2')) {

                                                        //     echo '<td><span class="label label-info" data-target="#modal_proceso">Listo para firmar</span></td>';

                                                        //     // PRESIDENCIA PERMISOS

                                                        // } elseif (($estatus == 3 || $estatus == 5) && ($solicitud_rol == '3')) {

                                                        //     echo '<td><span class="label label-info" data-target="#modal_proceso">Listo para firmar</span></td>';

                                                        // } else {

                                                        //     // Sin permiso

                                                        // }

                                                        // data-target="#modal_proceso"

                                                        echo '<td><span class="label label-info">Listo para firmar</span></td>';

                                                    }

                                                } elseif ($rst1[$i]["completado"] == 1 && $rst1[$i]["estatustipo"] == '6') {

                                                    echo '<td><span class="label label-danger">Cancelado</span></td>';

                                                } else {

                                                    echo '<td><span class="label label-warning">Pendiente</span></td>';

                                                }





                                                // RH PERMISOS

                                                // FIRMA USUARIO NORMAL

                                                if ($solicitud_firma == '1') {

                                                        // VER SI YA TIENE FIRMA

                                                        if ($rst1[$i]["completado"] == 1) {

                                                            if ($firma2 > 0) {

                                                                echo '<td><span class="label label-success">Firmado</span></td>';

                                                            } else {

                                                                echo '<td>';

                                                                echo '<button type="button" class="btn btn-success passingID" data-id="' . $id_firma2 . '">Firmar <i class="fa fa-edit"></i></button>';

                                                                echo '</td>';

                                                            }

                                                        } elseif ($rst1[$i]["completado"] == 0 && $firma2 == 0) {

                                                            echo '<td><span class="label label-warning">Pendiente completar movimiento</span></td>';

                                                        } else {

                                                            echo '<td><span class="label label-warning">Requerido completar proceso anterior</span></td>';

                                                        }



                                                } else {

                                                    if ($firma2 > 0) {

                                                        echo '<td><span class="label label-success">Firmado</span></td>';

                                                    } else {

                                                        if ($rst1[$i]["completado"] == 0) {

                                                            echo '<td><span class="label label-warning">Requerido completar proceso anterior</span></td>';

                                                        } else {

                                                            echo '<td></td>';

                                                        }

                                                    }

                                                }



                                                $completado_anterior = $rst1[$i]["completado"];

                                                $firma_anterior = $firma2;





                                                // DOCUMENTO NORMAL - EN SECCIÓN CANCELADO

                                                // DOCUMENTO NORMAL - EN SECCIÓN CANCELADO

                                                // DOCUMENTO NORMAL - EN SECCIÓN CANCELADO

                                                } else {

                                                    

                                                    if ($rst1[$i]["estatustipo"] <= '6') {

                                                        if ($rst1[$i]["url_pdf"] == '' || $rst1[$i]["url_pdf"] == NULL) {

                                                            echo '<td><a href="../recursoshumanos/pdfprocedimiento.php?id_bitacora=' . $rst1[$i]["id_bitacora"] . '&app=1&opc=2" target="_BLANK" > <img src="../recursoshumanos/img/pdf.png" title="Expediente" height="50" width="50" />  </a></td>';

                                                        } else {

                                                            echo '<td><a href="../intranet/doc_firmados/'.$rst1[$i]["url_pdf"].'" target="_BLANK" > <img src="../recursoshumanos/img/pdf.png" title="Expediente" height="50" width="50" /> </a></td>';

                                                        }

                                                    } elseif ($rst1[$i]["completado"] == 0) {

                                                        echo '<td></td>';

                                                    }



                                                    if ($rst1[$i]["completado"] == 1 && $rst1[$i]["estatustipo"] != '6') {

                                                        // if (($estatus == 2 || $estatus == 4) && ($solicitud_rol == '2')) {

                                                        //     echo '<td><span class="label label-info" data-target="#modal_proceso">Listo para firmar</span></td>';

                                                        //     // PRESIDENCIA PERMISOS

                                                        // } elseif (($estatus == 3 || $estatus == 5) && ($solicitud_rol == '3')) {

                                                        //     echo '<td><span class="label label-info" data-target="#modal_proceso">Listo para firmar</span></td>';

                                                        // } else {

                                                        //     // Sin permiso

                                                        // }

                                                        // data-target="#modal_proceso"

                                                        echo '<td><span class="label label-info">Listo para firmar</span></td>';

                                                    } elseif ($rst1[$i]["completado"] == 1 && $rst1[$i]["estatustipo"] == '6') {

                                                        echo '<td><span class="label label-danger">Cancelado</span></td>';

                                                    } else {

                                                        echo '<td><span class="label label-warning">Pendiente</span></td>';

                                                    }





                                                    if ($rst1[$i]["completado"] == 1) {

                                                        if ($firma2 > 0) {

                                                            echo '<td><span class="label label-success">Firmado</span></td>';

                                                        } else {

                                                            echo '<td>';

                                                                echo '<td></td>';

                                                                // echo '<button type="button" class="btn btn-success passingID" data-id="' . $id_firma2 . '">Firmar <i class="fa fa-edit"></i></button>';

                                                            echo '</td>';

                                                        }

                                                    } elseif ($rst1[$i]["completado"] == 0) {

                                                        echo '<td></td>';

                                                    }

                                                }



                                                // IMPRIMR DOCUMENTO NORMAL

                                                // IMPRIMR DOCUMENTO NORMAL

                                                // IMPRIMR DOCUMENTO NORMAL

                                                // IMPRIMR DOCUMENTO NORMAL

                                            } else {



                                                // SIEMPRE MOSTRAR PDF - HABRÁ IMAGEN DE SIN VALOR LEGAL PARA PROTEGER

                                                if ($rst1[$i]["completado"] == 1 && $rst1[$i]["estatustipo"] <= '5') {

                                                    if ($rst1[$i]["url_pdf"] == '' || $rst1[$i]["url_pdf"] == NULL) {

                                                        echo '<td><a href="../recursoshumanos/pdfprocedimiento.php?id_bitacora=' . $rst1[$i]["id_bitacora"] . '&app=1&opc=2" target="_BLANK" > <img src="../recursoshumanos/img/pdf.png" title="Expediente" height="50" width="50" />  </a></td>';

                                                    } else {

                                                        echo '<td><a href="../intranet/doc_firmados/'.$rst1[$i]["url_pdf"].'" target="_BLANK" > <img src="../recursoshumanos/img/pdf.png" title="Expediente" height="50" width="50" /> </a></td>';

                                                    }

                                                } elseif ($rst1[$i]["completado"] == 0) {

                                                    echo '<td></td>';

                                                }



                                                // FIRMAR OPCION Y ESTATUS

                                                // VERIFICAR FIRMA

                                                $id_bitacora2 = $rst1[$i]["id_bitacora"];



                                                $consulta1f = "SELECT tf.id_firma, tf.id_usuario, tf.fecha_firma, tf.firma, tf.id_bitacora

                                                            FROM tjam_empleados_solicitudes_firmas tf

                                                            WHERE tf.id_bitacora = '$id_bitacora2' ORDER BY tf.id_firma ASC";

                                                $rst1f = $conf->consulta($consulta1f);

                                                $id_usuario2 = $rst1f[0]["id_usuario"];

                                                $id_firma2 = $rst1f[0]["id_firma"];

                                                $firma2 = $rst1f[0]["firma"];





                                                if ($rst1[$i]["completado"] == 1 && $rst1[$i]["estatustipo"] != '6') {

                                                    if ($firma2 > 0) {

                                                        echo '<td><span class="label label-success">Completado</span></td>';

                                                    } else {

                                                        // if (($estatus == 2 || $estatus == 4) && ($solicitud_rol == '2')) {

                                                        //     echo '<td><span class="label label-info" data-target="#modal_proceso">Listo para firmar</span></td>';

                                                        //     // PRESIDENCIA PERMISOS

                                                        // } elseif (($estatus == 3 || $estatus == 5) && ($solicitud_rol == '3')) {

                                                        //     echo '<td><span class="label label-info" data-target="#modal_proceso">Listo para firmar</span></td>';

                                                        // } else {

                                                        //     // Sin permiso

                                                        // }

                                                        // data-target="#modal_proceso"

                                                        echo '<td><span class="label label-info">Listo para firmar</span></td>';

                                                    }

                                                } elseif ($rst1[$i]["completado"] == 1 && $rst1[$i]["estatustipo"] == '6') {

                                                    echo '<td><span class="label label-danger">Cancelado</span></td>';

                                                } else {

                                                    echo '<td><span class="label label-warning">Pendiente</span></td>';

                                                }





                                                // RH PERMISOS

                                                // FIRMA USUARIO NORMAL

                                                if (($rst1[$i]["estatustipo"] == 1) && ($solicitud_firma == '1')) {

                                                    // VER SI EL PASO ANTERIOR FUE APROBADO Y FIRMADO

                                                    if ($completado_anterior == 1 && $firma_anterior > 0 || $rst1[$i]["estatustipo"] == '1') {

                                                        // VER SI YA TIENE FIRMA

                                                        if ($rst1[$i]["completado"] == 1) {

                                                            if ($firma2 > 0) {

                                                                echo '<td><span class="label label-success">Firmado</span></td>';

                                                            } else {

                                                                echo '<td>';

                                                                echo '<button type="button" class="btn btn-success passingID" data-id="' . $id_firma2 . '">Firmar <i class="fa fa-edit"></i></button>';

                                                                echo '</td>';

                                                            }

                                                        } elseif ($rst1[$i]["completado"] == 0 && $firma2 == 0) {

                                                            echo '<td><span class="label label-warning">Pendiente completar movimiento</span></td>';

                                                        } else {

                                                            echo '<td><span class="label label-warning">Requerido completar proceso anterior</span></td>';

                                                        }

                                                    } else {

                                                        echo '<td><span class="label label-warning">Requerido completar proceso anterior</span></td>';

                                                    }



                                                    // FIRMA RH

                                                } elseif (($rst1[$i]["estatustipo"] == 2 || $rst1[$i]["estatustipo"] == 4) && ($solicitud_firma == '2')) {

                                                    // VER SI EL PASO ANTERIOR FUE APROBADO Y FIRMADO

                                                    if ($completado_anterior == 1 && $firma_anterior > 0 || $rst1[$i]["estatustipo"] == '1') {

                                                        // VER SI YA TIENE FIRMA

                                                        if ($rst1[$i]["completado"] == 1) {

                                                        // if ($rst1[2]["completado"] == 1 || $rst1[0]["completado"] == 1) {

                                                            if ($firma2 > 0) {

                                                                echo '<td><span class="label label-success">Firmado</span></td>';

                                                            } else {

                                                                echo '<td>';

                                                                echo '<button type="button" class="btn btn-success passingID" data-id="' . $id_firma2 . '">Firmar <i class="fa fa-edit"></i></button>';

                                                                echo '</td>';

                                                            }

                                                        } elseif ($rst1[$i]["completado"] == 0 && $firma2 == 0) {

                                                            echo '<td><span class="label label-warning">Pendiente completar movimiento</span></td>';

                                                        } else {

                                                            echo '<td><span class="label label-warning">Requerido completar proceso anterior</span></td>';

                                                        }

                                                    } else {

                                                        echo '<td><span class="label label-warning">Requerido completar proceso anterior</span></td>';

                                                    }



                                                    // FIRMA PRESIDENCIA

                                                } elseif (($rst1[$i]["estatustipo"] == 3 || $rst1[$i]["estatustipo"] == 5) && ($solicitud_firma == '3')) {

                                                    // VER SI EL PASO ANTERIOR FUE APROBADO Y FIRMADO

                                                    if ($completado_anterior == 1 && $firma_anterior > 0 || $rst1[$i]["estatustipo"] == '1') {

                                                        // VER SI YA TIENE FIRMA

                                                        if ($rst1[$i]["completado"] == 1) {

                                                        // if ($rst1[3]["completado"] == 1 || $rst1[1]["completado"] == 1) {

                                                            if ($firma2 > 0) {

                                                                echo '<td><span class="label label-success">Firmado</span></td>';

                                                            } else {

                                                                echo '<td>';

                                                                echo '<button type="button" class="btn btn-success passingID" data-id="' . $id_firma2 . '">Firmar <i class="fa fa-edit"></i></button>';

                                                                echo '</td>';

                                                            }

                                                        } elseif ($rst1[$i]["completado"] == 0 && $firma2 == 0) {

                                                            echo '<td><span class="label label-warning">Pendiente completar movimiento</span></td>';

                                                        } else {

                                                            echo '<td><span class="label label-warning">Requerido completar proceso anterior</span></td>';

                                                        }

                                                    } else {

                                                        echo '<td><span class="label label-warning">Requerido completar proceso anterior</span></td>';

                                                    }

                                                } else {

                                                    if ($firma2 > 0) {

                                                        echo '<td><span class="label label-success">Firmado</span></td>';

                                                    } else {

                                                        if ($rst1[$i]["completado"] == 0) {

                                                            echo '<td><span class="label label-warning">Requerido completar proceso anterior</span></td>';

                                                        } else {

                                                            echo '<td></td>';

                                                        }

                                                    }

                                                }



                                                $completado_anterior = $rst1[$i]["completado"];

                                                $firma_anterior = $firma2;



                                            }



                                            echo '</tr>';

                                        }





                                    // SOLICITUD NORMAL

                                    // SOLICITUD NORMAL

                                    // SOLICITUD NORMAL

                                    // SOLICITUD NORMAL

                                    // SOLICITUD NORMAL

                                    } else {

                                        for ($i = 0; $i < count($rst1); $i++) {



                                            if ($rst1[$i]["estatustipo"] == '6') {



                                            } else {



                                                switch (($i + 1)) {

                                                    case '1':

                                                        $oficiob = 'I';

                                                        break;

                                                    case '2':

                                                        $oficiob = 'II';

                                                        break;

                                                    case '3':

                                                        $oficiob = 'III';

                                                        break;

                                                    case '4':

                                                        $oficiob = 'IV';

                                                        break;

                                                    case '5':

                                                        $oficiob = 'V';

                                                        break;

                                                    case '6':

                                                        $oficiob = 'VI';

                                                        break;

                                                    default:

                                                        # code...

                                                        break;

                                                }



                                                echo "<tr>";



                                                echo "<td>" . ($i + 1) . "</td>";

                                                echo "<td>" . $rst1[$i]["estatusmovimiento"] . "</td>";

                                                echo "<td>" . $oficioa . "-" . $oficiob . "</td>";

                                                echo "<td>" . $rst1[$i]["observaciones"] . "</td>";



                                                if ($rst1[$i]["completado"] == 1) {

                                                    echo "<td>" . $rst1[$i]["fecha_registro"] . "</td>";

                                                } else {

                                                    echo "<td></td>";

                                                }



                                                // SIEMPRE MOSTRAR PDF - HABRÁ IMAGEN DE SIN VALOR LEGAL PARA PROTEGER

                                                if ($rst1[$i]["completado"] == 1 && $rst1[$i]["estatustipo"] <= '5') {

                                                    if ($rst1[$i]["url_pdf"] == '' || $rst1[$i]["url_pdf"] == NULL) {

                                                        echo '<td><a href="../recursoshumanos/pdfprocedimiento.php?id_bitacora=' . $rst1[$i]["id_bitacora"] . '&app=1&opc=2" target="_BLANK" > <img src="../recursoshumanos/img/pdf.png" title="Expediente" height="50" width="50" />  </a></td>';

                                                    } else {

                                                        echo '<td><a href="../intranet/doc_firmados/'.$rst1[$i]["url_pdf"].'" target="_BLANK" > <img src="../recursoshumanos/img/pdf.png" title="Expediente" height="50" width="50" /> </a></td>';

                                                    }

                                                } elseif ($rst1[$i]["completado"] == 0) {

                                                    echo '<td></td>';

                                                }



                                                // FIRMAR OPCION Y ESTATUS

                                                // VERIFICAR FIRMA

                                                $id_bitacora2 = $rst1[$i]["id_bitacora"];



                                                $consulta1f = "SELECT tf.id_firma, tf.id_usuario, tf.fecha_firma, tf.firma, tf.id_bitacora

                                                            FROM tjam_empleados_solicitudes_firmas tf

                                                            WHERE tf.id_bitacora = '$id_bitacora2' ORDER BY tf.id_firma ASC";

                                                $rst1f = $conf->consulta($consulta1f);

                                                $id_usuario2 = $rst1f[0]["id_usuario"];

                                                $id_firma2 = $rst1f[0]["id_firma"];

                                                $firma2 = $rst1f[0]["firma"];





                                                if ($rst1[$i]["completado"] == 1 && $rst1[$i]["estatustipo"] != '6') {

                                                    if ($firma2 > 0) {

                                                        echo '<td><span class="label label-success">Completado</span></td>';

                                                    } else {

                                                        // if (($estatus == 2 || $estatus == 4) && ($solicitud_rol == '2')) {

                                                        //     echo '<td><span class="label label-info" data-target="#modal_proceso">Listo para firmar</span></td>';

                                                        //     // PRESIDENCIA PERMISOS

                                                        // } elseif (($estatus == 3 || $estatus == 5) && ($solicitud_rol == '3')) {

                                                        //     echo '<td><span class="label label-info" data-target="#modal_proceso">Listo para firmar</span></td>';

                                                        // } else {

                                                        //     // Sin permiso

                                                        // }

                                                        // data-target="#modal_proceso"

                                                        echo '<td><span class="label label-info">Listo para firmar</span></td>';

                                                    }

                                                } elseif ($rst1[$i]["completado"] == 1 && $rst1[$i]["estatustipo"] == '6') {

                                                    echo '<td><span class="label label-danger">Cancelado</span></td>';

                                                } else {

                                                    echo '<td><span class="label label-warning">Pendiente</span></td>';

                                                }





                                                // RH PERMISOS

                                                // FIRMA USUARIO NORMAL

                                                if (($rst1[$i]["estatustipo"] == 1) && ($solicitud_firma == '1')) {

                                                    // VER SI EL PASO ANTERIOR FUE APROBADO Y FIRMADO

                                                    if ($completado_anterior == 1 && $firma_anterior > 0 || $rst1[$i]["estatustipo"] == '1') {

                                                        // VER SI YA TIENE FIRMA

                                                        if ($rst1[$i]["completado"] == 1) {

                                                            if ($firma2 > 0) {

                                                                echo '<td><span class="label label-success">Firmado</span></td>';

                                                            } else {

                                                                echo '<td>';

                                                                echo '<button type="button" class="btn btn-success passingID" data-id="' . $id_firma2 . '">Firmar <i class="fa fa-edit"></i></button>';

                                                                echo '</td>';

                                                            }

                                                        } elseif ($rst1[$i]["completado"] == 0 && $firma2 == 0) {

                                                            echo '<td><span class="label label-warning">Pendiente completar movimiento</span></td>';

                                                        } else {

                                                            echo '<td><span class="label label-warning">Requerido completar proceso anterior</span></td>';

                                                        }

                                                    } else {

                                                        echo '<td><span class="label label-warning">Requerido completar proceso anterior</span></td>';

                                                    }



                                                    // FIRMA RH

                                                } elseif (($rst1[$i]["estatustipo"] == 2 || $rst1[$i]["estatustipo"] == 4) && ($solicitud_firma == '2')) {

                                                    // VER SI EL PASO ANTERIOR FUE APROBADO Y FIRMADO

                                                    if ($completado_anterior == 1 && $firma_anterior > 0 || $rst1[$i]["estatustipo"] == '1') {

                                                        // VER SI YA TIENE FIRMA

                                                        if ($rst1[$i]["completado"] == 1) {

                                                        // if ($rst1[2]["completado"] == 1 || $rst1[0]["completado"] == 1) {

                                                            if ($firma2 > 0) {

                                                                echo '<td><span class="label label-success">Firmado</span></td>';

                                                            } else {

                                                                echo '<td>';

                                                                echo '<button type="button" class="btn btn-success passingID" data-id="' . $id_firma2 . '">Firmar <i class="fa fa-edit"></i></button>';

                                                                echo '</td>';

                                                            }

                                                        } elseif ($rst1[$i]["completado"] == 0 && $firma2 == 0) {

                                                            echo '<td><span class="label label-warning">Pendiente completar movimiento</span></td>';

                                                        } else {

                                                            echo '<td><span class="label label-warning">Requerido completar proceso anterior</span></td>';

                                                        }

                                                    } else {

                                                        echo '<td><span class="label label-warning">Requerido completar proceso anterior</span></td>';

                                                    }



                                                    // FIRMA PRESIDENCIA

                                                } elseif (($rst1[$i]["estatustipo"] == 3 || $rst1[$i]["estatustipo"] == 5) && ($solicitud_firma == '3')) {

                                                    // VER SI EL PASO ANTERIOR FUE APROBADO Y FIRMADO

                                                    if ($completado_anterior == 1 && $firma_anterior > 0 || $rst1[$i]["estatustipo"] == '1') {

                                                        // VER SI YA TIENE FIRMA

                                                        if ($rst1[$i]["completado"] == 1) {

                                                        // if ($rst1[3]["completado"] == 1 || $rst1[1]["completado"] == 1) {

                                                            if ($firma2 > 0) {

                                                                echo '<td><span class="label label-success">Firmado</span></td>';

                                                            } else {

                                                                echo '<td>';

                                                                echo '<button type="button" class="btn btn-success passingID" data-id="' . $id_firma2 . '">Firmar <i class="fa fa-edit"></i></button>';

                                                                echo '</td>';

                                                            }

                                                        } elseif ($rst1[$i]["completado"] == 0 && $firma2 == 0) {

                                                            echo '<td><span class="label label-warning">Pendiente completar movimiento</span></td>';

                                                        } else {

                                                            echo '<td><span class="label label-warning">Requerido completar proceso anterior</span></td>';

                                                        }

                                                    } else {

                                                        echo '<td><span class="label label-warning">Requerido completar proceso anterior</span></td>';

                                                    }

                                                } else {

                                                    if ($firma2 > 0) {

                                                        echo '<td><span class="label label-success">Firmado</span></td>';

                                                    } else {

                                                        if ($rst1[$i]["completado"] == 0) {

                                                            echo '<td><span class="label label-warning">Requerido completar proceso anterior</span></td>';

                                                        } else {

                                                            echo '<td></td>';

                                                        }

                                                    }

                                                }



                                                $completado_anterior = $rst1[$i]["completado"];

                                                $firma_anterior = $firma2;



                                                echo '</tr>';

                                            }

                                        }

                                    }



                                    ?>

                                </tbody>

                            </table>

                        </div>

                    </div>



                </div>









                <!-- OPCIONES CANCELAR -->

                <!-- OPCIONES CANCELAR -->

                <!-- OPCIONES CANCELAR -->

                <!-- OPCIONES CANCELAR -->

                <!-- OPCIONES CANCELAR -->

                <?php

                // // COMPROBAR CANCELACION

                // $consultaopc = "SELECT e.*

                // FROM tjam_areas_solicitudes_bitacora e

                // WHERE e.id_solicitud = '$id_solicitud' AND e.estatus = '6' AND e.completado = '1' LIMIT 1";

                // $rst1opc = $conf->consulta($consultaopc);

                

                // $estatusopc = $rst1opc[0]["estatus"];

                

                if ($estatusopc == 6) {

                    // Omitir opciones

                } else {

                    ?>



                    <div class="row">

                        <div class="row mt-5 justify-content-center">



                            <?php



                            // RH Y PRESIDENCIA PERMISOS

                            if (($estatus == 2 || $estatus == 4 || $estatus == 3 || $estatus == 5) && ($solicitud_rol == '2' || $solicitud_rol == '3')) {

                                echo '<br>

                                <div class="col-lg text-center">

                                <div class="btn-group me-3"> <button type="button" data-target="#modal_proceso2"

                                        data-toggle="modal" class="btn btn-danger">Cancelar solicitud <i

                                            class="fa fa-ban"></i></button></div>

                                </div><br>';

                            } else {

                                // Sin permiso

                            }



                            ?>



                        </div>

                        <br>

                    </div>



                    <?php

                }

                ?>







            </div>

        </div>

    </form>

</div>





<?php

$conf->desconectarDB();

?>



<script>

    $(".passingID").click(function () {

        var ids = $(this).attr('data-id');

        $('input:hidden[name=id_bitacora_firma]').val(ids);

        $('#modal_firma').modal('show');

    });

</script>

Zerion Mini Shell 1.0