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 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 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 printFichaSearchExpediente() { $exp_id = VAR3; $dov_id = VAR4; $where = ""; // if ($_SESSION['ROL_COD'] != 'AA') { // $where = " AND tab_expusuario.usu_id=" . $_SESSION['USU_ID'] . ""; // } $tarchivo = new tab_archivo(); $select = "SELECT\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_id,\r\n tab_series.ser_codigo,\r\n tab_expediente.exp_id,\r\n tab_expediente.exp_codigo,\r\n tab_expisadg.exp_fecha_exi,\r\n tab_expisadg.exp_fecha_exf,\r\n tab_expisadg.exp_nivdes,\r\n tab_expisadg.exp_volsop,\r\n tab_expisadg.exp_nomprod,\r\n tab_expisadg.exp_hisins,\r\n tab_expisadg.exp_hisarc,\r\n tab_expisadg.exp_foring,\r\n tab_expisadg.exp_alccon,\r\n tab_expisadg.exp_vaseel,\r\n tab_expisadg.exp_nueing,\r\n tab_expisadg.exp_org,\r\n tab_expisadg.exp_conacc,\r\n tab_expisadg.exp_conrep,\r\n tab_expisadg.exp_lengua,\r\n tab_expisadg.exp_carfis,\r\n tab_expisadg.exp_insdes,\r\n tab_expisadg.exp_exloor,\r\n tab_expisadg.exp_exloco,\r\n tab_expisadg.exp_underel,\r\n tab_expisadg.exp_notpub,\r\n tab_expisadg.exp_notas,\r\n tab_expisadg.exp_notarc,\r\n tab_expisadg.exp_regnor,\r\n tab_expisadg.exp_fecdes,\r\n tab_expisadg.exp_estado,\r\n tab_expisadg.exp_mesi,\r\n tab_expisadg.exp_anioi,\r\n tab_expisadg.exp_mesf,\r\n tab_expisadg.exp_aniof,\r\n tab_expediente.sof_id,\r\n tab_expediente.exp_nrofoj,\r\n tab_expediente.exp_tomovol,\r\n tab_expediente.exp_nroejem,\r\n tab_expediente.exp_nrocaj,\r\n tab_expediente.exp_sala,\r\n tab_expediente.exp_estante,\r\n tab_expediente.exp_cuerpo,\r\n tab_expediente.exp_balda,\r\n tab_expediente.exp_obs,\r\n tab_expediente.exp_estado,\r\n tab_expisadg.idi_id,\r\n tab_expediente.exp_ori,\r\n tab_expediente.exp_cop,\r\n tab_expediente.exp_fot,\r\n tab_expediente.exp_lugar"; $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 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_expusuario.eus_estado = 1 AND\r\n tab_expediente.exp_id = '{$exp_id}'\r\n {$where} "; $sql = "{$select} {$from} "; $result = $tarchivo->dbSelectBySQL($sql); //print $sql; $this->usuario = new usuario(); // PDF // Landscape require_once 'tcpdf/config/lang/eng.php'; require_once 'tcpdf/tcpdf.php'; $pdf = new TCPDF('P', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $pdf->setFontSubsetting(FALSE); $pdf->SetAuthor($this->usuario->obtenerNombre($_SESSION['USU_ID'])); $pdf->SetTitle('Reporte Ficha del Expediente'); $pdf->SetSubject('Reporte Ficha del Expediente'); $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); // aumentado $pdf->SetKeywords('Castellon, SISTEMA DE PASAJES Y VIÁTICOS'); // set default header data $pdf->SetHeaderData('logo2.png', 20, 'MPD', 'Administradora Boliviana de Carreteras'); // 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)); // $pdf->SetMargins(10, 30, 10); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); // $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); //set auto page breaks $pdf->SetAutoPageBreak(TRUE, 15); // $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $pdf->SetFont('helvetica', '', 11); // add a page $pdf->AddPage(); // Report $pdf->Image(PATH_ROOT . '/web/img/iso.png', '255', '8', 15, 15, 'PNG', '', 'T', false, 300, '', false, false, 1, false, false, false); $cadena = "<br/><br/><br/><br/><br/><br/>"; $cadena .= '<table width="580" border="0" >'; $cadena .= '<tr><td align="center">'; $cadena .= '<span style="font-size: 30px;font-weight: bold;">'; $cadena .= 'Reporte Ficha del Expediente'; $cadena .= '</span>'; $cadena .= '</td></tr>'; foreach ($result as $fila) { $cadena .= '<tr><td align="left"><b>1. AREA DE INDENTIFICACIÓN</b></td></tr>'; $cadena .= '<tr><td align="left"><b>Id: </b>' . $fila->exp_id . '</td></tr>'; $cadena .= '<tr><td align="left"><b>Código: </b>' . $fila->fon_cod . DELIMITER . $fila->uni_cod . DELIMITER . $fila->tco_codigo . DELIMITER . $fila->ser_codigo . DELIMITER . $fila->exp_codigo . '</td></tr>'; $cadena .= '<tr><td align="left"><b>Fondo:</b> ' . $fila->fon_codigo . '</td></tr>'; $cadena .= '<tr><td align="left"><b>Sección:</b> ' . $fila->uni_descripcion . '</td></tr>'; $cadena .= '<tr><td align="left"><b>Serie:</b> ' . $fila->ser_categoria . '</td></tr>'; $cadena .= '<tr><td align="left"><b>Título:</b> <b>' . $fila->exp_titulo . '</b></td></tr>'; if ($fila->exp_mesi) { if ($fila->exp_anioi) { $cadena .= '<tr><td align="left"><b>Fecha Inicial:</b> ' . $fila->exp_mesi . "/" . $fila->exp_anioi . '</td></tr>'; } else { $cadena .= '<tr><td align="left"><b>Fecha Inicial:</b> ' . $fila->exp_mesi . '</td></tr>'; } } else { if ($fila->exp_anioi) { $cadena .= '<tr><td align="left"><b>Fecha Inicial:</b> ' . $fila->fil_anioi . '</td></tr>'; } } if ($fila->exp_mesf) { if ($fila->exp_aniof) { $cadena .= '<tr><td align="left"><b>Fecha Final:</b> ' . $fila->exp_mesf . "/" . $fila->exp_aniof . '</td></tr>'; } else { $cadena .= '<tr><td align="left"><b>Fecha Final:</b> ' . $fila->exp_mesf . '</td></tr>'; } } else { if ($fila->exp_aniof) { $cadena .= '<tr><td align="left"><b>Fecha Final:</b> ' . $fila->exp_aniof . '</td></tr>'; } } // $cadena .= '<tr><td align="left"><b>Fecha Inicial:</b> ' . $fila->exp_mesi . "/" . $fila->exp_anioi . '</td></tr>'; // $cadena .= '<tr><td align="left"><b>Fecha Final:</b> ' . $fila->exp_mesf . "/" . $fila->exp_aniof . '</td></tr>'; $cadena .= '<tr><td align="left"><b>Ubicación Geográfica:</b> ' . $fila->exp_lugar . '</td></tr>'; $cadena .= '<tr><td align="left"><b>Volumen y soporte de la Unidad de Descripción:</b> ' . $fila->exp_volsop . '</td></tr>'; // Include dynamic fields $expcampo = new expcampo(); $filcampo = $expcampo->obtenerSelectCamposShow($fila->ser_id, $fila->exp_id); if ($filcampo) { $cadena .= '<br/>'; $cadena .= '<tr><td align="left"><b>Datos adicionales en la identificación:</b> ' . "" . '</td></tr>'; $cadena .= $filcampo; } $cadena .= '<br/><tr><td align="left"><b>2. AREA DE CONTEXTO</b></td></tr>'; if ($fila->exp_nomprod) { $cadena .= '<tr><td align="left"><b>Nombre del o de los Productores:</b> ' . $fila->exp_nomprod . '</td></tr>'; } if ($fila->exp_hisins) { $cadena .= '<tr><td align="left"><b>Historia Institucional/Reseña biográfica:</b> ' . $fila->exp_hisins . '</td></tr>'; } if ($fila->exp_hisarc) { $cadena .= '<tr><td align="left"><b>Historia Archivística:</b> ' . $fila->exp_hisarc . '</td></tr>'; } if ($fila->exp_foring) { $cadena .= '<tr><td align="left"><b>Forma de ingreso:</b> ' . $fila->exp_foring . '</td></tr>'; } $cadena .= '<br/><tr><td align="left"><b>3. AREA DE CONTENIDO Y ESTRUCTURA</b></td></tr>'; if ($fila->exp_alccon) { $cadena .= '<tr><td align="left"><b>Alcance y contenido:</b> ' . $fila->exp_alccon . '</td></tr>'; } if ($fila->exp_vaseel) { $cadena .= '<tr><td align="left"><b>Valoración, selección y eliminación:</b> ' . $fila->exp_vaseel . '</td></tr>'; } if ($fila->exp_nueing) { $cadena .= '<tr><td align="left"><b>Nuevos Ingresos:</b> ' . $fila->exp_nueing . '</td></tr>'; } if ($fila->exp_org) { $cadena .= '<tr><td align="left"><b>Organización:</b> ' . $fila->exp_org . '</td></tr>'; } $idioma = new idioma(); $cadena .= '<br/><tr><td align="left"><b>4. AREA DE CONDICIONES DE ACCESO Y USO</b></td></tr>'; if ($fila->exp_conacc) { $cadena .= '<tr><td align="left"><b>Condiciones de Acceso:</b> ' . $fila->exp_conacc . '</td></tr>'; } if ($fila->exp_conrep) { $cadena .= '<tr><td align="left"><b>Condiciones de Reproducción:</b> ' . $fila->exp_conrep . '</td></tr>'; } if ($fila->idi_id) { $cadena .= '<tr><td align="left"><b>Lengua/Escritura de la documentación:</b> ' . $idioma->obtenerIdioma($fila->idi_id) . '</td></tr>'; } if ($fila->exp_carfis) { $cadena .= '<tr><td align="left"><b>Caraterísticas físicas o requisitos técnicos:</b> ' . $fila->exp_carfis . '</td></tr>'; } if ($fila->exp_insdes) { $cadena .= '<tr><td align="left"><b>Instrumentos de descripción:</b> ' . $fila->exp_insdes . '</td></tr>'; } $cadena .= '<br/><tr><td align="left"><b>5. AREA DE DOCUMENTACIÓN ASOCIADA</b></td></tr>'; if ($fila->exp_exloor) { $cadena .= '<tr><td align="left"><b>Existencia y localización de originales:</b> ' . $fila->exp_exloor . '</td></tr>'; } if ($fila->exp_exloco) { $cadena .= '<tr><td align="left"><b>Existencia y localización de copias:</b> ' . $fila->exp_exloco . '</td></tr>'; } if ($fila->exp_underel) { $cadena .= '<tr><td align="left"><b>Unidades de descripción relacionadas:</b> ' . $fila->exp_underel . '</td></tr>'; } if ($fila->exp_notpub) { $cadena .= '<tr><td align="left"><b>Notas de publicación:</b> ' . $fila->exp_notpub . '</td></tr>'; } $cadena .= '<br/><tr><td align="left"><b>6. AREA DE NOTAS</b></td></tr>'; if ($fila->exp_notas) { $cadena .= '<tr><td align="left"><b>Notas:</b> ' . $fila->exp_notas . '</td></tr>'; } $cadena .= '<br/><tr><td align="left"><b>7. AREA DE CONTROL DE LA DESCRIPCIÓN</b></td></tr>'; if ($fila->exp_notarc) { $cadena .= '<tr><td align="left"><b>Notas del archivero:</b> ' . $fila->exp_notarc . '</td></tr>'; } if ($fila->exp_regnor) { $cadena .= '<tr><td align="left"><b>Reglas o Normas:</b> ' . $fila->exp_regnor . '</td></tr>'; } if ($fila->exp_fecdes) { $cadena .= '<tr><td align="left"><b>Fecha de la descripción:</b> ' . $fila->exp_fecdes . '</td></tr>'; } $sop_fisico = new tab_sopfisico(); $nombresopf = $sop_fisico->dbselectByField("sof_id", $fila->sof_id); $nombresopf = $nombresopf[0]; $cadena .= '<br/><tr><td align="left"><b>8. PRESENTACIÓN DEL EXPEDIENTE</b></td></tr>'; if ($nombresopf->sof_nombre) { $cadena .= '<tr><td align="left"><b>Soporte Físico:</b> ' . $nombresopf->sof_nombre . '</td></tr>'; } if ($fila->exp_nrofoj) { $cadena .= '<tr><td align="left"><b>Nro. de Fojas:</b> ' . $fila->exp_nrofoj . '</td></tr>'; } if ($fila->exp_tomovol) { $cadena .= '<tr><td align="left"><b>Tomos (Vols):</b> ' . $fila->exp_tomovol . '</td></tr>'; } if ($fila->exp_nroejem) { $cadena .= '<tr><td align="left"><b>Nro. Ejemplares:</b> ' . $fila->exp_nroejem . '</td></tr>'; } if ($fila->exp_ori) { $cadena .= '<tr><td align="left"><b>Originales:</b> ' . $fila->exp_ori . '</td></tr>'; } if ($fila->exp_cop) { $cadena .= '<tr><td align="left"><b>Copias:</b> ' . $fila->exp_cop . '</td></tr>'; } if ($fila->exp_fot) { $cadena .= '<tr><td align="left"><b>Duplicados:</b> ' . $fila->exp_fot . '</td></tr>'; } if ($fila->exp_nrocaj) { $cadena .= '<tr><td align="left"><b>Nro. de Caja:</b> ' . $fila->exp_nrocaj . '</td></tr>'; } if ($fila->exp_sala) { $cadena .= '<tr><td align="left"><b>Sala:</b> ' . $fila->exp_sala . '</td></tr>'; } if ($fila->exp_estante) { $cadena .= '<tr><td align="left"><b>Estante:</b> ' . $fila->exp_estante . '</td></tr>'; } if ($fila->exp_cuerpo) { $cadena .= '<tr><td align="left"><b>Cuerpo:</b> ' . $fila->exp_cuerpo . '</td></tr>'; } if ($fila->exp_balda) { $cadena .= '<tr><td align="left"><b>Balda:</b> ' . $fila->exp_balda . '</td></tr>'; } if ($fila->exp_obs) { $cadena .= '<tr><td align="left"><b>Observaciones:</b> ' . $fila->exp_obs . '</td></tr>'; } // Key words $palclave = new palclave(); $cadena .= '<tr><td align="left"><b>Palabras claves:</b> ' . $palclave->listaPCFile2($fila->exp_id) . '</td></tr>'; } $cadena .= '</table>'; //$cadena .= '</table>'; $pdf->writeHTML($cadena, true, false, false, false, ''); // Close and output PDF document $pdf->Output('ficha_expediente.pdf', 'I'); }
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'); }