function view()
 {
     if (!VAR3) {
         die("Error del sistema 404");
     }
     $this->expediente = new tab_expediente();
     $rows = $this->expediente->dbselectByField("exp_id", VAR3);
     $row = $rows[0];
     $this->registry->template->exp_id = $row->exp_id;
     $this->registry->template->ser_id = $row->ser_id;
     $series = new series();
     $uni_id = $series->obtenerSeccionIdSerie($row->ser_id);
     $this->registry->template->series = $series->obtenerSelectSeccionDefaultEdit($_SESSION['USU_ID'], $uni_id, $row->ser_id);
     $this->registry->template->ser_codigo = $series->obtenerCodigoSerie($row->ser_id);
     $this->registry->template->ser_corr = $series->obtenerTipoCorrSerie($row->ser_id);
     $this->registry->template->uni_descripcion = $series->obtenerSeccionSerie($row->ser_id);
     $this->registry->template->exp_codigo = $row->exp_codigo;
     // Dynamic fields
     $expcampo = new expcampo();
     $this->registry->template->expcampo = $expcampo->obtenerSelectCamposEdit($row->ser_id, VAR3);
     $sopfisico = new sopfisico();
     $this->registry->template->sof_id = $sopfisico->obtenerSelect($row->sof_id);
     $this->registry->template->exp_lugar = $row->exp_lugar;
     $this->registry->template->exp_nrofoj = $row->exp_nrofoj;
     $this->registry->template->exp_tomovol = $row->exp_tomovol;
     $this->registry->template->exp_nroejem = $row->exp_nroejem;
     $this->registry->template->exp_nrocaj = $row->exp_nrocaj;
     $this->registry->template->exp_sala = $row->exp_sala;
     $expediente = new expediente();
     $this->registry->template->exp_estante = $expediente->obtenerSelectEstante($row->exp_estante);
     $this->registry->template->exp_cuerpo = $row->exp_cuerpo;
     $this->registry->template->exp_balda = $row->exp_balda;
     $this->registry->template->exp_obs = $row->exp_obs;
     $this->registry->template->exp_ori = $row->exp_ori;
     $this->registry->template->exp_cop = $row->exp_cop;
     $this->registry->template->exp_fot = $row->exp_fot;
     // Validate keywords
     $palclave = new palclave();
     $sis_palclave = $palclave->obtenerSisPalclave();
     if ($sis_palclave == "RECORDAR") {
         $this->registry->template->exp_descripcion = $palclave->listaPCFile2($row->exp_id);
     } else {
         $this->registry->template->exp_descripcion = $palclave->listaPCFile2($row->exp_id);
     }
     // Automatic register
     if ($row->exp_corr == 'AUTO') {
         $this->registry->template->exp_corr = "<OPTION selected>AUTO</OPTION><OPTION>MANUAL</OPTION>";
     } else {
         $this->registry->template->exp_corr = "<OPTION>AUTO</OPTION><OPTION selected>MANUAL</OPTION>";
     }
     // isadg
     $expisadg = new tab_expisadg();
     $rows2 = $expisadg->dbselectByField("exp_id", VAR3);
     $row2 = $rows2[0];
     $this->registry->template->exp_titulo = $row2->exp_titulo;
     $this->registry->template->exp_fecha_exi = $row2->exp_fecha_exi;
     $this->registry->template->exp_mesi = $expediente->obtenerSelectMes($row2->exp_mesi);
     $this->registry->template->exp_anioi = $expediente->obtenerSelectAnio($row2->exp_anioi);
     $this->registry->template->exp_fecha_exf = $row2->exp_fecha_exf;
     $this->registry->template->exp_mesf = $expediente->obtenerSelectMes($row2->exp_mesf);
     $this->registry->template->exp_aniof = $expediente->obtenerSelectAnio($row2->exp_aniof);
     $this->registry->template->exp_volsop = $row2->exp_volsop;
     $this->registry->template->exp_nomprod = $row2->exp_nomprod;
     $this->registry->template->exp_hisins = $row2->exp_hisins;
     $this->registry->template->exp_hisarc = $row2->exp_hisarc;
     $this->registry->template->exp_foring = $row2->exp_foring;
     $this->registry->template->exp_alccon = $row2->exp_alccon;
     $this->registry->template->exp_vaseel = $row2->exp_vaseel;
     $this->registry->template->exp_nueing = $row2->exp_nueing;
     $this->registry->template->exp_org = $row2->exp_org;
     $this->registry->template->exp_conacc = $row2->exp_conacc;
     $this->registry->template->exp_conrep = $row2->exp_conrep;
     $idioma = new idioma();
     $this->registry->template->idi_id = $idioma->obtenerSelect($row2->idi_id);
     $this->registry->template->exp_carfis = $expediente->obtenerSelectEstado($row2->exp_carfis);
     $this->registry->template->exp_insdes = $row2->exp_insdes;
     $this->registry->template->exp_exloor = $row2->exp_exloor;
     $this->registry->template->exp_exloco = $row2->exp_exloco;
     $this->registry->template->exp_underel = $row2->exp_underel;
     $this->registry->template->exp_notpub = $row2->exp_notpub;
     $this->registry->template->exp_notas = $row2->exp_notas;
     $this->registry->template->exp_notarc = $row2->exp_notarc;
     $this->registry->template->exp_regnor = $row2->exp_regnor;
     $this->registry->template->exp_fecdes = $row2->exp_fecdes;
     $eus = new Tab_expusuario();
     $row_eus = $eus->dbselectBy2Field("exp_id", VAR3, "eus_estado", 1);
     $usu_id = $_SESSION['USU_ID'];
     if (!is_null($row_eus) && count($row_eus) > 0) {
         $usu_id = $row_eus[0]->usu_id;
     }
     // Keywords
     //        $palclave = new palclave();
     //        $this->registry->template->pac_nombre = $palclave->listaPC();
     $this->registry->template->pac_nombre = "";
     if (VAR4) {
         if (VAR4 == 0) {
             $msm = "HUBO ERROR AL REGISTRAR EL EXPEDIENTE!";
         } else {
             if (VAR4 == 1) {
                 $msm = "SE GUARDO CORRECTAMENTE EL EXPEDIENTE!";
             } else {
                 $msm = "";
             }
         }
     } else {
         $msm = "";
     }
     $this->registry->template->msm = $msm;
     $this->registry->template->PATH_WEB = PATH_WEB;
     $this->registry->template->PATH_DOMAIN = PATH_DOMAIN;
     $this->registry->template->PATH_EVENT = "update";
     $this->registry->template->GRID_SW = "true";
     $this->registry->template->PATH_J = "jquery-1.4.1";
     $this->registry->template->titulo = "HOJA DE TRABAJO - Editar";
     $this->menu = new menu();
     $this->liMenu = $this->menu->imprimirMenu(VAR1, $_SESSION['USU_ID']);
     $this->registry->template->men_titulo = $this->liMenu;
     $this->registry->template->show('headerG');
     $this->registry->template->show('expediente/tab_expediente.tpl');
     $this->registry->template->show('footer');
 }
 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');
 }