function loadAjaxExpediente()
 {
     $ser_id = $_POST["serie"];
     $sql = "SELECT\r\n                tab_expediente.exp_id,\r\n                tab_expediente.exp_nombre\r\n                FROM\r\n                tab_usuario\r\n                INNER JOIN tab_usu_serie ON tab_usuario.usu_id = tab_usu_serie.usu_id\r\n                INNER JOIN tab_series ON tab_series.ser_id = tab_usu_serie.ser_id\r\n                INNER JOIN tab_expediente ON tab_expediente.ser_id = tab_series.ser_id\r\n                WHERE\r\n                tab_series.ser_id = {$ser_id} AND tab_usuario.usu_id = " . $_SESSION['USU_ID'];
     $expediente = new tab_expediente();
     $result = $expediente->dbSelectBySQL($sql);
     $res = array();
     foreach ($result as $row) {
         $res[$row->exp_id] = $row->exp_nombre;
     }
     echo json_encode($res);
 }
 function verifFechaFin()
 {
     $expediente = new tab_expediente();
     $exp_id = $_POST["Exp_id"];
     $sql = "SELECT exp_fecha_exf\r\n                FROM tab_expediente\r\n                WHERE exp_id='{$exp_id}'";
     $row = $expediente->dbselectBySQL($sql);
     if ($row[0]->exp_fecha_exf) {
         echo 'El expediente fue cerrado';
     } else {
         echo '';
     }
 }
 function viewCajaExpediente()
 {
     $ini = $_POST['nro_inicial'];
     $fin = $ini;
     $exp_ids = $_POST['expedientes_ids'];
     $cantidadexp = $_POST['cantidadexp'];
     $cantdocs = $_POST['cantdocs'];
     $expedientes = explode(",", $_POST['cantexps']);
     $documentos = explode(",", $_POST['cantdocs']);
     $tiposeries = $_POST['tiposeries'];
     $cantidadetiqcajas = count($expedientes);
     $cantidadetiqcajas2 = count($documentos);
     $explode = explode(",", $exp_ids);
     $varioseries = $_POST['varioseries'];
     $nropiezas = $_POST['nropiezas'];
     if ($nropiezas != "") {
         $extraer_piezas = explode(",", $nropiezas);
     }
     $tab_expediente = new tab_expediente();
     $tab_expisadg = new Tab_expisadg();
     $cantidadtotal = $cantidadetiqcajas + $cantidadetiqcajas2;
     $expediente = new Tab_expediente();
     $fondo2 = new Tab_fondo();
     $texp = new Tab_etiquetas();
     $usuario = new usuario();
     $idexp = "SELECT tab_expediente.exp_id,tab_expediente.exp_codigo\r\n                FROM\r\n                tab_expediente\r\n                INNER JOIN tab_exparchivo ON tab_expediente.exp_id = tab_exparchivo.exp_id\r\n                INNER JOIN tab_archivo ON tab_exparchivo.fil_id = tab_archivo.fil_id\r\n                WHERE\r\n                tab_archivo.fil_estado=1 and tab_archivo.fil_id={$documentos['0']} ";
     $rowespdoc = $tab_expediente->dbSelectBySQL($idexp);
     $cant = count($explode);
     if ($fin == NULL) {
         $fin = $ini;
     }
     $where2 = "";
     $where4 = "";
     if ($cantidadexp != 0) {
         for ($t = 0; $t < $cantidadetiqcajas; $t++) {
             if ($expedientes[$t] != "") {
                 $where2 .= " tab_expediente.exp_id=" . $expedientes[$t];
                 if ($t < $cantidadetiqcajas - 1) {
                     $where2 .= " OR ";
                 }
             }
         }
         if ($cantidadetiqcajas2 > 0) {
             for ($u = 0; $u < $cantidadetiqcajas2; $u++) {
                 if ($documentos[$u] != "") {
                     $where4 .= " tab_archivo.fil_id=" . $documentos[$u];
                     if ($u < $cantidadetiqcajas2 - 1) {
                         $where4 .= " OR ";
                     }
                 }
             }
         }
     } else {
         for ($t = 0; $t < $cantidadetiqcajas; $t++) {
             $where2 .= " tab_expediente.exp_id=" . $rowespdoc[0]->exp_id;
         }
         for ($u = 0; $u < $cantidadetiqcajas2; $u++) {
             if ($documentos[$u] != "") {
                 $where4 .= " tab_archivo.fil_id=" . $documentos[$u];
                 if ($u < $cantidadetiqcajas2 - 1) {
                     $where4 .= " OR ";
                 }
             }
         }
     }
     if ($cantdocs == 1) {
         $where4 = " tab_archivo.fil_id=0";
     }
     $consultaexps = "SELECT\r\n                        min(tab_expediente.exp_codigo) as minimo,\r\n                        max(tab_expediente.exp_codigo) as maximo,\r\n                        count(tab_expediente.exp_codigo) as cantidad\r\n                        FROM\r\n                        tab_expediente\r\n                        WHERE\r\n                        tab_expediente.exp_estado = 1 AND {$where2}";
     $consultadoc = "SELECT\r\n                        MIN(tab_expediente.exp_codigo) as minimo,\r\n                        MAX(tab_expediente.exp_codigo) as maximo\r\n                        FROM\r\n                        tab_expediente\r\n                        INNER JOIN tab_exparchivo ON tab_expediente.exp_id = tab_exparchivo.exp_id\r\n                        INNER JOIN tab_archivo ON tab_exparchivo.fil_id = tab_archivo.fil_id\r\n                        WHERE\r\n                        tab_archivo.fil_estado = 1 and {$where4}";
     $rowsdocs = $expediente->dbSelectBySQL($consultadoc);
     $rowsexps = $tab_expediente->dbSelectBySQL($consultaexps);
     $wh = "";
     if ($nropiezas == "") {
         $wh = " AND tab_expediente.exp_nrocaj<>''";
     }
     //        echo $tiposeries; exit();
     $sql = "SELECT\r\n                tab_fondo.fon_cod,\r\n                u.uni_cod,\r\n                u.uni_id,\r\n                u.uni_descripcion,\r\n                tab_tipocorr.tco_codigo,\r\n                tab_series.ser_codigo,\r\n                tab_expediente.exp_codigo,\r\n                tab_expediente.exp_ori,\r\n                tab_expediente.exp_cop,\r\n                tab_expisadg.exp_titulo,\r\n                tab_series.ser_categoria,\r\n                (SELECT uni_descripcion from tab_unidad WHERE tab_unidad.uni_id=u.uni_par) AS uni_par_cod,\r\n                u.uni_codigo,\r\n                (SELECT sof_nombre FROM tab_sopfisico WHERE sof_id=tab_expediente.sof_id AND tab_sopfisico.sof_estado = '1' ) AS sof_nombre\r\n                FROM\r\n                tab_fondo\r\n                INNER JOIN tab_unidad AS u ON tab_fondo.fon_id = u.fon_id\r\n                INNER JOIN tab_series ON u.uni_id = tab_series.uni_id\r\n                INNER JOIN tab_tipocorr ON tab_tipocorr.tco_id = tab_series.tco_id\r\n                INNER JOIN tab_expediente ON tab_series.ser_id = tab_expediente.ser_id\r\n                INNER JOIN tab_expisadg ON tab_expisadg.exp_id = tab_expediente.exp_id\r\n                WHERE\r\n                tab_fondo.fon_estado = 1 AND\r\n                u.uni_estado = 1 AND\r\n                tab_tipocorr.tco_estado = 1 AND\r\n                tab_series.ser_estado = 1 AND\r\n                tab_expediente.exp_estado = 1 {$wh} and tab_series.ser_id={$tiposeries}";
     $rows = $texp->dbSelectBySQL($sql);
     $rows2 = $rows;
     $rows2 = $rows2[0];
     $tabfondo = new Tab_fondo();
     $cuerpo = $tabfondo->dbSelectBySQL($sql);
     // Include the main TCPDF library (search for installation path).
     //require_once('tcpdf/tcpdf_include.php');
     require_once 'tcpdf/tcpdf.php';
     // create new PDF document
     $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('Castellon S.R.L.');
     $pdf->SetTitle('Etiquetado de Cajas');
     $pdf->SetSubject('Etiquetado de Cajas');
     $pdf->SetKeywords('Etiquetado, Cajas, cajas, caratulas, folders');
     // set default header data
     //  $pdf->SetHeaderData('logo2.png', 25, 'ADMINISTRADORA BOLIVIANA DE CARRETERA', 'IMPRESI&Oacute;N DE CAJAS');
     //$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 048', PDF_HEADER_STRING);
     // set header and footer fonts
     $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
     $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     // set margins
     $pdf->SetMargins(PDF_MARGIN_LEFT, 5, PDF_MARGIN_RIGHT);
     $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
     $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     // set auto page breaks
     $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     // set image scale factor
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     // set some language-dependent strings (optional)
     if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
         require_once dirname(__FILE__) . '/lang/eng.php';
         $pdf->setLanguageArray($l);
     }
     // ---------------------------------------------------------
     // set font
     $pdf->SetFont('helvetica', 'B', 8);
     // add a page
     $pdf->AddPage();
     $pdf->Write(0, '', '', 0, 'L', true, 0, false, false, 0);
     $pdf->SetFont('helvetica', '', 8);
     $st = "";
     // -----------------------------------------------------------------------------
     //        $id_exp = $_REQUEST['exp_id'];
     $minimoExps = $rowsexps[0]->minimo;
     $maximoExps = $rowsexps[0]->maximo;
     $minimoDoc = $rowsdocs[0]->minimo;
     $maximoDoc = $rowsdocs[0]->maximo;
     $numero = $rowespdoc[0]->exp_codigo;
     if ($minimoExps != "" && $maximoExps != "" && $minimoDoc != "" && $maximoDoc != "") {
         $array = array($minimoExps, $maximoExps, $minimoDoc, $maximoDoc);
     } else {
         if ($maximoExps != "" && $minimoDoc != "" && $maximoDoc != "") {
             $array = array($maximoExps, $minimoDoc, $maximoDoc);
         } else {
             if ($minimoDoc != "" && $maximoDoc != "") {
                 $array = array($minimoDoc, $maximoDoc);
             } else {
                 if ($minimoExps != "" && $maximoExps != "") {
                     $array = array($minimoExps, $maximoExps);
                 }
             }
         }
     }
     $cant3 = 0;
     $minimo = min($array);
     $maximo = max($array);
     $diferencia = $maximo - $minimo;
     $cantMin = "";
     $cantMax = "";
     for ($i = $ini; $i <= $fin; $i++) {
         $sala = "";
         $estante = "";
         $balda = "";
         $cuerpo = "";
         $wh1 = "";
         if ($nropiezas == "") {
             $wh1 = " AND tab_expediente.exp_nrocaj='{$i}'";
         }
         $expcodigo = "";
         $sqlcodigos = "SELECT\r\n                    tab_fondo.fon_cod,\r\n                    u.uni_cod,\r\n                    tab_tipocorr.tco_codigo,\r\n                    tab_series.ser_codigo,\r\n                    tab_expediente.exp_codigo,\r\n                    (NULLIF(tab_expediente.exp_codigo,'')::int) as correlativo,\r\n                    tab_expediente.exp_ori,\r\n                    tab_expediente.exp_cop,\r\n                    tab_expediente.exp_fot,\r\n                    tab_expisadg.exp_titulo,\r\n                    (SELECT uni_descripcion from tab_unidad WHERE tab_unidad.uni_id=u.uni_par) AS uni_par_cod,\r\n                    u.uni_codigo,\r\n                    (SELECT sof_nombre FROM tab_sopfisico WHERE sof_id=tab_expediente.sof_id AND tab_sopfisico.sof_estado = '1' ) AS sof_nombre\r\n                    FROM\r\n                    tab_fondo\r\n                    INNER JOIN tab_unidad AS u ON tab_fondo.fon_id = u.fon_id\r\n                    INNER JOIN tab_series ON u.uni_id = tab_series.uni_id\r\n                    INNER JOIN tab_tipocorr ON tab_tipocorr.tco_id = tab_series.tco_id\r\n                    INNER JOIN tab_expediente ON tab_series.ser_id = tab_expediente.ser_id\r\n                    INNER JOIN tab_expisadg ON tab_expisadg.exp_id = tab_expediente.exp_id\r\n                    WHERE\r\n                    tab_fondo.fon_estado = 1 AND\r\n                    u.uni_estado = 1 AND\r\n                    tab_tipocorr.tco_estado = 1 AND\r\n                    tab_series.ser_estado = 1 AND\r\n                    tab_expediente.exp_estado = 1 {$wh1} AND tab_series.ser_id={$tiposeries}\r\n                    ORDER BY tab_expediente.exp_id";
         $resultadocod = $fondo2->dbSelectBySQL($sqlcodigos);
         $resultadocod = $resultadocod[0];
         $expe = new Tab_expediente();
         if ($cantidadexp != 0) {
             $sqlcaja = "SELECT\r\n                            tab_expediente.exp_sala,\r\n                            tab_expediente.exp_estante,\r\n                            tab_expediente.exp_balda,\r\n                            tab_expediente.exp_cuerpo,\r\n                            tab_expediente.exp_codigo\r\n                            FROM\r\n                            tab_expediente\r\n                            WHERE\r\n                            exp_estado=1 AND\r\n                            exp_nrocaj='{$i}' AND tab_expediente.exp_id={$expedientes['0']}";
             $cajaresult = $expe->dbSelectBySQL($sqlcaja);
             foreach ($cajaresult as $rowscaja) {
                 $sala = $rowscaja->exp_sala;
                 $estante = $rowscaja->exp_estante;
                 $balda = $rowscaja->exp_balda;
                 $cuerpo = $rowscaja->exp_cuerpo;
                 $expcodigo = $rowscaja->exp_codigo;
             }
         } else {
             $sqlcaja = "SELECT\r\n                            tab_expediente.exp_id,\r\n                            tab_expediente.exp_codigo,\r\n                            tab_archivo.fil_sala,\r\n                            tab_archivo.fil_estante,\r\n                            tab_archivo.fil_cuerpo,\r\n                            tab_archivo.fil_balda\r\n                            FROM\r\n                            tab_expediente\r\n                            INNER JOIN tab_exparchivo ON tab_expediente.exp_id = tab_exparchivo.exp_id\r\n                            INNER JOIN tab_archivo ON tab_exparchivo.fil_id = tab_archivo.fil_id\r\n                            WHERE\r\n                            tab_archivo.fil_id ={$documentos['0']} and tab_archivo.fil_estado=1";
             $cajaresult = $expe->dbSelectBySQL($sqlcaja);
             foreach ($cajaresult as $rowscaja) {
                 $sala = $rowscaja->fil_sala;
                 $estante = $rowscaja->fil_estante;
                 $balda = $rowscaja->fil_balda;
                 $cuerpo = $rowscaja->fil_cuerpo;
                 $expcodigo = $rowscaja->exp_codigo;
                 $exp_id = $rowscaja->exp_id;
             }
         }
         $st .= '<br><br>';
         $st .= '<table border="1" style="width: 100%">';
         $st .= '<tr>';
         $st .= '<td style="border-right:2px solid white;">';
         $st .= '<img src="' . PATH_ROOT . '/web/img/escudo.png" width="50" height="50" border="0" />';
         $st .= '</td><td align="right"><img src="' . PATH_ROOT . '/web/img/iso.png" width="50" height="50" border="0" />';
         $st .= '</td>';
         $st .= '</tr>';
         $st .= '<tr>';
         $st .= '<td colspan="2">';
         $st .= '<table border="1" style="width: 100%; text-align: center">';
         $st .= '<tr>';
         //$st.='<td colspan="11">'.$value->fon_cod . "-" . $value->uni_cod. '</td>';
         $st .= '<th colspan="11" height="20" style="font-size:70px"><b>' . $resultadocod->fon_cod . DELIMITER . $resultadocod->uni_cod . DELIMITER . $resultadocod->tco_codigo . DELIMITER . $resultadocod->ser_codigo . '</b>';
         if ($nropiezas != "") {
             $st .= "<b>." . $expcodigo . "</b>";
         } else {
             $st .= " " . $minimo . ' - ' . $maximo;
         }
         $st .= '</th>';
         $st .= '</tr>';
         //            echo $rows2->uni_cod; exit();
         // Verificar que tipo de seccion se va a mostrar de que  serie si tiene varias series
         $uc = explode(".", $rows2->uni_cod);
         $coduni = "{$uc['0']}.0";
         $tab_unidad = new Tab_unidad();
         $result = $tab_unidad->dbselectByField("uni_cod", $coduni);
         $result = $result[0];
         $explodeObtCaja = explode("(", $result->uni_descripcion);
         if ($explodeObtCaja[1] == "") {
             $seccion = $result->uni_descripcion;
         } else {
             $nuevo = $explodeObtCaja[1] . "a";
             $explodeObtCaja1 = explode(")", $nuevo);
             $seccion = $explodeObtCaja1[0];
         }
         $where3 = "";
         $longitud_cadena = explode(",", $varioseries);
         $longitud = count($longitud_cadena);
         for ($y = 0; $y < $longitud; $y++) {
             $where3 .= " tab_series.ser_id={$longitud_cadena[$y]} ";
             if ($y < $longitud - 1) {
                 $where3 .= " OR ";
             }
         }
         $slverificavariaseries = "SELECT\r\n                                    tab_series.ser_categoria\r\n                                    FROM\r\n                                    tab_series\r\n                                    WHERE\r\n                                    tab_series.ser_estado=1 AND {$where3}";
         $tab_series = new Tab_series();
         $unidad = new unidad();
         $padre = $unidad->obtenerPadre($rows2->uni_id);
         $pa = 0;
         if ($padre == $rows2->uni_descripcion) {
             $pa++;
         }
         if ($seccion == "PRESIDENCIA" && $rows2->uni_descripcion == "AREA TECNICA") {
             $st .= '<tr>';
             $st .= '<td colspan="11" height="20" style="font-size:30px"><b>' . htmlentities($rows2->uni_descripcion, ENT_IGNORE, 'utf-8') . '</b></td>';
             $st .= '</tr>';
         } else {
             if ($pa > 0) {
                 $st .= '<tr>';
                 $st .= '<td colspan="11" height="20" style="font-size:30px"><b>' . htmlentities($rows2->uni_descripcion, ENT_IGNORE, 'utf-8') . '</b></td>';
                 $st .= '</tr>';
             } else {
                 $st .= '<tr>';
                 $st .= '<td colspan="11" height="20" style="font-size:30px"><b>' . $padre . " - " . htmlentities($rows2->uni_descripcion, ENT_IGNORE, 'utf-8') . '</b></td>';
                 $st .= '</tr>';
             }
         }
         //            if ($rows2->uni_par_cod)
         //            {
         //                $st.='<tr>';
         //                $st.='<td colspan="11" height="20" style="font-size:30px"><b>' . $seccion . ' - ' . $rows2->uni_descripcion . '</b></td>';
         //                $st.='</tr>';
         //            }
         //            else
         //            {
         //                $st.='<tr>';
         //                $st.='<td colspan="11" height="20" style="font-size:30px"><b>' . $seccion . ' - ' . $result->uni_descripcion . '</b></td>';
         //                $st.='</tr>';
         //            }
         $st .= '<tr>';
         $st .= '<td colspan="11" height="20" style="font-size:35px"><b>';
         $series_rows = $tab_series->dbSelectBySQL($slverificavariaseries);
         foreach ($series_rows as $row) {
             $st .= $row->ser_categoria;
             if ($longitud > 1) {
                 $st .= ",";
             }
         }
         $diferencia = $diferencia + 1;
         $st .= '</b></td>';
         $st .= '</tr>';
         if ($diferencia > 1) {
             $st .= '<tr>';
             $st .= '<td colspan="11" height="20" style="font-size:48px"><b>' . $diferencia . ' EXPEDIENTE(S)</b></td>';
             $st .= '</tr>';
         } else {
             $rowtitulo = $tab_expisadg->dbselectByField("exp_id", $exp_id);
             $st .= '<tr>';
             $st .= '<td colspan="11" height="20" style="font-size:48px"><b>' . $rowtitulo[0]->exp_titulo . '</b></td>';
             $st .= '</tr>';
         }
         $cant1 = 0;
         $pdf->SetFont('helvetica', '', 8);
         $st .= '<tr>';
         $st .= '<td colspan="2" height="20" bgcolor="#CCCCCC" style="font-size:40px" width="232">FECHAS EXTREMAS:</td>';
         $st .= '<td colspan="9" bgcolor="#CCCCCC" width="420" style="font-size:40px">CODIGOS:</td>';
         $st .= '</tr>';
         $st .= '<tr>';
         $st .= '<td colspan="2" height="20" style="font-size:45px"><b>';
         if ($diferencia == 1) {
             $st .= $rowtitulo[0]->exp_anioi;
             if ($rowtitulo[0]->exp_aniof) {
                 $st .= " - " . $rowtitulo[0]->exp_aniof;
             }
         }
         $st .= '</b></td>';
         $st .= '<th colspan="9" rowspan="3"';
         if ($cantidadtotal > 15) {
             if ($cantidadtotal > 30) {
                 $st .= 'style="text-align:left;font-size:24px;padding:15px">';
             } else {
                 $st .= 'style="text-align:left;font-size:32px;padding:15px">';
             }
         } else {
             $st .= 'style="text-align:left;font-size:40px;padding:15px">';
         }
         $p = 0;
         if ($cantidadexp != 0) {
             $sqlcodigos2 = "SELECT\r\n                    tab_fondo.fon_cod,\r\n                    u.uni_cod,\r\n                    tab_tipocorr.tco_codigo,\r\n                    tab_series.ser_codigo,\r\n                    (NULLIF(tab_expediente.exp_codigo,'')::int) as correlativo,\r\n                    tab_expediente.exp_codigo,\r\n                    tab_expediente.exp_ori,\r\n                    tab_expediente.exp_cop,\r\n                    tab_expediente.exp_fot,\r\n                    tab_expediente.exp_id,\r\n                    tab_expisadg.exp_titulo,\r\n                    (SELECT uni_descripcion from tab_unidad WHERE tab_unidad.uni_id=u.uni_par) AS uni_par_cod,\r\n                    u.uni_codigo,\r\n                    (SELECT sof_nombre FROM tab_sopfisico WHERE sof_id=tab_expediente.sof_id AND tab_sopfisico.sof_estado = '1' ) AS sof_nombre\r\n                    FROM\r\n                    tab_fondo\r\n                    INNER JOIN tab_unidad AS u ON tab_fondo.fon_id = u.fon_id\r\n                    INNER JOIN tab_series ON u.uni_id = tab_series.uni_id\r\n                    INNER JOIN tab_tipocorr ON tab_tipocorr.tco_id = tab_series.tco_id\r\n                    INNER JOIN tab_expediente ON tab_series.ser_id = tab_expediente.ser_id\r\n                    INNER JOIN tab_expisadg ON tab_expisadg.exp_id = tab_expediente.exp_id\r\n                    WHERE\r\n                    tab_fondo.fon_estado = 1 AND\r\n                    u.uni_estado = 1 AND\r\n                    tab_tipocorr.tco_estado = 1 AND\r\n                    tab_series.ser_estado = 1 AND\r\n                    tab_expediente.exp_estado = 1 AND\r\n                    tab_expediente.exp_nrocaj='{$i}' AND {$where2}\r\n                    ORDER BY correlativo";
             $idexp = $_REQUEST['exp_id'];
             $vector = array();
             $resultadoexpw = $fondo2->dbSelectBySQL($sqlcodigos2);
             $r = 0;
             $cantidadCajasfilas = count($resultadoexpw);
             foreach ($resultadoexpw as $filnro) {
                 $st44 = "";
                 $codigo_exp = $filnro->fon_cod . DELIMITER . $filnro->uni_cod . DELIMITER . $filnro->tco_codigo . DELIMITER . $filnro->ser_codigo . DELIMITER . $filnro->correlativo;
                 $sumar = $filnro->exp_ori + $filnro->exp_cop + $filnro->exp_fot;
                 $cant1 = $cant1 + $filnro->exp_ori + $filnro->exp_cop + $filnro->exp_fot;
                 if ($sumar == 0) {
                     $archivo = new archivo();
                     $nroejemp = $archivo->obtenercantejemplares($filnro->exp_id);
                     $sumar = $nroejemp;
                     $cant1 = $cant1 + $sumar;
                 }
                 $st44 .= $codigo_exp . "(";
                 if ($nropiezas != "") {
                     $st44 .= $extraer_piezas[$r];
                     $cant3 = $extraer_piezas[$r] + $cant3;
                 } else {
                     $st44 .= $sumar;
                 }
                 $st44 .= ")";
                 // $st.="  (".$filnro->fil_fot.")";
                 $vector[$p] = $st44;
                 //    $st.="&nbsp;&nbsp; &nbsp; ";
                 $r++;
                 $p++;
             }
         }
         if ($cantidadetiqcajas2 > 0) {
             $sqlcodigos2 = "SELECT\r\n                            tab_fondo.fon_cod,\r\n                            tab_unidad.uni_cod,\r\n                            tab_unidad.uni_codigo,\r\n                            tab_series.ser_codigo,\r\n                            tab_tipocorr.tco_codigo,\r\n                            tab_expediente.exp_id,\r\n                            tab_expediente.exp_codigo,\r\n                            (NULLIF(tab_expediente.exp_codigo,'')::int) as correlativo,\r\n                            tab_archivo.fil_id,\r\n                            tab_archivo.fil_ori,\r\n                            tab_archivo.fil_cop,\r\n                            tab_archivo.fil_fot,\r\n                            tab_archivo.fil_nro,\r\n                            tab_archivo.fil_titulo\r\n                            FROM\r\n                            tab_fondo\r\n                            INNER JOIN tab_unidad ON tab_fondo.fon_id = tab_unidad.fon_id\r\n                            INNER JOIN tab_series ON tab_unidad.uni_id = tab_series.uni_id\r\n                            INNER JOIN tab_tipocorr ON tab_series.tco_id = tab_tipocorr.tco_id\r\n                            INNER JOIN tab_expediente ON tab_series.ser_id = tab_expediente.ser_id\r\n                            INNER JOIN tab_exparchivo ON tab_expediente.exp_id = tab_exparchivo.exp_id\r\n                            INNER JOIN tab_archivo ON tab_exparchivo.fil_id = tab_archivo.fil_id\r\n                            WHERE\r\n                            tab_fondo.fon_estado = 1 AND\r\n                            tab_series.ser_estado = 1 AND\r\n                            tab_expediente.exp_estado = 1 AND\r\n                            {$where4}  ORDER BY tab_archivo.fil_nro";
             $resultadoexpw = $fondo2->dbSelectBySQL($sqlcodigos2);
             $y = 0;
             $cantidadCajasfilas = count($resultadoexpw);
             foreach ($resultadoexpw as $filnro) {
                 $st44 = "";
                 $codigo_exp = $filnro->fon_cod . DELIMITER . $filnro->uni_cod . DELIMITER . $filnro->tco_codigo . DELIMITER . $filnro->ser_codigo . DELIMITER . $filnro->correlativo . DELIMITER . $filnro->fil_nro;
                 $sumar = $filnro->fil_ori + $filnro->fil_cop + $filnro->fil_fot;
                 $cant1 = $cant1 + $filnro->fil_ori + $filnro->fil_cop + $filnro->fil_fot;
                 if ($sumar == 0) {
                     $archivo = new archivo();
                     $nroejemp = $archivo->obtenercantejemplares($filnro->exp_id);
                     $sumar = $nroejemp;
                     $cant1 = $cant1 + $sumar;
                 }
                 $st44 .= $codigo_exp . "(";
                 if ($nropiezas != "") {
                     $st44 .= $extraer_piezas[$y];
                     $cant3 = $extraer_piezas[$y] + $cant3;
                 } else {
                     $st44 .= $sumar;
                 }
                 $st44 .= ")";
                 //                 $st42.="  (".$filnro->fil_fot.")";
                 $vector[$p] = $st44;
                 $y++;
                 $p++;
             }
             sort($vector);
             foreach ($vector as $ro) {
                 $st .= $ro;
                 $st .= "&nbsp; &nbsp;";
             }
         }
         $st .= '</th>';
         $st .= '</tr>';
         if ($cant3 == 0) {
             $cant = $cant1;
         } else {
             $cant = $cant3;
         }
         $st .= '<tr>';
         $st .= '<td colspan="4" height="20" bgcolor="#CCCCCC" width="232">NRO. DE CAJA DE EXPS.</td>';
         //  $st.='<td colspan="7" bgcolor="#CCCCCC" >ML</td>';
         $st .= '</tr>';
         //width="420"
         $st .= '<tr>';
         $st .= '<td height="20" colspan="4" rowspan="3" style="font-size:190px">' . $i . '</td>';
         //                    $st.='<td colspan="7" height="20" style="font-size:70px" >0,32</td>';
         $st .= '</tr>';
         $st .= '<tr>';
         $st .= '<td colspan="5" bgcolor="#CCCCCC" height="20" width="218">NRO. DE PIEZAS</td>';
         $st .= '<td colspan="2" bgcolor="#CCCCCC" width="201">NÂș DE TRANSFERENCIA</td>';
         $st .= '</tr>';
         $st .= '<tr>';
         $st .= '<td colspan="5" height="20" style="font-size:60px"><b>' . $cant . '</b></td>';
         $st .= '<td colspan="2"></td>';
         $st .= '</tr>';
         $st .= '<tr>';
         $st .= '<td colspan="4" bgcolor="#CCCCCC" height="20" width="232">UBICACI&Oacute;N TOPOGRAFICA:</td>';
         $st .= '<td colspan="5" bgcolor="#CCCCCC" height="20"  width="218">FECHA DE TRANSFERENCIA DOCUMENTAL</td>';
         $st .= '<td colspan="2" bgcolor="#CCCCCC" width="201">ELABORADO POR:</td>';
         $st .= '</tr>';
         $st .= '<tr>';
         $st .= '<td height="20" bgcolor="#CCCCCC">SALA</td>';
         $st .= '<td height="20" bgcolor="#CCCCCC">ESTANTE</td>';
         $st .= '<td height="20" bgcolor="#CCCCCC">BALDA</td>';
         $st .= '<td height="20" bgcolor="#CCCCCC">CUERPO</td>';
         $st .= '<td colspan="5" rowspan="2">';
         $st .= '</td>';
         $st .= '<td colspan="2" rowspan="2">' . $usuario->obtenerNombre($_SESSION['USU_ID']) . '</td>';
         $st .= '</tr>';
         $st .= '<tr>';
         $st .= '<td height="20" style="font-size:35px">' . $sala . '</td>';
         $st .= '<td height="20" style="font-size:35px">' . $estante . '</td>';
         $st .= '<td height="20" style="font-size:35px">' . $balda . '</td>';
         $st .= '<td height="20" style="font-size:35px">' . $cuerpo . '</td>';
         $st .= '</tr>';
         $st .= '</table>';
         $st .= '</td>';
         $st .= '</tr>';
         $st .= '</table>';
         $st .= '';
         $s = 0;
         $pdf->writeHTML($st, true, false, false, false, '');
         $st = "";
     }
     // -----------------------------------------------------------------------------
     //Close and output PDF document
     $pdf->Output('reporte_paquetes.pdf', 'I');
     //============================================================+
     // END OF FILE
     //============================================================+
 }
 function load()
 {
     $expediente = new tab_expediente();
     $expediente->setRequest2Object($_REQUEST);
     $usuario = new usuario();
     $page = $_REQUEST['page'];
     $rp = $_REQUEST['rp'];
     $sortname = $_REQUEST['sortname'];
     $sortorder = $_REQUEST['sortorder'];
     if (!$sortname) {
         $sortname = 'uni_id';
     }
     if (!$sortorder) {
         $sortorder = 'desc';
     }
     $sort = "ORDER BY {$sortname} {$sortorder}";
     if (!$page) {
         $page = 1;
     }
     if (!$rp) {
         $rp = 15;
     }
     $start = ($page - 1) * $rp;
     $limit = "LIMIT {$rp} OFFSET {$start} ";
     //
     $query = $_REQUEST['query'];
     $qtype = $_REQUEST['qtype'];
     $where = "";
     $tipo = $usuario->getTipo($_SESSION['USU_ID']);
     $where = "";
     if ($query != "") {
         if ($qtype == 'uni_id') {
             $where .= " and uni_id LIKE '{$query}' ";
         } elseif ($qtype == 'usu_nombres') {
             $where .= " and usu_nombres LIKE '%{$query}%' ";
         } else {
             $where .= " and {$qtype} LIKE '%{$query}%' ";
         }
     }
     $sql = "SELECT (SELECT tab_unidad.uni_id FROM tab_unidad WHERE  tab_unidad.uni_id = tab_usuario.uni_id) AS uni_id, tab_usuario.usu_nombres, tab_usuario.usu_apellidos, tab_series.ser_categoria, tab_series.ser_id, tab_usuario.usu_id, tab_series.ser_tipo\r\n                FROM tab_usuario Inner Join tab_usu_serie ON tab_usuario.usu_id = tab_usu_serie.usu_id Inner Join tab_series ON tab_usu_serie.ser_id = tab_series.ser_id\r\n                WHERE tab_usuario.usu_estado = '1' AND tab_usu_serie.use_estado = '1' AND tab_series.ser_estado = '1' {$where} {$sort} {$limit}";
     $sql2 = "SELECT (SELECT tab_unidad.uni_id FROM tab_unidad WHERE  tab_unidad.uni_id = tab_usuario.uni_id) AS uni_id, tab_usuario.usu_nombres, tab_usuario.usu_apellidos, tab_series.ser_categoria, tab_usuario.usu_id, tab_series.ser_id, tab_series.ser_tipo\r\n                FROM tab_usuario Inner Join tab_usu_serie ON tab_usuario.usu_id = tab_usu_serie.usu_id Inner Join tab_series ON tab_usu_serie.ser_id = tab_series.ser_id\r\n                WHERE tab_usuario.usu_estado =  '1' AND tab_usu_serie.use_estado =  '1' AND tab_series.ser_estado =  '1'";
     $exp = new expediente();
     $total = $expediente->dbSelectBySQL($sql2);
     $total = count($total);
     $result = $expediente->dbSelectBySQL($sql);
     // Header
     header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
     header("Cache-Control: no-cache, must-revalidate");
     header("Pragma: no-cache");
     header("Content-type: text/x-json");
     $json = "";
     $json .= "{\n";
     $json .= "page: {$page},\n";
     $json .= "total: {$total},\n";
     $json .= "rows: [";
     $rc = false;
     $i = 0;
     $expusu = new Tab_expusuario();
     foreach ($result as $un) {
         if ($rc) {
             $json .= ",";
         }
         $ser_id = $un->ser_id;
         $usu_id = $un->usu_id;
         // REVISED: CASTELLON
         // NUMBER EXPEDIENTS USER
         $sql = "SELECT count(tab_expusuario.eus_id) as con\r\n                    FROM tab_expediente Inner Join tab_expusuario ON tab_expediente.exp_id = tab_expusuario.exp_id\r\n                    WHERE tab_expediente.exp_estado =  '1' AND tab_expusuario.eus_estado = '1' AND tab_expediente.ser_id = '{$ser_id}' AND tab_expusuario.usu_id = '{$usu_id}'";
         $count = $expediente->dbSelectBySQL($sql);
         $count = $count[0];
         $sDate = date("Y-m-d", time() + 0 * 24 * 60 * 60);
         //include 'includes/init.php';
         $sql = "SELECT tab_usuario.usu_login, tab_expfondo.exf_id, tab_expfondo.exp_id, tab_expfondo.fon_id, tab_expfondo.exf_fecha_exi, tab_expfondo.exf_fecha_exf, tab_usuario.usu_login, tab_expediente.ser_id\r\n                    FROM tab_expfondo Inner Join tab_expusuario ON tab_expfondo.exp_id = tab_expusuario.exp_id Inner Join tab_usuario ON tab_expusuario.usu_id = tab_usuario.usu_id Inner Join tab_expediente ON tab_expfondo.exp_id = tab_expediente.exp_id\r\n                    WHERE tab_expfondo.fon_id =  '1' AND tab_expfondo.exf_estado =  '1' AND tab_expfondo.exf_fecha_exf <= '{$sDate}' AND tab_usuario.usu_estado =  '1' AND tab_expediente.ser_id = '{$ser_id}' AND tab_expediente.exp_estado =  '1' AND tab_usuario.usu_id = '{$usu_id}'\r\n                    ORDER BY tab_expfondo.exf_fecha_exf ASC";
         $countF = $expediente->dbSelectBySQL($sql);
         if (count($countF)) {
             $countF = $countF[0];
             $countF = $countF->conf;
         } else {
             $countF = 0;
         }
         $json .= "\n{";
         $json .= "id:'" . $un->uni_id . "',";
         $json .= "cell:['" . $un->uni_id . "'";
         $json .= ",'" . addslashes($un->usu_nombres) . "'";
         $json .= ",'" . addslashes($un->usu_apellidos) . "'";
         $json .= ",'" . addslashes($un->ser_categoria) . "'";
         $json .= ",'" . addslashes($un->ser_tipo) . "'";
         $json .= ",'" . addslashes($count->con) . "'";
         $json .= ",'" . addslashes($countF) . "'";
         $json .= "]}";
         $rc = true;
         $i++;
     }
     $json .= "]\n";
     $json .= "}";
     echo $json;
 }
 function CantidadExpConfirmar($trn)
 {
     $sql = "SELECT\r\n            ee.exp_id,\r\n            ee.ser_id,\r\n            ee.exp_nombre,\r\n            ee.exp_codigo,\r\n            ee.exp_estado,\r\n            ts.ser_categoria,\r\n            ttu.usu_nombres,\r\n            ttu.usu_apellidos,\r\n            tr.trn_id,\r\n            tun.uni_codigo,\r\n            tun.uni_descripcion\r\n            FROM\r\n            tab_expediente AS ee\r\n            Inner Join tab_transferencia AS tr ON ee.exp_id = tr.exp_id\r\n            Inner Join tab_series AS ts ON ee.ser_id = ts.ser_id\r\n            Inner Join tab_usuario AS ttu ON tr.trn_usuario_orig = ttu.usu_id\r\n            Inner Join tab_unidad AS tun ON ttu.uni_id = tun.uni_id\r\n            WHERE\r\n            tr.trn_id =  '{$trn->trn_confirmado}' AND\r\n            tr.trn_uni_origen =  '{$trn->trn_uni_origen}' AND\r\n            tr.trn_usuario_orig =  '{$trn->trn_usuario_orig}' AND\r\n            tr.trn_fecha_crea =  '{$trn->trn_fecha_crea}' AND tr.trn_estado = '1' ";
     $tree = "";
     $expediente = new tab_expediente();
     $rowExp = $expediente->dbSelectBySQL($sql);
     if (count($rowExp) == 0) {
         $tree .= "<tr><td colspan='3'><a href='#' class='suboptActx'>No existen expedientes en esta transferencia.</a></td></tr>";
     } else {
         foreach ($rowExp as $exp) {
             $tree .= "<tr><td><a href='#' class='suboptActx' exp_id='{$exp->exp_id}' >{$exp->exp_nombre}</a></td>";
             $tree .= "<td>{$exp->exp_codigo}</td><td>{$exp->ser_categoria}</td><td>{$exp->uni_codigo}</td>";
             $tree .= "</tr>";
         }
     }
     return $tree;
 }
 function linkTree($exp_id, $tra_id, $cue_id)
 {
     $expediente = new tab_expediente();
     $tab_expediente = $expediente->dbselectById($exp_id);
     $tab_expisadg = new tab_expisadg();
     $expisadg = $tab_expisadg->dbselectById($exp_id);
     $serie = new series();
     $tab_tramite = new Tab_tramite();
     $tab_tramite = $tab_tramite->dbselectById($tra_id);
     $tab_cuerpo = new Tab_cuerpos();
     $tab_cuerpo = $tab_cuerpo->dbselectById($cue_id);
     $flecha = "<img src='" . PATH_DOMAIN . "/web/img/arrow.png' width=\"12px\" height=\"12px\"/>";
     $serie_des = utf8_decode($serie->getTitle($tab_expediente->getSer_id()));
     $exp_des = utf8_decode($expisadg->getExp_titulo());
     $tramite = utf8_decode($tab_tramite->getTra_descripcion());
     $cuerpo = utf8_decode($tab_cuerpo->getCue_descripcion());
     return "<a href='" . PATH_DOMAIN . "/estrucDocumental/'> {$serie_des}</a> {$flecha}\r\n                <a href='" . PATH_DOMAIN . "/estrucDocumental/viewTree/" . $exp_id . "/'> {$exp_des}</a> {$flecha}\r\n                <a href='" . PATH_DOMAIN . "/estrucDocumental/viewTree/" . $exp_id . "/'> {$tramite} </a> {$flecha}\r\n                <a href='" . PATH_DOMAIN . "/estrucDocumental/viewTree/{$exp_id}/'> {$cuerpo} </a> ";
 }
 function view()
 {
     $exp_id = VAR3;
     $fil_id = VAR4;
     $this->archivo = new tab_archivo();
     $rows = $this->archivo->dbselectByField("fil_id", $fil_id);
     $row = $rows[0];
     // Tab_archivo
     // Tab_doccorr
     $tab_doccorr = new Tab_doccorr();
     $sql = "SELECT *\r\n                FROM tab_doccorr\r\n                WHERE fil_id='" . $row->fil_id . "'";
     $doccorr = $tab_doccorr->dbSelectBySQL($sql);
     if ($doccorr) {
         $doccorr = $doccorr[0];
         // Nur
         $hojas_ruta = new hojas_ruta();
         $this->registry->template->dco_id = $doccorr->dco_id;
         $this->registry->template->fil_cite = $hojas_ruta->obtenerSelect($doccorr->fil_cite);
         $seguimientos = new seguimientos();
         $this->registry->template->fil_nur_s = $seguimientos->obtenerSelect($doccorr->fil_nur_s);
         $this->registry->template->fil_nur = $doccorr->fil_nur;
         $this->registry->template->fil_asunto = $doccorr->fil_asunto;
         $this->registry->template->fil_sintesis = $doccorr->fil_sintesis;
         $this->registry->template->fil_nur_tipo = "";
     } else {
         // Nur
         $this->registry->template->dco_id = "";
         $this->registry->template->fil_cite = "";
         $this->registry->template->fil_nur_s = "";
         $this->registry->template->fil_nur = $_SESSION["codigo"];
         $this->registry->template->fil_asunto = "";
         $this->registry->template->fil_sintesis = "";
         $this->registry->template->fil_nur_tipo = "";
     }
     // Tab_exparchivo
     $sql = "SELECT *\r\n                FROM tab_exparchivo\r\n                WHERE fil_id='" . $row->fil_id . "'";
     $exa_rows = $this->archivo->dbSelectBySQL($sql);
     $exa_row = $exa_rows[0];
     $this->registry->template->exp_id = $exp_id;
     $this->registry->template->tra_id = $exa_row->tra_id;
     $this->registry->template->cue_id = $exa_row->cue_id;
     $this->registry->template->exa_id = $exa_row->exa_id;
     // Tab_archivo
     $this->registry->template->fil_id = $fil_id;
     $this->registry->template->fil_codigo = $row->fil_codigo;
     $expediente = new expediente();
     $this->registry->template->exp_codigo = $expediente->obtenerCodigo(VAR3);
     $this->registry->template->exp_nombre = "";
     $this->registry->template->exp_corr = $expediente->obtenerTipoCorrExpediente(VAR3);
     $this->registry->template->fil_nro = $row->fil_nro;
     $this->registry->template->fil_titulo = $row->fil_titulo;
     $this->registry->template->fil_subtitulo = $row->fil_subtitulo;
     $this->registry->template->fil_fecha = $row->fil_fecha;
     $this->registry->template->fil_mes = $expediente->obtenerSelectMes($row->fil_mes);
     $this->registry->template->fil_anio = $expediente->obtenerSelectAnio($row->fil_anio);
     $this->registry->template->fil_mesf = $expediente->obtenerSelectMes($row->fil_mesf);
     $this->registry->template->fil_aniof = $expediente->obtenerSelectAnio($row->fil_aniof);
     $idioma = new idioma();
     $this->registry->template->idi_id = $idioma->obtenerSelect($row->idi_id);
     $this->registry->template->fil_proc = $row->fil_proc;
     $this->registry->template->fil_firma = $row->fil_firma;
     $this->registry->template->fil_cargo = $row->fil_cargo;
     $this->registry->template->fil_alccon = $row->fil_alccon;
     // Find ser_id
     $texpediente = new tab_expediente();
     $tab_expediente = $texpediente->dbselectById(VAR3);
     $ser_id = $tab_expediente->getSer_id();
     // Include dynamic fields
     $expcampo = new expcampo();
     $this->registry->template->filcampo = $expcampo->obtenerSelectCampos($ser_id);
     $sopfisico = new sopfisico();
     $this->registry->template->sof_id = $sopfisico->obtenerSelect($row->sof_id);
     $this->registry->template->fil_nrofoj = $row->fil_nrofoj;
     $this->registry->template->fil_tomovol = $row->fil_tomovol;
     $this->registry->template->fil_nroejem = $row->fil_nroejem;
     $this->registry->template->fil_nrocaj = $row->fil_nrocaj;
     $this->registry->template->fil_nropaq = $row->fil_nropaq;
     $this->registry->template->fil_cantpaq = $row->fil_cantpaq;
     $this->registry->template->fil_cantcaj = $row->fil_cantcaj;
     $this->registry->template->fil_sala = $row->fil_sala;
     $archivo = new archivo();
     $this->registry->template->fil_estante = $archivo->obtenerSelectEstante($row->fil_estante);
     $this->registry->template->fil_cuerpo = $row->fil_cuerpo;
     $this->registry->template->fil_balda = $row->fil_balda;
     $this->registry->template->fil_tipoarch = $row->fil_tipoarch;
     $this->registry->template->fil_mrb = $row->fil_mrb;
     if ($row->fil_ori) {
         $this->registry->template->fil_ori = $row->fil_ori;
     } else {
         $this->registry->template->fil_ori = '0';
     }
     if ($row->fil_cop) {
         $this->registry->template->fil_cop = $row->fil_cop;
     } else {
         $this->registry->template->fil_cop = '0';
     }
     if ($row->fil_fot) {
         $this->registry->template->fil_fot = $row->fil_fot;
     } else {
         $this->registry->template->fil_fot = '0';
     }
     $this->registry->template->fil_confidencilidad = $row->fil_confidencialidad;
     $this->registry->template->fil_obs = $row->fil_obs;
     $this->registry->template->required_archivo = "";
     // Validate keywords
     $palclave = new palclave();
     $sis_palclave = $palclave->obtenerSisPalclave();
     if ($sis_palclave == "RECORDAR") {
         $this->registry->template->fil_descripcion = $palclave->listaPCFile($row->fil_id);
         $this->registry->template->pac_nombre = "";
     } else {
         $this->registry->template->fil_descripcion = "";
         $this->registry->template->pac_nombre = "";
     }
     $tab_serie = new tab_series();
     $row1 = $tab_serie->dbselectById($ser_id);
     $expisadg = new tab_expisadg();
     $row2 = $expisadg->dbselectById(VAR3);
     $expediente2 = new expediente();
     $this->registry->template->detExpediente = "";
     $this->registry->template->detExpediente = $expediente2->getDetalles(VAR3);
     $this->registry->template->ubicacion = $expediente2->getUbicacion(VAR3);
     $this->registry->template->ser_id = $row1->ser_id;
     $this->registry->template->serie = $row1->ser_categoria;
     $this->registry->template->exp_fecha_exi = $row2->exp_fecha_exi;
     $this->registry->template->exp_fecha_exf = $row2->exp_fecha_exf;
     if (VAR5) {
         if (VAR5 == 0) {
             $msm = "HUBO ERROR AL REGISTRAR EL DOCUMENTO!";
         } else {
             if (VAR5 == 1) {
                 $msm = "SE GUARDO CORRECTAMENTE EL DOCUMENTO!";
             } else {
                 $msm = "";
             }
         }
     } else {
         $msm = "";
     }
     $this->registry->template->msm = $msm;
     $exp = new expediente();
     $this->registry->template->linkTree = $exp->linkTree($exp_id, $exa_row->tra_id, $exa_row->cue_id);
     $arc = new archivo();
     $this->registry->template->confidencialidad = $arc->loadConfidencialidad('1');
     $this->registry->template->PATH_WEB = PATH_WEB;
     $this->registry->template->PATH_DOMAIN = PATH_DOMAIN;
     $this->registry->template->PATH_EVENT = "update";
     $this->registry->template->controller = VAR1;
     $this->registry->template->GRID_SW = "true";
     $this->registry->template->PATH_J = "jquery-1.4.1";
     $this->registry->template->tituloEstructura = "<div class='titulo' align='center'>ESTRUCTURA DOCUMENTAL</div>";
     $this->menu = new menu();
     $liMenu = $this->menu->imprimirMenu(VAR1, $_SESSION['USU_ID']);
     $this->registry->template->men_titulo = $liMenu;
     $this->registry->template->show('headerG');
     //        $this->registry->template->show('archivo/exp_detallesView.tpl');
     $this->registry->template->show('archivo/tab_archivo.tpl');
     $this->registry->template->show('footer');
 }