%PDF- %PDF-
Mini Shell

Mini Shell

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

<?php



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

$anio        =   isset($_REQUEST['anyo']) ? $_REQUEST['anyo'] : date("Y");

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

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

$conf = new Configuracion();

$conf->conectarBD();





$funcion = "1 = 1";



if ($tipof > 0)

    $funcion = " f.id_funciontipo = '$tipof'";



$id_usuario = $_SESSION["id_usuario"];



$sql2u = "SELECT * FROM tjam_empleados WHERE id = '$id_usuario'";

$rst2u = $conf->consulta($sql2u);

// $xxxxxxxxxx = $rst2u[0]["id"];

$elaborador = $rst2u[0]["elaborador"];







?>





<div class="page-content">



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



    <div class="row">

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



            <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">Lista de Control de Folios del TJAM <?php //echo $nombree; 

                                                                                                            ?></div>

                        </div>



                        <div class="portlet-body">

                            <!-- CAMBIO DE FECHA -->

                            <form action="page_find_funciones.php" method="get">

                                <div class="portlet-body">

                                    <div class="row">

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

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



                                       

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

                                                    <select class="form-control" name="id_empleado" onchange="this.form.submit()">

                                                        <option value="0" <?php if ($id_empleado == '0') {echo 'selected';} ?>>Todos</option>

                                                        <?php

                                                        $consulta = "SELECT e.id,CONCAT(e.nombre, ' ', e.apellido1, ' ', e.apellido2) AS nombre

                                                                FROM tjam_empleados e

                                                                WHERE e.habilitado = 1 ORDER BY nombre asc";

                                                        $rst12 = $conf->consulta($consulta);



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

                                                            if ($id_empleado == $rst12[$i]['id']) {

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

                                                            } else {

                                                                echo '<option value="' . $rst12[$i]['id'] . '">' . $rst12[$i]['nombre'] . '</option>';

                                                            }

                                                        }

                                                        ?>

                                                    </select>

                                                </div>

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

                                                    <select class="form-control" name="tipof" onchange="this.form.submit()">

                                                        <option value="0" <?php if ($tipof == '0') {echo 'selected';} ?>>Ver todo</option>

                                                        <?php

                                                        $consulta12 = "SELECT DISTINCT e.*

                                                                    FROM  tjam_funciones_tipo e

                                                                    WHERE 1 ORDER BY id_funciontipo ASC";

                                                        $rst12 = $conf->consulta($consulta12);



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

                                                            if ($tipof == $rst12[$i]['id_funciontipo']) {

                                                                echo '<option selected value="' . $rst12[$i]['id_funciontipo'] . '">' . $rst12[$i]['tipo_funcion'] . '</option>';

                                                            } else {

                                                                echo '<option value="' . $rst12[$i]['id_funciontipo'] . '">' . $rst12[$i]['tipo_funcion'] . '</option>';

                                                            }

                                                        }

                                                        ?>

                                                    </select>

                                                </div>

                              

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

                                                    <select class="form-control" name="anyo" onchange="this.form.submit()">

                                                         <option value="0" <?php if ($tipof == '0') {echo 'selected';} ?>>Todos</option>

                                                        <?php

                                                        for ($Anyos = date("Y"); $Anyos > 2018; $Anyos--) {

                                                            if ($anio == $Anyos)

                                                                echo '<option selected value="' . $Anyos . '">' . $Anyos . '</option>';

                                                            else

                                                                echo '<option value="' . $Anyos . '">' . $Anyos . '</option>';

                                                        }

                                                        ?>

                                                    </select>

                                                </div>

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

                                                    <select class="form-control" name="estatus" onchange="this.form.submit()">

                                                         <option value="0" <?php if ($estatus == 0) {echo 'selected';} ?>>Todos</option>

                                                        <?php

                                                        

                                                          $consulta12 = "SELECT id_estatus,estatus

                                                                    FROM  tjam_funciones_estatus";

                                                        $rst12 = $conf->consulta($consulta12);

                                                        

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

                                                            if ($estatus == $rst12[$i]['id_estatus']) {

                                                                echo '<option selected value="' . $rst12[$i]['id_estatus'] . '">' . $rst12[$i]['estatus'] . '</option>';

                                                            } else {

                                                                echo '<option value="' . $rst12[$i]['id_estatus'] . '">' . $rst12[$i]['estatus'] . '</option>';

                                                            }

                                                       }

                                                        ?>

                                                    </select>

                                                </div>

                                                

                                            </div>

                                        </div>

                                    </div>

                            </form>

                            <br>







                            <?php

                            if ($elaborador == 1) {

                                echo '<div class="panel-body">

                                            <div class="demo-btn">

                                                <div class="row mbm center">';



                            }





                            if ($elaborador == 1) {

                                echo '<a href="page_find_controles.php?app=2" class="btn btn-info">Nuevo registro

                                            &nbsp;<i class="fa fa-plus"></i></a>';

                            }



                            echo '</div></div></div>';

                            ?>



                            <div class="row mbm">

                                <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>Folio</th>

                                                      <th>Tipo</th>

                                                    <th>Estatus</th>

                                                    <th>Fecha</th>

                                                   

                                                    <?php

                                                    switch ($tipof) {

                                                        case '1':

                                                    ?>

                                                            <th>Asunto</th>

                                                            <th>Destinatario</th>

                                                            <th>Cargo</th>

                                                            <th>PDF</th>

                                                        <?php

                                                            break;

                                                        case '2':

                                                        ?>

                                                            <th>Asunto</th>

                                                            <th>Destinatario</th>

                                                            <th>Cargo</th>

                                                            <th>PDF</th>

                                                        <?php

                                                            break;

                                                        case '3':

                                                        ?>

                                                            <th>Asunto</th>

                                                            <th>PDF</th>

                                                            <th>Word</th>

                                                        <?php

                                                            break;

                                                        case '4':

                                                        ?>

                                                            <th>Contrato</th>

                                                            <th>Notas</th>

                                                            <th>Arrendor/Prestador/Proveedor/Etc.</th>

                                                            <th>Objeto/Inmueble</th>

                                                            <th>Monto</th>

                                                            <th>Periodo/Vigencia</th>

                                                            <th>PDF</th>

                                                            <th>Word</th>

                                                        <?php

                                                            break;

                                                        case '5':

                                                        ?>

                                                            <th>Sesion</th>

                                                            <th>Orden</th>

                                                            <th>PDF</th>

                                                        <?php

                                                            break;

                                                        default:

                                                        // omitir

                                                            break;

                                                    }

                                                    ?>

                                                    <th>Opciones</th>

                                                </tr>

                                            </thead>



                                            <tbody>

                                                <?php



                                                $estatus = array("", "warning", "warning", "primary", "info", "success");



                                                $consulta = "SELECT t.*, s.*, f.*

                                                FROM tjam_funciones f

                                                LEFT JOIN tjam_funciones_tipo t ON (t.id_funciontipo = f.id_funciontipo)

                                                LEFT JOIN tjam_funciones_subtipo s ON (s.id_funcionsubtipo = f.id_funcionsubtipo)

                                                WHERE f.habilitado = 1 AND $funcion AND '$anio' = DATE_FORMAT(f.fecha_registro,'%Y')

                                                ORDER BY f.fecha_ofifir DESC, f.pre_actafolio DESC, f.actafolio DESC, f.post_actafolio DESC";

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

                               



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

                                                    $j = $i + 1;



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

                                                        $cancelado = 'Activo';

                                                        $canceladoc = 'class="label label-success"';

                                                    } elseif ($rst1[$i]["cancelado"] == 'Baja') {

                                                        $cancelado = 'Cancelado';

                                                        $canceladoc = 'class="label label-danger"';

                                                    }



                                                    echo "<tr>";

                                                    echo '<td>' . $j . '</td>';

                                                      echo "<td>" . $rst1[$i]["pre_actafolio"] . "" . $rst1[$i]["actafolio"] . "" . $rst1[$i]["post_actafolio"] . "</td>";

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

                                                    echo '<td><span ' . $canceladoc . '>' . $cancelado . '</span></td>';

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

                                                  



                                                    switch ($tipof) {

                                                        case '1':

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

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

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



                                                            echo '<td>';

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

                                                                echo 'N/D';

                                                            } else {

                                                                echo '<a href="./documentos/' . $rst1[$i]["url_pdfhp"] . '" target="_BLANK" > <img src="./img/pdf.png" title="Expediente" height="50" width="50" />  </a>';

                                                            }

                                                            echo '</td>';

                                                            break;

                                                        case '2':

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

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

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



                                                            echo '<td>';

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

                                                                echo 'N/D';

                                                            } else {

                                                                echo '<a href="./documentos/' . $rst1[$i]["url_pdfhp"] . '" target="_BLANK" > <img src="./img/pdf.png" title="Expediente" height="50" width="50" />  </a>';

                                                            }

                                                            echo '</td>';

                                                            break;

                                                        case '3':

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



                                                            echo '<td>';

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

                                                                echo 'N/D';

                                                            } else {

                                                                echo '<a href="./documentos/' . $rst1[$i]["url_pdfhp"] . '" target="_BLANK" > <img src="./img/pdf.png" title="Expediente" height="50" width="50" />  </a>';

                                                            }

                                                            echo '</td>';

                                                            echo '<td>';

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

                                                                echo 'N/D';

                                                            } else {

                                                                echo '<a href="./documentos/' . $rst1[$i]["url_worldedit"] . '" target="_BLANK" > <img src="./img/word.png" title="Expediente" height="50" width="50" />  </a>';

                                                            }

                                                            echo '</td>';

                                                            break;

                                                        case '4':

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

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

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

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

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

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



                                                            echo '<td>';

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

                                                                echo 'N/D';

                                                            } else {

                                                                echo '<a href="./documentos/' . $rst1[$i]["url_pdfhp"] . '" target="_BLANK" > <img src="./img/pdf.png" title="Expediente" height="50" width="50" />  </a>';

                                                            }

                                                            echo '</td>';

                                                            echo '<td>';

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

                                                                echo 'N/D';

                                                            } else {

                                                                echo '<a href="./documentos/' . $rst1[$i]["url_worldedit"] . '" target="_BLANK" > <img src="./img/word.png" title="Expediente" height="50" width="50" />  </a>';

                                                            }

                                                            echo '</td>';

                                                            break;

                                                        case '5':

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

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



                                                            echo '<td>';

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

                                                                echo 'N/D';

                                                            } else {

                                                                echo '<a href="./documentos/' . $rst1[$i]["url_pdfhp"] . '" target="_BLANK" > <img src="./img/pdf.png" title="Expediente" height="50" width="50" />  </a>';

                                                            }

                                                            echo '</td>';

                                                            break;

                                                        default:

                                                            # code...

                                                            break;

                                                    }



                                                    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">';



                                                    if ($elaborador == 1) {

                                                        echo '<li><a target="_blank" href="page_add_funcion.php?id_funcion=' . $rst1[$i]['id_funcion'] . '&app=2&opcion=2">

                                                            <i class="fa fa-share mrs"></i><span class="divider-text"></span>Seguimiento</a></li>';

                                                    }



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

                                                        echo

                                                        '<li><a><form><input type="hidden" name="id_funcion" value="'.$rst1[$i]['id_funcion'].'"><input type="hidden" name="cancelado" value="1">

                                                            <button type="submit" class="fa fa-ban mrs"  style="border:0px; background:#fff;" onclick="return confirm(\'¿Esta seguro de cancelar este folio?\')" formaction="./editar_folio.php">Cancelar Folio  

                                                        </button></form></a></li>';

                                                    } else {

                                                        echo

                                                        '<li><a><form><input type="hidden" name="id_funcion" value="'.$rst1[$i]['id_funcion'].'"><input type="hidden" name="cancelado" value="0">

                                                            <button type="submit" class="fa fa-check mrs"  style="border:0px; background:#fff;" onclick="return confirm(\'¿Esta seguro de restaurar este folio?\')" formaction="./editar_folio.php">Renovar Folio  

                                                        </button></form></a></li>';

                                                    }



                                                    echo '</ul>

                                                        </div>

                                                        </td>';

                                                    echo '</tr>';

                                                }



                                                $conf->desconectarDB();

                                                ?>



                                            </tbody>

                                        </table>



                                    </div>

                                </div>

                            </div>



                        </div>

                    </div>

                </div>

            </div>

        </div>

    </div>

</div>

Zerion Mini Shell 1.0