function search() { // Search $usuario = new usuario(); $tarchivo = new tab_archivo(); $tarchivo->setRequest2Object($_REQUEST); // Hasta aqui $valor = ""; $id_listar = ""; if (isset($_SESSION['id_lista'])) { $id_listar = $_SESSION['id_lista']; } if (isset($_REQUEST["palabra"])) { $palabra = html_entity_decode(trim(strtoupper($_REQUEST["palabra"])), ENT_QUOTES); } if (isset($_REQUEST["uni_id"])) { $uni_id = html_entity_decode(trim($_REQUEST["uni_id"]), ENT_QUOTES); } if (isset($_REQUEST["ser_id"])) { $ser_id = html_entity_decode(trim($_REQUEST["ser_id"]), ENT_QUOTES); } if (isset($_REQUEST["tra_id"])) { $tra_id = html_entity_decode(trim($_REQUEST["tra_id"]), ENT_QUOTES); } if (isset($_REQUEST["cue_id"])) { $cue_id = html_entity_decode(trim($_REQUEST["cue_id"]), ENT_QUOTES); } if (isset($_REQUEST["exp_titulo"])) { $exp_titulo = html_entity_decode(trim(strtoupper($_REQUEST["exp_titulo"])), ENT_QUOTES); } if (isset($_REQUEST["fil_titulo"])) { $fil_titulo = html_entity_decode(trim(strtoupper($_REQUEST["fil_titulo"])), ENT_QUOTES); } if (isset($_REQUEST["fil_subtitulo"])) { $fil_subtitulo = html_entity_decode(strtoupper(trim($_REQUEST["fil_subtitulo"])), ENT_QUOTES); } if (isset($_REQUEST["fil_proc"])) { $fil_proc = html_entity_decode(trim(strtoupper($_REQUEST["fil_proc"])), ENT_QUOTES); } if (isset($_REQUEST["fil_firma"])) { $fil_firma = html_entity_decode(trim(strtoupper($_REQUEST["fil_firma"])), ENT_QUOTES); } if (isset($_REQUEST["fil_cargo"])) { $fil_cargo = html_entity_decode(trim(strtoupper($_REQUEST["fil_cargo"])), ENT_QUOTES); } if (isset($_REQUEST["fil_tipoarch"])) { // MODIFICAR ESTE PARAMETRO POR EL MOMENTO ESTA RECIBIENDO VACIO //$result['fil_tipoarch'] = html_entity_decode(trim(strtoupper($_REQUEST["fil_tipoarch"])), ENT_QUOTES); $fil_tipoarch = html_entity_decode(trim(strtoupper("")), ENT_QUOTES); } if (isset($_REQUEST["pac_nombre"])) { $pac_nombre = html_entity_decode(trim(strtoupper($_REQUEST["pac_nombre"])), ENT_QUOTES); } $page = $_REQUEST['page']; $rp = $_REQUEST['rp']; $sortname = $_REQUEST['sortname']; $sortorder = $_REQUEST['sortorder']; if (!$sortname) { $sortname = " tab_series.ser_orden, \r\n tab_expediente.exp_codigo::int,\r\n tab_archivo.fil_nro::int "; } else { $sortname = $sortname; } if (!$sortorder) { $sortorder = 'desc'; } $sort = "ORDER BY {$sortname} {$sortorder}"; if (!$page) { $page = 1; } if (!$rp) { $rp = 20; } $start = ($page - 1) * $rp; $limit = "LIMIT {$rp} OFFSET {$start} "; $query = $_REQUEST['query']; $qtype = $_REQUEST['qtype']; $where = ""; if ($query) { if ($qtype) { } } $whereUsuario = ""; // $usu_id = $_SESSION['USU_ID']; // if ($_SESSION['ROL_COD'] != 'AA') { // $whereUsuario = " AND tab_expusuario.usu_id=" . $_SESSION['USU_ID'] . ""; // } // Search docs $select = "SELECT \r\n tab_expediente.exp_id,\r\n tab_archivo.fil_id,\r\n f.fon_codigo,\r\n f.fon_cod,\r\n tab_unidad.uni_cod,\r\n tab_tipocorr.tco_codigo,\r\n tab_series.ser_codigo,\r\n tab_expediente.exp_codigo,\r\n tab_archivo.fil_nro,\r\n tab_unidad.uni_descripcion,\r\n tab_series.ser_categoria,\r\n tab_expisadg.exp_titulo, \r\n tab_cuerpos.cue_descripcion,\r\n tab_archivo.fil_confidencialidad,\r\n tab_archivo.fil_titulo,\r\n tab_archivo.fil_subtitulo,\r\n tab_archivo.fil_proc,\r\n tab_archivo.fil_firma,\r\n tab_archivo.fil_cargo,\r\n tab_archivo.fil_nrofoj,\r\n tab_archivo.fil_tomovol,\r\n tab_archivo.fil_nroejem,\r\n tab_archivo.fil_nrocaj,\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 tab_archivo.fil_tipoarch,\r\n tab_archivo.fil_mrb,\r\n tab_archivo.fil_ori,\r\n tab_archivo.fil_cop,\r\n tab_archivo.fil_fot, \r\n (SELECT fil_extension FROM tab_archivo_digital WHERE tab_archivo_digital.fil_id=tab_archivo.fil_id AND tab_archivo_digital.fil_estado = '1' ) AS fil_extension,\r\n (SELECT fil_nur FROM tab_doccorr WHERE tab_doccorr.fil_id=tab_archivo.fil_id AND tab_doccorr.dco_estado = '1' ) AS fil_nur, \r\n (SELECT fil_asunto FROM tab_doccorr WHERE tab_doccorr.fil_id=tab_archivo.fil_id AND tab_doccorr.dco_estado = '1' ) AS fil_asunto, \r\n tab_archivo.fil_obs,\r\n tab_expusuario.usu_id"; $from = "FROM\r\n tab_fondo as f\r\n INNER JOIN tab_unidad ON f.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_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_expediente.exp_id = tab_expisadg.exp_id\r\n INNER JOIN tab_expusuario ON tab_expediente.exp_id = tab_expusuario.exp_id\r\n LEFT JOIN tab_exparchivo ON tab_expediente.exp_id = tab_exparchivo.exp_id\r\n INNER JOIN tab_archivo ON tab_archivo.fil_id = tab_exparchivo.fil_id \r\n INNER JOIN tab_cuerpos ON tab_cuerpos.cue_id = tab_exparchivo.cue_id\r\n INNER JOIN tab_tramitecuerpos ON tab_cuerpos.cue_id = tab_tramitecuerpos.cue_id\r\n INNER JOIN tab_tramite ON tab_tramite.tra_id = tab_tramitecuerpos.tra_id\r\n WHERE\r\n f.fon_estado = 1 AND\r\n tab_unidad.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_archivo.fil_estado = 1 AND\r\n tab_exparchivo.exa_estado = 1 AND\r\n tab_expusuario.eus_estado = 1\r\n {$whereUsuario} "; // (SELECT fil_extension FROM tab_archivo_digital WHERE tab_archivo_digital.fil_id=tab_archivo.fil_id AND tab_archivo_digital.fil_estado = '1' ) AS fil_extension, $where = ""; if ($id_listar != "") { $explode = explode(",", $id_listar); $cantidad = count($explode); for ($i = 0; $i < $cantidad; $i++) { $valor .= "tab_archivo.fil_id<>" . $explode[$i]; if ($i < $cantidad - 1) { $valor .= " and "; } } $where .= " AND {$valor} "; } // Search all fields if (strlen($palabra)) { $where .= " AND (tab_expisadg.exp_titulo like '%{$palabra}%' "; $where .= " OR f.fon_descripcion like '%{$palabra}%' "; $where .= " OR tab_unidad.uni_descripcion like '%{$palabra}%' "; $where .= " OR tab_series.ser_categoria like '%{$palabra}%' "; $where .= " OR tab_archivo.fil_titulo like '%{$palabra}%' "; $where .= " OR tab_archivo.fil_subtitulo like '%{$palabra}%' "; $where .= " OR tab_archivo.fil_proc like '%{$palabra}%' "; $where .= " OR tab_archivo.fil_firma like '%{$palabra}%' "; $where .= " OR tab_archivo.fil_cargo like '%{$palabra}%' "; $where .= " OR tab_archivo.fil_tipoarch like '%{$palabra}%' "; $palclave = new palclave(); $ids = $palclave->listaPCSearchFile($palabra); if ($ids == "") { } else { $where .= " OR tab_archivo.fil_id IN ({$ids}) "; } $where .= " ) "; } if (strlen($uni_id) > 0 && $uni_id != 'null') { $where .= " AND tab_unidad.uni_id='{$uni_id}' "; } if (strlen($ser_id) > 0 && $ser_id != 'null') { $where .= " AND tab_series.ser_id='{$ser_id}' "; } if (strlen($tra_id) > 0 && $tra_id != 'null') { $where .= " AND tab_tramite.tra_id='{$tra_id}' "; } if (strlen($cue_id) > 0 && $cue_id != 'null') { $where .= " AND tab_cuerpos.cue_id='{$cue_id}' "; } if (strlen($exp_titulo)) { $where .= " AND tab_expisadg.exp_titulo like '%{$exp_titulo}%' "; } if (strlen($fil_titulo)) { $where .= " AND tab_archivo.fil_titulo like '%{$fil_titulo}%' "; } if (strlen($fil_subtitulo)) { $where .= " AND tab_archivo.fil_subtitulo like '%{$fil_subtitulo}%' "; } if (strlen($fil_proc)) { $where .= " AND tab_archivo.fil_proc like '%{$fil_proc}%' "; } if (strlen($fil_firma)) { $where .= " AND tab_archivo.fil_firma like '%{$fil_firma}%' "; } if (strlen($fil_cargo)) { $where .= " AND tab_archivo.fil_cargo like '%{$fil_cargo}%' "; } if (strlen($fil_tipoarch)) { $where .= " AND tab_archivo.fil_tipoarch like '%{$fil_tipoarch}%' "; } // Search addwords if (strlen($pac_nombre)) { $palclave = new palclave(); $ids = $palclave->listaPCSearchFile($pac_nombre); if ($ids == "") { } else { $where .= " AND tab_archivo.fil_id IN ({$ids}) "; } } // MODIFICADO //$sort = "ORDER BY tab_expediente.exp_id, tab_cuerpos.cue_id, tab_archivo.fil_nro "; //$sort = "ORDER BY tab_series.ser_orden, tab_expediente.exp_codigo::int, tab_archivo.fil_nro::int "; $sql = "{$select} {$from} {$where} {$sort} {$limit}"; $result = $tarchivo->dbSelectBySQL($sql); //print $sql; $sql_c = "SELECT COUNT(tab_archivo.fil_id) {$from} {$where} "; $total = $tarchivo->countBySQL($sql_c); $exp = new expediente(); 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; $exp_titulo = ""; foreach ($result as $un) { if ($un->exp_titulo != $exp_titulo) { // Expediente if ($rc) { $json .= ","; } $json .= "\n{"; $json .= "id:'" . $un->exp_id . "',"; $json .= "cell:['" . '<font color=#238E23>E' . $un->exp_id . "</font>'"; $json .= ",'<img src=\"" . PATH_DOMAIN . "/web/lib/32/document-{$un->fil_extension}.png\" file=\"{$un->fil_id}\" valueId=\"" . 'E' . $un->fil_id . "\" restric=\"" . $un->fil_confidencialidad . "\" class=\"viewFile icon\" />'"; //$json .= ",'<img src=\"" . PATH_DOMAIN . "/web/lib/32/document-.png\" file=\"$un->fil_id\" valueId=\"" . 'E' . $un->fil_id . "\" restric=\"" . $un->fil_confidencialidad . "\" class=\"viewFile icon\" />'"; $json .= ",'<img src=\"" . PATH_DOMAIN . "/web/lib/32/b_view.png\" file=\" {$un->exp_id}\" valueId=\"" . 'E' . $un->exp_id . "\" restric=\"" . $un->fil_confidencialidad . "\" class=\"view icon\" />'"; $json .= ",'<font color=#238E23>" . addslashes($un->fon_cod . DELIMITER . $un->uni_cod . DELIMITER . $un->tco_codigo . DELIMITER . $un->ser_codigo . DELIMITER . $un->exp_codigo) . "</font>'"; //$json .= ",'" . addslashes($un->fon_cod . DELIMITER . $un->uni_cod . DELIMITER . $un->tco_codigo . DELIMITER . $un->ser_codigo . DELIMITER . $un->exp_codigo) . "'"; $json .= ",'" . addslashes($usuario->getRol($un->usu_id)) . "'"; $json .= ",'" . addslashes($un->fon_codigo) . "'"; $json .= ",'" . addslashes(utf8_decode($un->uni_descripcion)) . "'"; $json .= ",'" . addslashes(utf8_decode($un->ser_categoria)) . "'"; $json .= ",'" . addslashes(utf8_decode($un->exp_titulo)) . "'"; //$json .= ",'" . addslashes(utf8_decode($un->cue_descripcion)) . "'"; //$json .= ",'" . addslashes(/*utf8_decode($un->fil_titulo)*/) . "'"; $json .= ",'" . addslashes("") . "'"; $json .= ",'" . addslashes("") . "'"; $json .= ",'" . addslashes("") . "'"; $json .= ",'" . addslashes("") . "'"; $json .= ",'" . addslashes("") . "'"; $json .= ",'" . addslashes("") . "'"; $json .= ",'" . addslashes("") . "'"; $json .= ",'" . addslashes("") . "'"; $json .= ",'" . addslashes("") . "'"; $json .= ",'" . addslashes("") . "'"; $json .= ",'" . addslashes("") . "'"; $json .= ",'" . addslashes("") . "'"; $json .= ",'" . addslashes("") . "'"; $json .= ",'" . addslashes("") . "'"; $json .= ",'" . addslashes("") . "'"; $json .= ",'" . addslashes("") . "'"; $json .= ",'" . addslashes("") . "'"; // SIACO $json .= ",'" . addslashes("") . "'"; $json .= ",'" . addslashes("") . "'"; $json .= "]}"; $rc = true; // Documento if ($rc) { $json .= ","; } $json .= "\n{"; $json .= "id:'" . $un->fil_id . "',"; $json .= "cell:['" . $un->fil_id . "'"; $json .= ",'<img src=\"" . PATH_DOMAIN . "/web/lib/32/document-{$un->fil_extension}.png\" file=\"{$un->fil_id}\" valueId=\"" . $un->fil_id . "\" restric=\"" . $un->fil_confidencialidad . "\" class=\"viewFile icon\" />'"; //$json .= ",'<img src=\"" . PATH_DOMAIN . "/web/lib/32/document-.png\" file=\"$un->fil_id\" valueId=\"" . $un->fil_id . "\" restric=\"" . $un->fil_confidencialidad . "\" class=\"viewFile icon\" />'"; $json .= ",'<img src=\"" . PATH_DOMAIN . "/web/lib/32/b_view.png\" file=\"{$un->fil_id}\" valueId=\"" . $un->fil_id . "\" restric=\"" . $un->fil_confidencialidad . "\" class=\"view icon\" />'"; $json .= ",'" . addslashes($un->fon_cod . DELIMITER . $un->uni_cod . DELIMITER . $un->tco_codigo . DELIMITER . $un->ser_codigo . DELIMITER . $un->exp_codigo . DELIMITER . $un->fil_nro) . "'"; $json .= ",'" . addslashes($usuario->getRol($un->usu_id)) . "'"; $json .= ",'" . addslashes($un->fon_codigo) . "'"; $json .= ",'" . addslashes(utf8_decode($un->uni_descripcion)) . "'"; $json .= ",'" . addslashes(utf8_decode($un->ser_categoria)) . "'"; //$json .= ",'" . addslashes(utf8_decode($un->exp_titulo)) . "'"; //$json .= ",'" . addslashes(utf8_decode($un->cue_descripcion)) . "'"; if ($un->fil_subtitulo) { $json .= ",'" . addslashes(utf8_decode($un->fil_titulo . " - " . $un->fil_subtitulo)) . "'"; } else { $json .= ",'" . addslashes(utf8_decode($un->fil_titulo)) . "'"; } $json .= ",'" . addslashes($un->fil_tomovol) . "'"; $json .= ",'" . addslashes(utf8_decode($un->fil_proc)) . "'"; $json .= ",'" . addslashes(utf8_decode($un->fil_firma)) . "'"; $json .= ",'" . addslashes(utf8_decode($un->fil_cargo)) . "'"; $json .= ",'" . addslashes($un->fil_nrofoj) . "'"; $json .= ",'" . addslashes($un->fil_nrocaj) . "'"; $json .= ",'" . addslashes($un->fil_sala) . "'"; $json .= ",'" . addslashes($un->fil_estante) . "'"; $json .= ",'" . addslashes($un->fil_cuerpo) . "'"; $json .= ",'" . addslashes($un->fil_balda) . "'"; $json .= ",'" . addslashes($un->fil_tipoarch) . "'"; $json .= ",'" . addslashes($un->fil_mrb) . "'"; $json .= ",'" . addslashes($un->fil_ori) . "'"; $json .= ",'" . addslashes($un->fil_cop) . "'"; $json .= ",'" . addslashes($un->fil_fot) . "'"; //palabras clave $palclave = new palclave(); $fil_palclave = $palclave->listaPCFile($un->fil_id); $json .= ",'" . addslashes($fil_palclave) . "'"; $json .= ",'" . addslashes(utf8_decode($un->fil_obs)) . "'"; // SIACO $json .= ",'" . addslashes($un->fil_nur) . "'"; $json .= ",'" . addslashes(utf8_decode($un->fil_asunto)) . "'"; $json .= "]}"; $rc = true; $exp_titulo = $un->exp_titulo; } else { // Documento if ($rc) { $json .= ","; } $json .= "\n{"; $json .= "id:'" . $un->fil_id . "',"; $json .= "cell:['" . $un->fil_id . "'"; $json .= ",'<img src=\"" . PATH_DOMAIN . "/web/lib/32/document-{$un->fil_extension}.png\" file=\"{$un->fil_id}\" valueId=\"" . $un->fil_id . "\" restric=\"" . $un->fil_confidencialidad . "\" class=\"viewFile icon\" />'"; //$json .= ",'<img src=\"" . PATH_DOMAIN . "/web/lib/32/document-.png\" file=\"$un->fil_id\" valueId=\"" . $un->fil_id . "\" restric=\"" . $un->fil_confidencialidad . "\" class=\"viewFile icon\" />'"; $json .= ",'<img src=\"" . PATH_DOMAIN . "/web/lib/32/b_view.png\" file=\"{$un->fil_id}\" valueId=\"" . $un->fil_id . "\" restric=\"" . $un->fil_confidencialidad . "\" class=\"view icon\" />'"; $json .= ",'" . addslashes($un->fon_cod . DELIMITER . $un->uni_cod . DELIMITER . $un->tco_codigo . DELIMITER . $un->ser_codigo . DELIMITER . $un->exp_codigo . DELIMITER . $un->fil_nro) . "'"; $json .= ",'" . addslashes($usuario->getRol($un->usu_id)) . "'"; $json .= ",'" . addslashes($un->fon_codigo) . "'"; $json .= ",'" . addslashes(utf8_decode($un->uni_descripcion)) . "'"; $json .= ",'" . addslashes(utf8_decode($un->ser_categoria)) . "'"; //$json .= ",'" . addslashes(utf8_decode($un->exp_titulo)) . "'"; //$json .= ",'" . addslashes(utf8_decode($un->cue_descripcion)) . "'"; if ($un->fil_subtitulo) { $json .= ",'" . addslashes(utf8_decode($un->fil_titulo . " - " . $un->fil_subtitulo)) . "'"; } else { $json .= ",'" . addslashes(utf8_decode($un->fil_titulo)) . "'"; } $json .= ",'" . addslashes($un->fil_tomovol) . "'"; $json .= ",'" . addslashes(utf8_decode($un->fil_proc)) . "'"; $json .= ",'" . addslashes(utf8_decode($un->fil_firma)) . "'"; $json .= ",'" . addslashes(utf8_decode($un->fil_cargo)) . "'"; $json .= ",'" . addslashes($un->fil_nrofoj) . "'"; $json .= ",'" . addslashes($un->fil_nrocaj) . "'"; $json .= ",'" . addslashes($un->fil_sala) . "'"; $json .= ",'" . addslashes($un->fil_estante) . "'"; $json .= ",'" . addslashes($un->fil_cuerpo) . "'"; $json .= ",'" . addslashes($un->fil_balda) . "'"; $json .= ",'" . addslashes($un->fil_tipoarch) . "'"; $json .= ",'" . addslashes($un->fil_mrb) . "'"; $json .= ",'" . addslashes($un->fil_ori) . "'"; $json .= ",'" . addslashes($un->fil_cop) . "'"; $json .= ",'" . addslashes($un->fil_fot) . "'"; //palabras clave $palclave = new palclave(); $fil_palclave = $palclave->listaPCFile($un->fil_id); $json .= ",'" . addslashes($fil_palclave) . "'"; $json .= ",'" . addslashes(utf8_decode($un->fil_obs)) . "'"; // SIACO $json .= ",'" . addslashes($un->fil_nur) . "'"; $json .= ",'" . addslashes(utf8_decode($un->fil_asunto)) . "'"; $json .= "]}"; $rc = true; $exp_titulo = $un->exp_titulo; } } $json .= "]\n"; $json .= "}"; echo $json; }
function buscar($busquedaArray) { $valor = ""; $id_listar = ""; if (isset($_SESSION['id_lista'])) { $id_listar = $_SESSION['id_lista']; } $page = $busquedaArray['page']; $rp = $busquedaArray['rp']; $sortname = $busquedaArray['sortname']; $sortorder = $busquedaArray['sortorder']; if (isset($_SESSION['id_lista'])) { } $palabra = $busquedaArray['palabra']; $uni_id = $busquedaArray['uni_id']; $ser_id = $busquedaArray['ser_id']; $tra_id = $busquedaArray['tra_id']; $cue_id = $busquedaArray['cue_id']; $exp_titulo = $busquedaArray['exp_titulo']; $fil_nur = $busquedaArray['fil_nur']; $fil_titulo = $busquedaArray['fil_titulo']; $pac_nombre = $busquedaArray['pac_nombre']; $fil_subtitulo = $busquedaArray['fil_subtitulo']; $fil_proc = $busquedaArray['fil_proc']; $fil_firma = $busquedaArray['fil_firma']; $fil_cargo = $busquedaArray['fil_cargo']; $fil_tipoarch = $busquedaArray['fil_tipoarch']; // Search $archivo = new archivo(); $tarchivo = new tab_archivo(); $tarchivo->setRequest2Object($_REQUEST); $page = $_REQUEST['page']; $rp = $_REQUEST['rp']; $sortname = $_REQUEST['sortname']; $sortorder = $_REQUEST['sortorder']; if (!$sortname) { $sortname = 'fil_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 = ""; if ($query) { if ($qtype == 'fil_id') { $where = " WHERE {$qtype} = '{$query}' "; } else { $where = " WHERE {$qtype} LIKE '%{$query}%' "; } $sql = "SELECT *\r\n FROM tab_rol\r\n {$where} AND\r\n rol_estado = 1 {$sort} {$limit} "; } else { $sql = "SELECT *\r\n FROM tab_rol\r\n WHERE rol_estado = 1 {$sort} {$limit} "; } $usu_id = $_SESSION['USU_ID']; if ($_SESSION['ROL_COD'] != 'AA') { $whereUsuario = " AND tab_expusuario.usu_id=" . $_SESSION['USU_ID'] . ""; } // Search docs $select = "SELECT\r\n tab_expediente.exp_id,\r\n tab_archivo.fil_id,\r\n (SELECT fon_codigo from tab_fondo WHERE fon_id=f.fon_par) AS fon_codigo,\r\n tab_unidad.uni_descripcion,\r\n tab_series.ser_categoria,\r\n tab_expisadg.exp_titulo,\r\n f.fon_cod,\r\n tab_unidad.uni_cod,\r\n tab_tipocorr.tco_codigo,\r\n tab_series.ser_codigo,\r\n tab_expediente.exp_codigo,\r\n tab_cuerpos.cue_codigo,\r\n tab_archivo.fil_codigo,\r\n tab_archivo.fil_nro,\r\n tab_cuerpos.cue_descripcion,\r\n tab_archivo.fil_titulo,\r\n tab_archivo.fil_subtitulo,\r\n tab_archivo.fil_proc,\r\n tab_archivo.fil_firma,\r\n tab_archivo.fil_cargo,\r\n tab_archivo.fil_nrofoj,\r\n tab_archivo.fil_tomovol,\r\n tab_archivo.fil_nroejem,\r\n tab_archivo.fil_nrocaj,\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 tab_archivo.fil_tipoarch,\r\n tab_archivo.fil_mrb,\r\n tab_archivo.fil_ori,\r\n tab_archivo.fil_cop,\r\n tab_archivo.fil_fot,\r\n (CASE tab_exparchivo.exa_condicion\r\n WHEN '1' THEN 'DISPONIBLE'\r\n WHEN '2' THEN 'PRESTADO' END) AS disponibilidad,\r\n (SELECT fil_nomoriginal FROM tab_archivo_digital WHERE tab_archivo_digital.fil_id=tab_archivo.fil_id AND tab_archivo_digital.fil_estado = '1' ) AS fil_nomoriginal,\r\n (SELECT fil_extension FROM tab_archivo_digital WHERE tab_archivo_digital.fil_id=tab_archivo.fil_id AND tab_archivo_digital.fil_estado = '1' ) AS fil_extension,\r\n (SELECT fil_tamano/1048576 FROM tab_archivo_digital WHERE tab_archivo_digital.fil_id=tab_archivo.fil_id AND tab_archivo_digital.fil_estado = '1' ) AS fil_tamano,\r\n (SELECT fil_nur FROM tab_doccorr WHERE tab_doccorr.fil_id=tab_archivo.fil_id AND tab_doccorr.dco_estado = '1' ) AS fil_nur,\r\n (SELECT fil_asunto FROM tab_doccorr WHERE tab_doccorr.fil_id=tab_archivo.fil_id AND tab_doccorr.dco_estado = '1' ) AS fil_asunto,\r\n tab_archivo.fil_obs"; $from = "FROM\r\n tab_fondo as f\r\n INNER JOIN tab_unidad ON f.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_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_exparchivo ON tab_expediente.exp_id = tab_exparchivo.exp_id\r\n INNER JOIN tab_archivo ON tab_archivo.fil_id = tab_exparchivo.fil_id\r\n INNER JOIN tab_expisadg ON tab_expediente.exp_id = tab_expisadg.exp_id\r\n INNER JOIN tab_expusuario ON tab_expediente.exp_id = tab_expusuario.exp_id\r\n INNER JOIN tab_cuerpos ON tab_cuerpos.cue_id = tab_exparchivo.cue_id\r\n INNER JOIN tab_tramitecuerpos ON tab_cuerpos.cue_id = tab_tramitecuerpos.cue_id\r\n INNER JOIN tab_tramite ON tab_tramite.tra_id = tab_tramitecuerpos.tra_id\r\n WHERE\r\n f.fon_estado = 1 AND\r\n tab_unidad.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_archivo.fil_estado = 1 AND\r\n tab_exparchivo.exa_estado = 1 AND\r\n tab_expusuario.eus_estado = 1\r\n {$whereUsuario} "; $where = ""; if ($id_listar != "") { $explode = explode(",", $id_listar); $cantidad = count($explode); for ($i = 0; $i < $cantidad; $i++) { $valor .= "tab_archivo.fil_id<>" . $explode[$i]; if ($i < $cantidad - 1) { $valor .= " and "; } } $where .= " AND {$valor} "; } // Search all fields if (strlen($palabra)) { $where .= " AND (tab_expisadg.exp_titulo like '%{$palabra}%' "; $where .= " OR f.fon_descripcion like '%{$palabra}%' "; $where .= " OR tab_unidad.uni_descripcion like '%{$palabra}%' "; $where .= " OR tab_series.ser_categoria like '%{$palabra}%' "; $where .= " OR tab_archivo.fil_titulo like '%{$palabra}%' "; $where .= " OR tab_archivo.fil_subtitulo like '%{$palabra}%' "; $where .= " OR tab_archivo.fil_proc like '%{$palabra}%' "; $where .= " OR tab_archivo.fil_firma like '%{$palabra}%' "; $where .= " OR tab_archivo.fil_cargo like '%{$palabra}%' "; $where .= " OR tab_archivo.fil_tipoarch like '%{$palabra}%' "; $palclave = new palclave(); $ids = $palclave->listaPCSearchFile($palabra); if ($ids == "") { } else { $where .= " OR tab_archivo.fil_id IN ({$ids}) "; } $where .= " ) "; } if (strlen($uni_id) > 0 && $uni_id != 'null') { $where .= " AND tab_unidad.uni_id='{$uni_id}' "; } if (strlen($ser_id) > 0 && $ser_id != 'null') { $where .= " AND tab_series.ser_id='{$ser_id}' "; } if (strlen($tra_id) > 0 && $tra_id != 'null') { $where .= " AND tab_tramite.tra_id='{$tra_id}' "; } if (strlen($cue_id) > 0 && $cue_id != 'null') { $where .= " AND tab_cuerpos.cue_id='{$cue_id}' "; } if (strlen($exp_titulo)) { $where .= " AND tab_expisadg.exp_titulo like '%{$exp_titulo}%' "; } if (strlen($fil_titulo)) { $where .= " AND tab_archivo.fil_titulo like '%{$fil_titulo}%' "; } if (strlen($fil_subtitulo)) { $where .= " AND tab_archivo.fil_subtitulo like '%{$fil_subtitulo}%' "; } if (strlen($fil_proc)) { $where .= " AND tab_archivo.fil_proc like '%{$fil_proc}%' "; } if (strlen($fil_firma)) { $where .= " AND tab_archivo.fil_firma like '%{$fil_firma}%' "; } if (strlen($fil_cargo)) { $where .= " AND tab_archivo.fil_cargo like '%{$fil_cargo}%' "; } if (strlen($fil_tipoarch)) { $where .= " AND tab_archivo.fil_tipoarch like '%{$fil_tipoarch}%' "; } // Search addwords if (strlen($pac_nombre)) { $palclave = new palclave(); $ids = $palclave->listaPCSearchFile($pac_nombre); if ($ids == "") { } else { $where .= " AND tab_archivo.fil_id IN ({$ids}) "; } } // MODIFICADO $sort = "ORDER BY tab_expediente.exp_id, tab_cuerpos.cue_id, tab_archivo.fil_nro "; $sql = "{$select} {$from} {$where} {$sort} {$limit}"; $result = $tarchivo->dbSelectBySQL($sql); //print $sql; $sql_c = "SELECT COUNT(tab_archivo.fil_id) {$from} {$where} "; $total = $tarchivo->countBySQL($sql_c); $exp = new expediente(); 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; $j = 1; foreach ($result as $un) { if ($rc) { $json .= ","; } $json .= "\n{"; $json .= "id:'" . $un->fil_id . "',"; //$json .= "cell:['" . $un->fil_id . "'"; $json .= "cell:["; $json .= "'<input id=\"chkid_" . $un->fil_id . "\" restric=\"" . $un->fil_confidencialidad . "\" class=\"fil_chk" . $j . "\" type=\"checkbox\" value=\"" . $un->fil_id . "\" />'"; if ($un->fil_confidencialidad == 3) { $json .= ",'<img src=\"" . PATH_DOMAIN . "/web/lib/32/b_view.png\" file=\"{$un->fil_id}\" valueId=\"" . $un->fil_id . "\" restric=\"" . $un->fil_confidencialidad . "\" class=\"viewFileP icon\" />'"; } else { //$json .= ",'<img src=\"" . PATH_DOMAIN . "/web/lib/32/b_view.png\" file=\"$un->fil_id\" valueId=\"" . $un->fil_id . "\" restric=\"" . $un->fil_confidencialidad . "\" class=\"viewFile icon\" />'"; $json .= ",'<img src=\"" . PATH_DOMAIN . "/web/lib/32/document-{$un->fil_extension}.png\" file=\"{$un->fil_id}\" valueId=\"" . $un->fil_id . "\" restric=\"" . $un->fil_confidencialidad . "\" class=\"viewFile icon\" />'"; ///web/lib/32/document-". $una->fil_extension .".png' } if ($un->fil_confidencialidad == 3) { $json .= ",'<img src=\"" . PATH_DOMAIN . "/web/lib/32/b_view.png\" file=\"{$un->fil_id}\" valueId=\"" . $un->fil_id . "\" restric=\"" . $un->fil_confidencialidad . "\" class=\"viewP icon\" />'"; } else { //$json .= ",'<img src=\"" . PATH_DOMAIN . "/web/lib/32/b_view.png\" file=\"$un->fil_id\" valueId=\"" . $un->fil_id . "\" restric=\"" . $un->fil_confidencialidad . "\" class=\"viewFile icon\" />'"; $json .= ",'<img src=\"" . PATH_DOMAIN . "/web/lib/32/b_view.png\" file=\"{$un->fil_id}\" valueId=\"" . $un->fil_id . "\" restric=\"" . $un->fil_confidencialidad . "\" class=\"view icon\" />'"; ///web/lib/32/document-". $una->fil_extension .".png' } $json .= ",'" . $un->fil_id . "'"; $json .= ",'" . addslashes($un->fon_cod . DELIMITER . $un->uni_cod . DELIMITER . $un->tco_codigo . DELIMITER . $un->ser_codigo . DELIMITER . $un->exp_codigo . DELIMITER . $un->cue_codigo . DELIMITER . $un->fil_nro) . "'"; //$json .= ",'" . addslashes($un->fon_codigo) . "'"; $json .= ",'" . addslashes(utf8_decode($un->uni_descripcion)) . "'"; //$json .= ",'" . addslashes(utf8_decode($un->ser_categoria)) . "'"; $json .= ",'" . addslashes(utf8_decode($un->exp_titulo)) . "'"; //$json .= ",'" . addslashes(utf8_decode($un->cue_descripcion)) . "'"; if ($un->fil_subtitulo) { $json .= ",'" . addslashes(utf8_decode($un->fil_titulo . " - " . $un->fil_subtitulo)) . "'"; } else { $json .= ",'" . addslashes(utf8_decode($un->fil_titulo)) . "'"; } $json .= ",'" . addslashes($un->fil_tomovol) . "'"; $json .= ",'" . addslashes(utf8_decode($un->fil_proc)) . "'"; $json .= ",'" . addslashes(utf8_decode($un->fil_firma)) . "'"; $json .= ",'" . addslashes(utf8_decode($un->fil_cargo)) . "'"; $json .= ",'" . addslashes($un->fil_nrofoj) . "'"; $json .= ",'" . addslashes($un->fil_nrocaj) . "'"; $json .= ",'" . addslashes($un->fil_sala) . "'"; $json .= ",'" . addslashes($un->fil_estante) . "'"; $json .= ",'" . addslashes($un->fil_cuerpo) . "'"; $json .= ",'" . addslashes($un->fil_balda) . "'"; $json .= ",'" . addslashes($un->fil_tipoarch) . "'"; $json .= ",'" . addslashes($un->fil_mrb) . "'"; $json .= ",'" . addslashes($un->fil_ori) . "'"; $json .= ",'" . addslashes($un->fil_cop) . "'"; $json .= ",'" . addslashes($un->fil_fot) . "'"; //palabras clave $palclave = new palclave(); $fil_palclave = $palclave->listaPCFile($un->fil_id); $json .= ",'" . addslashes($fil_palclave) . "'"; $json .= ",'" . addslashes(utf8_decode($un->fil_obs)) . "'"; // SIACO $json .= ",'" . addslashes($un->fil_nur) . "'"; $json .= ",'" . addslashes(utf8_decode($un->fil_asunto)) . "'"; // DIGITAL //$json .= ",'" . addslashes($un->disponibilidad) . "'"; $json .= ",'" . addslashes(utf8_decode($un->fil_nomoriginal)) . "'"; $json .= ",'" . addslashes($un->fil_tamano) . "'"; $json .= "]}"; $rc = true; $i++; $j++; } $json .= "]\n"; $json .= "}"; echo $json; }
function verRpte() { set_time_limit(300); $series = new series(); $this->registry->template->seccion = $series->obtenerSeccion(); $this->registry->template->PATH_WEB = PATH_WEB; $this->registry->template->PATH_DOMAIN = PATH_DOMAIN; $this->registry->template->PATH_EVENT = "verRpte"; $filtro_seccion = $_POST['filtro_seccion']; $palclave = new palclave(); $usuario = new Tab_usuario(); $where = ""; $where .= " AND tab_usuario.usu_id ='" . $_SESSION['USU_ID'] . "' AND tab_usu_serie.usu_id='" . $_SESSION['USU_ID'] . "' "; $where .= " AND tab_unidad.uni_id = {$filtro_seccion}"; //PARA LA ORDENACION SOLO SE ESCOJE UNA OPCION $order_by = ""; $order_by .= " ORDER BY tab_expediente.exp_id "; //PARA LOS FILTROS $sqlh = "SELECT\r\nfonp.fon_descripcion AS fondes,\r\ntab_expediente.exp_id,\r\ntab_fondo.fon_cod,\r\ntab_unidad.uni_descripcion,\r\ntab_unidad.uni_cod,\r\ntab_unidad.uni_id,\r\ntab_tipoarch.tar_nombre,\r\ntab_tipocorr.tco_codigo,\r\ntab_series.ser_id,\r\ntab_series.ser_par,\r\ntab_series.ser_codigo,\r\n(NULLIF(tab_expediente.exp_codigo,'')::int) as correlativo,\r\ntab_expediente.exp_codigo,\r\ntab_expediente.exp_tomovol,\r\ntab_expediente.exp_nrocaj,\r\ntab_expediente.exp_nrofoj,\r\ntab_expediente.exp_sala,\r\ntab_expediente.exp_estante,\r\ntab_expediente.exp_cuerpo,\r\ntab_expediente.exp_balda,\r\ntab_expediente.exp_obs,\r\ntab_usuario.usu_nombres,\r\ntab_usuario.usu_apellidos,\r\ntab_expisadg.exp_titulo,\r\ntab_expisadg.exp_anioi,\r\ntab_expisadg.exp_aniof,\r\ntab_expisadg.exp_fecha_exi,\r\ntab_expisadg.exp_notas,\r\ntab_expisadg.exp_id,\r\ntab_expisadg.exp_alccon,\r\ntab_expisadg.exp_nomprod,\r\ntab_expfondo.fon_id, \r\ntab_series.ser_id,\r\ntab_usu_serie.usu_id,\r\ntab_unidad.uni_par,\r\ntab_unidad.uni_id,\r\ntab_fondo.fon_descripcion,\r\ntab_series.ser_categoria\r\nFROM\r\n tab_usuario\r\n INNER JOIN tab_expusuario ON tab_usuario.usu_id = tab_expusuario.usu_id\r\n INNER JOIN tab_expediente ON tab_expusuario.exp_id = tab_expediente.exp_id\r\n INNER JOIN tab_expfondo ON tab_expediente.exp_id = tab_expfondo.exp_id\r\n INNER JOIN tab_series ON tab_expediente.ser_id = tab_series.ser_id\r\n INNER JOIN tab_usu_serie ON tab_series.ser_id = tab_usu_serie.ser_id\r\n INNER JOIN tab_expisadg ON tab_expediente.exp_id = tab_expisadg.exp_id\r\n INNER JOIN tab_unidad ON tab_unidad.uni_id = tab_series.uni_id\r\n INNER JOIN tab_tipoarch ON tab_tipoarch.tar_id = tab_unidad.tar_id\r\n INNER JOIN tab_fondo ON tab_fondo.fon_id = tab_unidad.fon_id\r\n INNER JOIN tab_tipocorr ON tab_tipocorr.tco_id = tab_series.tco_id\r\n INNER JOIN tab_fondo as fonp ON tab_fondo.fon_par = fonp.fon_id\r\n WHERE tab_fondo.fon_estado = 1\r\n AND tab_unidad.uni_estado = 1\r\n AND tab_series.ser_estado = 1\r\n AND tab_tipocorr.tco_estado = 1\r\n AND tab_expediente.exp_estado = 1\r\n AND tab_expisadg.exp_estado = 1\r\n AND tab_expfondo.exf_estado = 1\r\n AND tab_expusuario.eus_estado = 1 " . $where . "order by correlativo"; $expedienteh = new Tab_expediente(); $resulth = $expedienteh->dbselectBySQL($sqlh); $cadenah = ""; $exp_titulo = ""; if (count($resulth) > 0) { $sumar = 0; $piezas = 0; $cadenah .= '<table width="100%" border="0" cellpadding="2">'; $cadenah .= '</table>'; $cadenah .= '<br/><br/>'; } $cadena = ""; $cadena .= '<table width="100%" border="1" cellpadding="2">'; $cadena .= '<tr bgcolor="#CCCCCC">'; $cadena .= '<td width="15" align="center"><span style="font-size: 7px;font-weight: bolder;">ACCIÓN</span></td>'; $cadena .= '<td colspan="11" align="center" width="700"><span style="font-size: 10px;font-weight: bolder;">ÁREA DE IDENTIFICACIÓN</span></td>'; $cadena .= '<td width="60" align="center"><span style="font-size: 10px;font-weight: bolder;">ÁREA DE NOTAS</span></td>'; $cadena .= '</tr>'; $cadena .= '<tr bgcolor="#CCCCCC">'; $cadena .= '<td width="15" align="center" valign="middle"><span style="font-size: 10px ;font-weight: bold;"></span></td>'; $cadena .= '<td width="65" align="center"><span style="font-size: 10px ;font-weight: bold;">Código</span></td>'; $cadena .= '<td width="200" align="center" valign="middle"><span style="font-size: 10px ;font-weight: bold;">Titulo/Subtitulo</span></td>'; $cadena .= '<td width="65" align="center" valign="middle"><span style="font-size: 10px ;font-weight: bold;">Fechas Extremas</span></td>'; $cadena .= '<td width="45" align="center" valign="middle"><span style="font-size: 10px ;font-weight: bold;">Tomo/V</span></td>'; $cadena .= '<td width="45" align="center" valign="middle"><span style="font-size: 10px ;font-weight: bold;">Responsable/<br>Productor</span></td>'; $cadena .= '<td width="20" align="center" valign="middle"><span style="font-size: 10px ;font-weight: bold;">Nro Fojas</span></td>'; $cadena .= '<td width="25" align="center" valign="middle"><span style="font-size: 10px ;font-weight: bold;">Caja</span></td>'; $cadena .= '<td width="25" align="center" valign="middle"><span style="font-size: 10px ;font-weight: bold;">Sala</span></td>'; $cadena .= '<td width="30" align="center" valign="middle"><span style="font-size: 10px ;font-weight: bold;">Estante</span></td>'; $cadena .= '<td width="30" align="center" valign="middle"><span style="font-size: 10px ;font-weight: bold;">Cuerpo</span></td>'; $cadena .= '<td width="30" align="center" valign="middle"><span style="font-size: 10px ;font-weight: bold;">Balda</span></td>'; $cadena .= '<td width="200" align="center" valign="middle"><span style="font-size: 10px ;font-weight: bold;">Observaciones</span></td>'; $cadena .= '</tr>'; $i = 1; $j = 1; foreach ($resulth as $rows) { $cadena .= '<tr >'; $cadena .= '<td colspan="11"><b>Serie/Subserie:</b> ' . $rows->ser_categoria . '</td>'; $cadena .= '</tr>'; $cadena .= '<tr>'; $cadena .= '<td colspan="11"><span id="text-tituloexp' . $j . '"><b>Expediente:</b> ' . $rows->exp_titulo . '</span><input type="text" id="tituloexp' . $j . '" value="' . $rows->exp_titulo . '" style="display:none" size="110"></td>'; $cadena .= '</tr>'; $cadena .= '<tr style="color:green">'; $cadena .= '<td><input type="image" src="' . PATH_DOMAIN . '/web/lib/32/edit.png" width="28" id="editarexp' . $j . '" alt="Editar" onclick="editarexp(' . $j . ')" ><input type="image" src="' . PATH_DOMAIN . '/web/lib/32/disk2.png" id="guardarexp' . $j . '" onclick="guardarexpedientes(' . $j . ',' . $rows->exp_id . ')" style="display:none" ></td>'; $cadena .= '<td style="font-size:10px"><b>' . $rows->fon_cod . DELIMITER . $rows->uni_cod . DELIMITER . $rows->tco_codigo . DELIMITER . $rows->ser_codigo . DELIMITER . $rows->exp_codigo . '</b></td>'; $cadena .= '<td style="font-size:10px"><span id="text-contenidoexp' . $j . '"><b>Alcance y contenido:</b><br>' . trim($rows->exp_alccon) . '<br><b>Área de Notas:</b><br>' . trim($rows->exp_notas) . '</span><textarea cols="40" rows="3" style="display:none" id="alconexp' . $j . '">' . $rows->exp_alccon . '</textarea><textarea cols="40" rows="3" style="display:none" id="notasexp' . $j . '">' . $rows->exp_notas . '</textarea></td>'; $cadena .= '<td style="font-size:10px"><span id="text-fechaexp' . $j . '"><b>' . $rows->exp_anioi . ' - ' . $rows->exp_aniof . '</b></span><input type="text" size="3" id="exp_anioi' . $j . '" style="display:none" value="' . $rows->exp_anioi . '"><input type="text" size="3" id="exp_aniof' . $j . '" style="display:none" value="' . $rows->exp_aniof . '"></td>'; $cadena .= '<td style="font-size:10px"><span id="text-tomovolexp' . $j . '"><b>' . $rows->exp_tomovol . '</b></span><input type="text" size="3" id="tomovolexp' . $j . '" style="display:none" value="' . $rows->exp_tomovol . '"></td>'; $cadena .= '<td style="font-size:10px"><span id="text-productorexp' . $j . '"><b>' . $rows->exp_nomprod . '</b></span><input type="text" size="25" id="productorexp' . $j . '" style="display:none" value="' . $rows->exp_nomprod . '"></td>'; $cadena .= '<td style="font-size:10px"><span id="text-nrofojasexp' . $j . '"><b>' . $rows->exp_nrofoj . '</b></span><input type="text" size="4" id="nrofojasexp' . $j . '" style="display:none" value="' . $rows->exp_nrofoj . '"></td>'; $cadena .= '<td style="font-size:10px"><span id="text-nrocajexp' . $j . '"><b>' . $rows->exp_nrocaj . '</b></span><input type="text" size="3" id="nrocajexp' . $j . '" style="display:none" value="' . $rows->exp_nrocaj . '"></td>'; $cadena .= '<td style="font-size:10px"><span id="text-salaexp' . $j . '"><b>' . $rows->exp_sala . '</b></span><input type="text" size="3" id="salaexp' . $j . '" style="display:none" value="' . $rows->exp_sala . '"></td>'; $cadena .= '<td style="font-size:10px"><span id="text-estanteexp' . $j . '"><b>' . $rows->exp_estante . '</b></span><input type="text" size="3" id="estanteexp' . $j . '" style="display:none" value="' . $rows->exp_estante . '"></td>'; $cadena .= '<td style="font-size:10px"><span id="text-cuerpoexp' . $j . '"><b>' . $rows->exp_cuerpo . '</b></span><input type="text" size="3" id="cuerpoexp' . $j . '" style="display:none" value="' . $rows->exp_cuerpo . '"></td>'; $cadena .= '<td style="font-size:10px"><span id="text-baldaexp' . $j . '"><b>' . $rows->exp_balda . '</b></span><input type="text" size="3" id="baldaexp' . $j . '" style="display:none" value="' . $rows->exp_balda . '"></td>'; $cadena .= '<td style="font-size:10px"><span id="text-obsexp' . $j . '"><b>' . trim($rows->exp_obs) . '</b></span><textarea cols="40" rows="3" style="display:none" id="obsexp' . $j . '">' . trim($rows->exp_obs) . '</textarea></td>'; $cadena .= '</tr>'; $j++; $sql_doc = "SELECT\r\ntab_expediente.exp_id,\r\ntab_tipocorr.tco_codigo,\r\ntab_series.ser_id,\r\ntab_series.ser_codigo,\r\ntab_expediente.exp_codigo,\r\ntab_usuario.usu_nombres,\r\ntab_usuario.usu_apellidos,\r\ntab_expisadg.exp_titulo,\r\ntab_expisadg.exp_anioi,\r\ntab_expisadg.exp_aniof,\r\ntab_expisadg.exp_fecha_exi,\r\ntab_expfondo.fon_id,\r\ntab_series.ser_id,\r\ntab_usu_serie.usu_id,\r\ntab_unidad.uni_par,\r\ntab_unidad.uni_id,\r\ntab_fondo.fon_descripcion,\r\ntab_series.ser_categoria,\r\ntab_archivo.fil_subtitulo,\r\ntab_archivo.fil_nro,\r\ntab_archivo.fil_id,\r\ntab_archivo.fil_nropaq,\r\ntab_archivo.fil_titulo,\r\nfonp.fon_cod,\r\ntab_unidad.uni_cod,\r\ntab_archivo.fil_tomovol,\r\n(SELECT\r\ntab_sopfisico.sof_nombre\r\nFROM\r\ntab_sopfisico\r\nwhere tab_sopfisico.sof_id=tab_archivo.sof_id) AS cuaderno,\r\ntab_archivo.fil_nrocaj,\r\ntab_archivo.fil_sala,\r\ntab_archivo.fil_estante,\r\ntab_archivo.fil_cuerpo,\r\ntab_archivo.fil_balda,\r\ntab_archivo.fil_obs,\r\ntab_archivo.fil_proc,\r\ntab_archivo.fil_alccon,\r\ntab_archivo.fil_firma,\r\ntab_archivo.fil_nrofoj,\r\ntab_archivo.fil_anio,\r\ntab_archivo.fil_cantpaq,\r\ntab_archivo.fil_aniof\r\nFROM\r\ntab_usuario\r\nINNER JOIN tab_expusuario ON tab_usuario.usu_id = tab_expusuario.usu_id\r\nINNER JOIN tab_expediente ON tab_expusuario.exp_id = tab_expediente.exp_id\r\nINNER JOIN tab_expfondo ON tab_expediente.exp_id = tab_expfondo.exp_id\r\nINNER JOIN tab_series ON tab_expediente.ser_id = tab_series.ser_id\r\nINNER JOIN tab_usu_serie ON tab_series.ser_id = tab_usu_serie.ser_id\r\nINNER JOIN tab_expisadg ON tab_expediente.exp_id = tab_expisadg.exp_id\r\nINNER JOIN tab_unidad ON tab_unidad.uni_id = tab_series.uni_id\r\nINNER JOIN tab_tipoarch ON tab_tipoarch.tar_id = tab_unidad.tar_id\r\nINNER JOIN tab_fondo ON tab_fondo.fon_id = tab_unidad.fon_id\r\nINNER JOIN tab_tipocorr ON tab_tipocorr.tco_id = tab_series.tco_id\r\nINNER JOIN tab_fondo AS fonp ON tab_fondo.fon_par = fonp.fon_id\r\nINNER JOIN tab_exparchivo ON tab_exparchivo.exp_id = tab_expediente.exp_id\r\nINNER JOIN tab_archivo ON tab_exparchivo.fil_id = tab_archivo.fil_id\r\nWHERE\r\ntab_fondo.fon_estado = 1 AND\r\ntab_unidad.uni_estado = 1 AND\r\ntab_series.ser_estado = 1 AND\r\ntab_tipocorr.tco_estado = 1 AND\r\ntab_archivo.fil_estado = 1 AND\r\ntab_expediente.exp_estado = 1 AND\r\ntab_expisadg.exp_estado = 1 AND\r\ntab_expfondo.exf_estado = 1 AND\r\ntab_expusuario.eus_estado = 1 and tab_expediente.exp_id={$rows->exp_id} {$where} order by tab_archivo.fil_nro"; $rows2 = $usuario->dbSelectBySQL($sql_doc); foreach ($rows2 as $row) { $cadena .= '<tr style="color:#006699">'; $cadena .= '<td><input type="image" src="' . PATH_DOMAIN . '/web/lib/32/edit.png" width="28" id="editar' . $i . '" alt="Editar" onclick="editar(' . $i . ')" ><input type="image" src="' . PATH_DOMAIN . '/web/lib/32/disk2.png" id="guardar' . $i . '" onclick="guardar(' . $i . ',' . $row->fil_id . ')" style="display:none" ></td>'; $cadena .= '<td width="65" align="center"><span style="font-size: 10px ;font-weight: bold;">' . $row->fon_cod . DELIMITER . $row->uni_cod . DELIMITER . $row->tco_codigo . DELIMITER . $row->ser_codigo . DELIMITER . $row->exp_codigo . DELIMITER . $row->fil_nro . '</span></td>'; $cadena .= '<td width="200"style="font-size: 10px ;font-weight: bold;" ><span id="text-titulo' . $i . '">' . $row->fil_titulo . ' - ' . $row->fil_subtitulo . '</span><input type="text" size="25" id="titulo' . $i . '" style="display:none" value="' . $row->fil_titulo . '"><input type="text" size="25" id="subtitulo' . $i . '" style="display:none" value="' . $row->fil_subtitulo . '"><br><span id="text-alccon' . $i . '"><b>Alcance y contenido:</b><br>' . $row->fil_alccon . '</span><textarea cols="40" rows="3" style="display:none" id="alccon' . $i . '">' . $row->fil_alccon . '</textarea></td>'; $cadena .= '<td width="65" align="center" valign="middle"><span style="font-size: 10px ;font-weight: bold;" id="text-fecha' . $i . '">' . $row->fil_anio . ' - ' . $row->fil_aniof . '</span><input type="text" size="3" id="fechai' . $i . '" style="display:none" value="' . $row->fil_anio . '"><input type="text" size="3" id="fechaf' . $i . '" style="display:none" value="' . $row->fil_aniof . '"></td>'; $cadena .= '<td width="45" align="center" valign="middle"><span style="font-size: 10px ;font-weight: bold;" id="text-tomovol' . $i . '">' . $row->fil_tomovol . '</span><input type="text" size="3" id="tomovol' . $i . '" style="display:none" value="' . $row->fil_tomovol . '"></td>'; $cadena .= '<td style="font-size:10px"><span style="font-size: 10px ;font-weight: bold;" id="text-resproc' . $i . '"><b>Responsable:</b><br>' . $row->fil_firma . '<br><b>Productor:</b><br>' . $row->fil_proc . '</span><input type="text" size="25" id="responsable' . $i . '" style="display:none" value="' . $row->fil_firma . '"><br><input type="text" size="25" id="productor' . $i . '" style="display:none" value="' . $row->fil_proc . '"></td>'; $cadena .= '<td width="45" align="center" valign="middle"><span style="font-size: 10px ;font-weight: bold;" id="text-nrofojas' . $i . '">' . $row->fil_nrofoj . '</span><input type="text" size="3" id="nrofojas' . $i . '" style="display:none" value="' . $row->fil_nrofoj . '"></td>'; $cadena .= '<td width="25" align="center" valign="middle"><span style="font-size: 10px ;font-weight: bold;" id="text-nrocaj' . $i . '">' . $row->fil_nrocaj . '</span><input type="text" size="3" id="nrocaj' . $i . '" style="display:none" value="' . $row->fil_nrocaj . '"></td>'; $cadena .= '<td width="25" align="center" valign="middle"><span style="font-size: 10px ;font-weight: bold;" id="text-sala' . $i . '">' . $row->fil_sala . '</span><input type="text" size="3" id="sala' . $i . '" style="display:none" value="' . $row->fil_sala . '"></td>'; $cadena .= '<td width="30" align="center" valign="middle"><span style="font-size: 10px ;font-weight: bold;" id="text-estante' . $i . '">' . $row->fil_estante . '</span><input type="text" size="3" id="estante' . $i . '" style="display:none" value="' . $row->fil_estante . '"></td>'; $cadena .= '<td width="30" align="center" valign="middle"><span style="font-size: 10px ;font-weight: bold;" id="text-cuerpo' . $i . '">' . $row->fil_cuerpo . '</span><input type="text" size="3" id="cuerpo' . $i . '" style="display:none" value="' . $row->fil_cuerpo . '"></td>'; $cadena .= '<td width="30" align="center" valign="middle"><span style="font-size: 10px ;font-weight: bold;" id="text-balda' . $i . '">' . $row->fil_balda . '</span><input type="text" size="3" id="balda' . $i . '" style="display:none" value="' . $row->fil_balda . '"></td>'; $cadena .= '<td width="200" ><span style="font-size: 10px ;font-weight: bold;" id="text-obs' . $i . '">' . trim($row->fil_obs) . '</span><textarea cols="40" rows="3" style="display:none" id="obs' . $i . '">' . $row->fil_obs . '</textarea></td>'; $cadena .= '</tr>'; $cadena .= '<tr style="color:#006699">'; $cadena .= '<td colspan="13" style="font-size: 10px ;font-weight: bold;"><span id="text-palclaves' . $i . '">Palabras Claves:'; $fil_descripcion = $palclave->listaPCFile($row->fil_id); $cadena .= " " . $fil_descripcion; $cadena .= '</span> <input type="text" id="palclaves' . $i . '" value="' . $fil_descripcion . '" style="display:none" size="120" autocomplete="off" maxlength="2050"/> <br> <b>Nro. paquetes: </b><span id="text-nropaq' . $i . '"> ' . $row->fil_nropaq . '</span> <input type="text" id="nropaq' . $i . '" value="' . $row->fil_nropaq . '" style="display:none;color:black" size="15"/> <BR><b>Paquetes A-B.. : </b><span id="text-cantpaq' . $i . '"> ' . trim($row->fil_cantpaq) . '</span> <input type="text" id="cantpaq' . $i . '" value="' . trim($row->fil_cantpaq) . '" style="display:none;color:black" size="15"/> </td>'; $cadena .= '</tr>'; $i++; } } //obtenerSelectCamposRepC $cadena .= '</table>'; $cadena = "{$cadenah} {$cadena}"; $this->registry->template->contenido = $cadena; $this->registry->template->show('tab_editSeccion.tpl'); $this->registry->template->show('footer'); // $pdf->writeHTML($cadena, true, false, false, false, ''); // // // ----------------------------------------------------------------------------- // //Close and output PDF document // $pdf->Output('reporte_inventario.pdf', 'I'); }
function loadDoc() { // Search $usuario = new usuario(); $tarchivo = new tab_archivo(); $tarchivo->setRequest2Object($_REQUEST); // Hasta aqui $valor = ""; $id_listar = ""; if (isset($_SESSION['id_lista'])) { $id_listar = $_SESSION['id_lista']; } $page = $_REQUEST['page']; $rp = $_REQUEST['rp']; $sortname = $_REQUEST['sortname']; $sortorder = $_REQUEST['sortorder']; if (!$sortname) { $sortname = " f.fon_cod,\r\n tab_unidad.uni_cod,\r\n tab_series.ser_orden,\r\n tab_series.ser_codigo,\r\n tab_expediente.exp_codigo::int,\r\n tab_archivo.fil_nro::int "; } else { $sortname = $sortname; } if (!$sortorder) { $sortorder = 'desc'; } $sort = "ORDER BY {$sortname} {$sortorder}"; if (!$page) { $page = 1; } if (!$rp) { $rp = 20; } $start = ($page - 1) * $rp; $limit = "LIMIT {$rp} OFFSET {$start} "; $query = $_REQUEST['query']; $qtype = $_REQUEST['qtype']; $where = ""; if ($query) { if ($qtype) { } } $whereUsuario = ""; $usu_id = $_SESSION['USU_ID']; if ($_SESSION['ROL_COD'] != 'AA') { $whereUsuario = " AND tab_expusuario.usu_id=" . $_SESSION['USU_ID'] . ""; } // Search docs $select = "SELECT\r\n tab_expediente.exp_id,\r\n tab_archivo.fil_id,\r\n f.fon_codigo,\r\n f.fon_cod,\r\n tab_unidad.uni_cod,\r\n tab_tipocorr.tco_codigo,\r\n tab_series.ser_codigo,\r\n tab_expediente.exp_codigo,\r\n tab_archivo.fil_nro,\r\n tab_unidad.uni_descripcion,\r\n tab_series.ser_categoria,\r\n tab_expisadg.exp_titulo,\r\n tab_cuerpos.cue_descripcion,\r\n tab_archivo.fil_confidencialidad,\r\n tab_archivo.fil_titulo,\r\n tab_archivo.fil_subtitulo,\r\n tab_archivo.fil_proc,\r\n tab_archivo.fil_firma,\r\n tab_archivo.fil_cargo,\r\n tab_archivo.fil_nrofoj,\r\n tab_archivo.fil_tomovol,\r\n tab_archivo.fil_nroejem,\r\n tab_archivo.fil_nrocaj,\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 tab_archivo.fil_tipoarch,\r\n tab_archivo.fil_mrb,\r\n tab_archivo.fil_ori,\r\n tab_archivo.fil_cop,\r\n tab_archivo.fil_fot,\r\n (SELECT fil_nur FROM tab_doccorr WHERE tab_doccorr.fil_id=tab_archivo.fil_id AND tab_doccorr.dco_estado = '1' ) AS fil_nur,\r\n (SELECT fil_asunto FROM tab_doccorr WHERE tab_doccorr.fil_id=tab_archivo.fil_id AND tab_doccorr.dco_estado = '1' ) AS fil_asunto,\r\n tab_archivo.fil_obs,\r\n tab_expusuario.usu_id"; $from = "FROM\r\n tab_fondo as f\r\n INNER JOIN tab_unidad ON f.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_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_expediente.exp_id = tab_expisadg.exp_id\r\n INNER JOIN tab_expusuario ON tab_expediente.exp_id = tab_expusuario.exp_id\r\n LEFT JOIN tab_exparchivo ON tab_expediente.exp_id = tab_exparchivo.exp_id\r\n INNER JOIN tab_archivo ON tab_archivo.fil_id = tab_exparchivo.fil_id\r\n INNER JOIN tab_cuerpos ON tab_cuerpos.cue_id = tab_exparchivo.cue_id\r\n INNER JOIN tab_tramitecuerpos ON tab_cuerpos.cue_id = tab_tramitecuerpos.cue_id\r\n INNER JOIN tab_tramite ON tab_tramite.tra_id = tab_tramitecuerpos.tra_id\r\n WHERE\r\n f.fon_estado = 1 AND\r\n tab_unidad.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_archivo.fil_estado = 1 AND\r\n tab_exparchivo.exa_estado = 1 AND\r\n tab_expusuario.eus_estado = 1\r\n {$whereUsuario} "; $where = ""; // Search addwords if ($id_listar != "") { $explode = explode(",", $id_listar); $cantidad = count($explode); if ($cantidad > 0) { $valor .= "tab_archivo.fil_id=0 OR "; for ($i = 0; $i < $cantidad; $i++) { $valor .= "tab_archivo.fil_id=" . $explode[$i]; if ($i < $cantidad - 1) { $valor .= " or "; } } } $where .= " AND {$valor} "; } // MODIFICADO //$sort = "ORDER BY tab_expediente.exp_id, tab_cuerpos.cue_id, tab_archivo.fil_nro "; //$sort = "ORDER BY tab_series.ser_orden, tab_expediente.exp_codigo::int, tab_archivo.fil_nro::int "; $sql = "{$select} {$from} {$where} {$sort} {$limit}"; $result = $tarchivo->dbSelectBySQL($sql); //print $sql; $sql_c = "SELECT COUNT(tab_archivo.fil_id) {$from} {$where} "; $total = $tarchivo->countBySQL($sql_c); $exp = new expediente(); 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; $j = 1; $exp_titulo = ""; foreach ($result as $un) { // Documento if ($rc) { $json .= ","; } $json .= "\n{"; $json .= "id:'" . $un->fil_id . "',"; $json .= "cell:["; $json .= "'<input id=\"chkid_" . $un->fil_id . "\" restric=\"" . $un->fil_confidencialidad . "\" class=\"fil_chk" . $j . "\" type=\"checkbox\" value=\"" . $un->fil_id . "\" checked=\"checked\" />'"; // $json .= ",'<img src=\"" . PATH_DOMAIN . "/web/lib/32/document-$un->fil_extension.png\" file=\"$un->fil_id\" valueId=\"" . $un->fil_id . "\" restric=\"" . $un->fil_confidencialidad . "\" class=\"viewFile icon\" />'"; $json .= ",'<img src=\"" . PATH_DOMAIN . "/web/lib/32/document-.png\" file=\"{$un->fil_id}\" valueId=\"" . $un->fil_id . "\" restric=\"" . $un->fil_confidencialidad . "\" class=\"viewFile icon\" />'"; $json .= ",'<img src=\"" . PATH_DOMAIN . "/web/lib/32/b_view.png\" file=\"{$un->fil_id}\" valueId=\"" . $un->fil_id . "\" restric=\"" . $un->fil_confidencialidad . "\" class=\"view icon\" />'"; $json .= ",'" . $un->fil_id . "'"; $json .= ",'" . addslashes($un->fon_cod . DELIMITER . $un->uni_cod . DELIMITER . $un->tco_codigo . DELIMITER . $un->ser_codigo . DELIMITER . $un->exp_codigo . DELIMITER . $un->fil_nro) . "'"; $json .= ",'" . addslashes($usuario->getRol($un->usu_id)) . "'"; $json .= ",'" . addslashes($un->fon_codigo) . "'"; $json .= ",'" . addslashes(utf8_decode($un->uni_descripcion)) . "'"; $json .= ",'" . addslashes(utf8_decode($un->ser_categoria)) . "'"; $json .= ",'" . addslashes(utf8_decode($un->exp_titulo)) . "'"; //$json .= ",'" . addslashes(utf8_decode($un->cue_descripcion)) . "'"; if ($un->fil_subtitulo) { $json .= ",'" . addslashes(utf8_decode($un->fil_titulo . " - " . $un->fil_subtitulo)) . "'"; } else { $json .= ",'" . addslashes(utf8_decode($un->fil_titulo)) . "'"; } $json .= ",'" . addslashes($un->fil_tomovol) . "'"; $json .= ",'" . addslashes(utf8_decode($un->fil_proc)) . "'"; $json .= ",'" . addslashes(utf8_decode($un->fil_firma)) . "'"; $json .= ",'" . addslashes(utf8_decode($un->fil_cargo)) . "'"; $json .= ",'" . addslashes($un->fil_nrofoj) . "'"; $json .= ",'" . addslashes($un->fil_nrocaj) . "'"; $json .= ",'" . addslashes($un->fil_sala) . "'"; $json .= ",'" . addslashes($un->fil_estante) . "'"; $json .= ",'" . addslashes($un->fil_cuerpo) . "'"; $json .= ",'" . addslashes($un->fil_balda) . "'"; $json .= ",'" . addslashes($un->fil_tipoarch) . "'"; $json .= ",'" . addslashes($un->fil_mrb) . "'"; $json .= ",'" . addslashes($un->fil_ori) . "'"; $json .= ",'" . addslashes($un->fil_cop) . "'"; $json .= ",'" . addslashes($un->fil_fot) . "'"; //palabras clave $palclave = new palclave(); $fil_palclave = $palclave->listaPCFile($un->fil_id); $json .= ",'" . addslashes($fil_palclave) . "'"; $json .= ",'" . addslashes(utf8_decode($un->fil_obs)) . "'"; // SIACO $json .= ",'" . addslashes($un->fil_nur) . "'"; $json .= ",'" . addslashes(utf8_decode($un->fil_asunto)) . "'"; $json .= "]}"; $rc = true; $i++; $j++; } $json .= "]\n"; $json .= "}"; echo $json; }
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'); }