コード例 #1
0
 function index()
 {
     $admin = new usuario();
     $esAdmin = $admin->esAdm();
     $this->registry->template->esAdmin = $esAdmin;
     $this->rol = new tab_rol();
     $resul = $this->rol->dbselectBySQL("SELECT rol_titulo \r\n                                            FROM tab_rol \r\n                                            WHERE rol_id = " . VAR3);
     if (count($resul)) {
         $codigo = $resul[0]->rol_titulo;
     } else {
         $codigo = "";
     }
     $this->registry->template->fle_id = "";
     $this->registry->template->rol_titulo = $codigo;
     $this->registry->template->PATH_WEB = PATH_WEB;
     $this->registry->template->PATH_DOMAIN = PATH_DOMAIN;
     $this->registry->template->PATH_EVENT = "add";
     $this->registry->template->GRID_SW = "false";
     $this->registry->template->FORM_SW = "display:none;";
     $this->registry->template->PATH_J = "jquery";
     $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('flujo_estado/tab_flujo_estadog.tpl');
     $this->registry->template->show('footer');
 }
コード例 #2
0
 function index()
 {
     $admin = new usuario();
     $esAdmin = $admin->esAdm();
     $this->registry->template->esAdmin = $esAdmin;
     $this->pasaje_viatico = new tab_pasaje_viatico();
     $resul = $this->pasaje_viatico->dbselectBySQL("SELECT pav_nromemo\r\n                                                     FROM tab_pasaje_viatico\r\n                                                     WHERE pav_id = " . VAR3);
     if (count($resul)) {
         $codigo = $resul[0]->pav_nromemo;
     } else {
         $codigo = "";
     }
     $this->registry->template->pav_nromemo = $codigo;
     $this->registry->template->mav_id = "";
     $this->registry->template->PATH_WEB = PATH_WEB;
     $this->registry->template->PATH_DOMAIN = PATH_DOMAIN;
     $this->registry->template->PATH_EVENT = "add";
     $this->registry->template->GRID_SW = "false";
     $this->registry->template->FORM_SW = "display:none;";
     $this->registry->template->PATH_J = "jquery";
     $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('pasaje_viatico/tab_matriz_viajeg.tpl');
     $this->registry->template->show('footer');
 }
コード例 #3
0
 function index()
 {
     $admin = new usuario();
     $esAdmin = $admin->esAdm();
     $this->registry->template->esAdmin = $esAdmin;
     $this->provincia = new tab_provincia();
     $resul = $this->provincia->dbselectBySQL("SELECT dep_id, \r\n                                                  pro_nombre\r\n                                                  FROM tab_provincia \r\n                                                  WHERE pro_id = " . VAR3);
     if (count($resul)) {
         $codigo = $resul[0]->pro_nombre;
         $dep_id = $resul[0]->dep_id;
     } else {
         $codigo = "";
     }
     $this->registry->template->loc_id = "";
     $this->registry->template->dep_id = $dep_id;
     $this->registry->template->pro_nombre = $codigo;
     $this->registry->template->PATH_WEB = PATH_WEB;
     $this->registry->template->PATH_DOMAIN = PATH_DOMAIN;
     $this->registry->template->PATH_EVENT = "add";
     $this->registry->template->GRID_SW = "false";
     $this->registry->template->FORM_SW = "display:none;";
     $this->registry->template->PATH_J = "jquery";
     $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('ciudad/tab_localidadg.tpl');
     $this->registry->template->show('footer');
 }
コード例 #4
0
 function index()
 {
     $admin = new usuario();
     $esAdmin = $admin->esAdm();
     $this->registry->template->esAdmin = $esAdmin;
     $this->unidad = new tab_unidad();
     $resul = $this->unidad->dbselectBySQL("SELECT uni_descripcion \r\n                                                     FROM tab_unidad \r\n                                                     WHERE uni_id = " . VAR3);
     if (count($resul)) {
         $codigo = $resul[0]->uni_descripcion;
     } else {
         $codigo = "";
     }
     $this->registry->template->car_id = "";
     $this->registry->template->uni_descripcion = $codigo;
     $this->registry->template->PATH_WEB = PATH_WEB;
     $this->registry->template->PATH_DOMAIN = PATH_DOMAIN;
     $this->registry->template->PATH_EVENT = "add";
     $this->registry->template->GRID_SW = "false";
     $this->registry->template->FORM_SW = "display:none;";
     $this->registry->template->PATH_J = "jquery";
     $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('cargo/tab_cargog.tpl');
     $this->registry->template->show('footer');
 }
コード例 #5
0
 function index()
 {
     $admin = new usuario();
     $esAdmin = $admin->esAdm();
     $this->registry->template->esAdmin = $esAdmin;
     $this->registry->template->dep_id = "";
     $this->registry->template->PATH_WEB = PATH_WEB;
     $this->registry->template->PATH_DOMAIN = PATH_DOMAIN;
     $this->registry->template->PATH_EVENT = "add";
     $this->registry->template->GRID_SW = "false";
     $this->registry->template->FORM_SW = "display:none;";
     $this->registry->template->PATH_J = "jquery";
     $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('departamento/tab_departamentog.tpl');
     $this->registry->template->show('footer');
 }
コード例 #6
0
 function load()
 {
     $usuario = new usuario();
     $adm = $usuario->esAdm();
     $this->tab_expediente = new tab_expediente();
     $this->tab_expediente->setRequest2Object($_REQUEST);
     $page = $_REQUEST['page'];
     $rp = $_REQUEST['rp'];
     $sortname = $_REQUEST['sortname'];
     $sortorder = $_REQUEST['sortorder'];
     if (!$sortname) {
         $sortname = " tab_fondo.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 ";
     } else {
         $sortname = $sortname;
     }
     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 = strtoupper(trim($_REQUEST['query']));
     $qtype = $_REQUEST['qtype'];
     $where = "";
     if ($query != "") {
         $_SESSION["SER_ID"] = null;
         if ($qtype == 'exp_id') {
             $where .= " and tab_expediente.exp_id = '{$query}' ";
         } elseif ($qtype == 'exp_titulo') {
             $where .= " and tab_expisadg.exp_titulo LIKE '%{$query}%' ";
         } elseif ($qtype == 'fon_codigo') {
             $where .= " and tab_fondo.fon_descripcion LIKE '%{$query}%' ";
         } elseif ($qtype == 'uni_descripcion') {
             $where .= " and tab_unidad.uni_descripcion LIKE '%{$query}%' ";
         } elseif ($qtype == 'custodio') {
             $nomArray = explode(" ", $query);
             $where .= " and (tab_usuario.usu_nombres LIKE '%{$nomArray['0']}%' OR tab_usuario.usu_apellidos LIKE '%{$nomArray['1']}%') ";
         } else {
             $where .= " and {$qtype} LIKE '%{$query}%' ";
         }
     } else {
         // Serie
         if (VAR3) {
             $_SESSION["SER_ID"] = VAR3;
         }
     }
     if ($_SESSION["SER_ID"]) {
         $where .= " AND tab_series.ser_id='" . $_SESSION['SER_ID'] . "'";
     }
     if ($_SESSION["ROL_COD"] == 'AAOR') {
         $where .= " AND tab_fondo.fon_id ='" . $_SESSION['FON_ID'] . "' ";
     } else {
         if ($_SESSION["ROL_COD"] != 'AA') {
             $where .= " AND tab_usuario.usu_id ='" . $_SESSION['USU_ID'] . "' ";
         }
     }
     $sql = "SELECT\r\n        tab_expediente.exp_id,\r\n        tab_fondo.fon_codigo,\r\n        tab_fondo.fon_cod,\r\n        tab_unidad.uni_descripcion,\r\n        tab_unidad.uni_cod,\r\n        tab_tipocorr.tco_codigo,\r\n        tab_series.ser_id,\r\n        tab_series.ser_par,\r\n        tab_series.ser_codigo,\r\n        tab_series.ser_categoria,\r\n        tab_expediente.exp_codigo,\r\n        tab_usuario.usu_id,\r\n        tab_usuario.usu_nombres,\r\n        tab_usuario.usu_apellidos,\r\n        tab_expisadg.exp_titulo,\r\n        tab_expisadg.exp_fecha_exi,\r\n        tab_tipoarch.tar_nombre\r\n        FROM\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_series ON tab_expediente.ser_id = tab_series.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        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_expusuario.eus_estado = 1\r\n        {$where}\r\n        {$sort}\r\n        {$limit} ";
     $result = $this->tab_expediente->dbSelectBySQL($sql);
     $total = $this->tab_expediente->countBySQL("SELECT count (tab_expediente.exp_id)\r\n                                                FROM\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_series ON tab_expediente.ser_id = tab_series.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                                                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_expusuario.eus_estado = 1\r\n                                                {$where}");
     //            (tab_expisadg.exp_fecha_exi +
     //                (SELECT tab_retensiondoc.red_prearc * INTERVAL '1 year'
     //                FROM tab_retensiondoc
     //                WHERE tab_retensiondoc.red_id = tab_series.red_id)) ::DATE AS exp_fecha_exf,
     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;
     foreach ($result as $un) {
         if ($rc) {
             $json .= ",";
         }
         $json .= "\n{";
         $json .= "id:'" . $un->exp_id . "',";
         $json .= "cell:['" . $un->exp_id . "'";
         $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)) . "'";
         if ($adm) {
             $json .= ",'" . addslashes($un->fon_codigo) . "'";
             $json .= ",'" . addslashes($un->uni_descripcion) . "'";
             $json .= ",'" . addslashes($un->ser_categoria) . "'";
         }
         $json .= ",'" . addslashes($un->exp_titulo) . "'";
         $expediente = new expediente();
         $json .= ",'" . addslashes($expediente->obtenerCantidadDocs($un->exp_id)) . "'";
         if ($adm) {
             $json .= ",'" . addslashes($un->usu_nombres . ' ' . $un->usu_apellidos) . "'";
         }
         $json .= "]}";
         $rc = true;
         $i++;
     }
     $json .= "]\n";
     $json .= "}";
     echo $json;
 }
コード例 #7
0
 function load()
 {
     $usuario = new usuario();
     $adm = $usuario->esAdm();
     $expediente = new tab_expediente();
     $expediente->setRequest2Object($_REQUEST);
     $page = $_REQUEST['page'];
     $rp = $_REQUEST['rp'];
     $sortname = $_REQUEST['sortname'];
     $sortorder = $_REQUEST['sortorder'];
     if (!$sortname) {
         $sortname = 'exp_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 == 'exp_id') {
             $where = " and tab_expediente.exp_id = '{$query}' ";
         } elseif ($qtype == 'ser_categoria') {
             $where = " and tab_series.ser_categoria LIKE '%{$query}%' ";
         } else {
             $where = " and {$qtype} LIKE '%{$query}%' ";
         }
     }
     //        if ($_SESSION ["ROL_COD"] != 'AA') {
     //            $where .= " AND tab_usuario.usu_id ='" . $_SESSION['USU_ID'] . "' ";
     //        }
     if ($_SESSION["ROL_COD"] == 'AAOR') {
         $where .= " AND tab_fondo.fon_id ='" . $_SESSION['FON_ID'] . "' ";
     } else {
         if ($_SESSION["ROL_COD"] != 'AA') {
             $where .= " AND tab_usuario.usu_id ='" . $_SESSION['USU_ID'] . "' ";
         }
     }
     $sql = "SELECT\r\n        tab_expediente.exp_id,\r\n        tab_fondo.fon_codigo,\r\n        tab_fondo.fon_cod,\r\n        tab_unidad.uni_descripcion,\r\n        tab_unidad.uni_cod,\r\n        tab_tipocorr.tco_codigo,\r\n        tab_series.ser_id,\r\n        tab_series.ser_par,\r\n        tab_series.ser_codigo,\r\n        tab_series.ser_categoria,\r\n        tab_expediente.exp_codigo,\r\n        tab_usuario.usu_id,\r\n        tab_usuario.usu_nombres,\r\n        tab_usuario.usu_apellidos,\r\n        tab_expisadg.exp_titulo,\r\n        tab_expisadg.exp_fecha_exi,\r\n        tab_tipoarch.tar_nombre,\r\n        tab_etiquetas.ete_id\r\n        FROM\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_series ON tab_expediente.ser_id = tab_series.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_etiquetas ON tab_expediente.exp_id = tab_etiquetas.exp_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_expusuario.eus_estado = 1\r\n        AND tab_etiquetas.ete_estado = '1'\r\n        {$where}\r\n        {$sort}\r\n        {$limit} ";
     $result = $expediente->dbselectBySQL($sql);
     $total = $expediente->countBySQL("SELECT COUNT (tab_expediente.exp_id) \r\n        FROM\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_series ON tab_expediente.ser_id = tab_series.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_etiquetas ON tab_expediente.exp_id = tab_etiquetas.exp_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_expusuario.eus_estado = 1\r\n        AND tab_etiquetas.ete_estado = '1'\r\n        {$where} ");
     $expediente = 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;
     foreach ($result as $un) {
         if ($rc) {
             $json .= ",";
         }
         $json .= "\n{";
         $json .= "id:'" . $un->exp_id . "',";
         $json .= "cell:['" . $un->exp_id . "'";
         $json .= ",'" . addslashes($un->ete_id) . "'";
         $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)) . "'";
         if ($adm) {
             $json .= ",'" . addslashes($un->fon_codigo) . "'";
             $json .= ",'" . addslashes($un->uni_descripcion) . "'";
             $json .= ",'" . addslashes($un->ser_categoria) . "'";
         }
         $json .= ",'" . addslashes($un->exp_titulo) . "'";
         $expediente = new expediente();
         $json .= ",'" . addslashes($expediente->obtenerCantidadDocs($un->exp_id)) . "'";
         if ($adm) {
             $json .= ",'" . addslashes($un->usu_nombres . ' ' . $un->usu_apellidos) . "'";
         }
         $json .= "]}";
         $rc = true;
         $i++;
     }
     $json .= "]\n";
     $json .= "}";
     echo $json;
 }
コード例 #8
0
 function view()
 {
     if (!VAR3) {
         die("Error del sistema 404");
     }
     $this->subcontenedor = new tab_subcontenedor();
     $this->subcontenedor->setRequest2Object($_REQUEST);
     $row = $this->subcontenedor->dbselectByField("suc_id", VAR3);
     if (!$row) {
         die("Error del sistema 404");
     }
     $row = $row[0];
     $tab_contenedor = new Tab_contenedor();
     $usuario = new usuario();
     $adm = $usuario->esAdm();
     $this->registry->template->adm = $adm;
     $sql = "SELECT con.con_id,con.con_codigo,usu.usu_id,usu.usu_nombres,usu.usu_apellidos\r\n                FROM tab_contenedor AS con\r\n                INNER JOIN tab_usuario AS usu ON con.usu_id = usu.usu_id\r\n                WHERE con.con_id = " . $row->con_id;
     $result = $tab_contenedor->dbselectBySQL($sql);
     if (count($result)) {
         $codigo2 = $result[0]->con_codigo;
         $usu_id = $result[0]->usu_id;
         $nombre = $result[0]->usu_nombres . " " . $result[0]->usu_apellidos;
         $con_id = $result[0]->con_id;
     } else {
         $codigo2 = "";
         $usu_id = "";
         $nombre = "";
         $con_id = "";
     }
     $this->registry->template->con_id = $con_id;
     $this->registry->template->con_codigo = $codigo2;
     $this->registry->template->nombre = $nombre;
     $this->registry->template->titulo = "Editar Sub Contenedor";
     $this->registry->template->suc_id = $row->suc_id;
     //$contenedor = new contenedor();
     $this->registry->template->suc_nro_balda = $row->suc_nro_balda;
     $this->registry->template->suc_fecha_exi_min = $row->suc_fecha_exi_min;
     $this->registry->template->suc_fecha_exf_max = $row->suc_fecha_exf_max;
     $this->registry->template->suc_codigo = $row->suc_codigo;
     $this->registry->template->suc_ml = $row->suc_ml;
     $this->menu = new menu();
     $this->liMenu = $this->menu->imprimirMenu(VAR1, $_SESSION['USU_ID']);
     $this->registry->template->men_titulo = $this->liMenu;
     $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->FORM_SW = "";
     $this->registry->template->PATH_J = "jquery-1.4.1";
     $this->registry->template->show('headerG');
     $this->registry->template->show('tab_subcontenedor.tpl');
     $this->registry->template->show('footer');
 }
コード例 #9
0
 function load()
 {
     $usuario = new usuario();
     $esAdmin = $usuario->esAdm();
     $this->pasaje_viatico = new tab_pasaje_viatico();
     $this->pasaje_viatico->setRequest2Object($_REQUEST);
     $page = $_REQUEST['page'];
     $rp = $_REQUEST['rp'];
     $sortname = $_REQUEST['sortname'];
     $sortorder = $_REQUEST['sortorder'];
     if (!$sortname) {
         $sortname = 'pav_id';
     }
     if (!$sortorder) {
         $sortorder = 'desc';
     }
     $sort = "ORDER BY {$sortname} {$sortorder}";
     if (!$page) {
         $page = 1;
     }
     if (!$rp) {
         $rp = 15;
     }
     //10
     $start = ($page - 1) * $rp;
     $limit = "LIMIT {$rp} OFFSET {$start}";
     $query = $_REQUEST['query'];
     $qtype = $_REQUEST['qtype'];
     $where = "";
     if ($query) {
         if ($qtype == 'pav_id') {
             $where = " AND {$qtype} = '{$query}' ";
         } else {
             $where = " AND {$qtype} LIKE '%{$query}%' ";
         }
     }
     $whereEstado = "";
     $whereUsuario = "";
     if ($esAdmin) {
         // Aprueba
         if ($_SESSION["ROL_COD"] == "MIN") {
             $whereEstado = " (pav_estado=1 OR pav_estado=2 OR pav_estado=3)";
         }
         if ($_SESSION["ROL_COD"] == "VICE") {
             $whereEstado = " (pav_estado=1 OR pav_estado=2 OR pav_estado=3)";
         }
         if ($_SESSION["ROL_COD"] == "DIR") {
             $whereEstado = " (pav_estado=3)";
         }
     } else {
         if ($_SESSION["ROL_COD"] == "JEFE") {
             $whereEstado = " (pav_estado=5)";
         } else {
             if ($_SESSION["ROL_COD"] == "RESPP") {
                 $whereEstado = " (pav_estado=5 OR pav_estado=6)";
             } else {
                 if ($_SESSION["ROL_COD"] == "RESP") {
                     $whereEstado = " (pav_estado=6 OR pav_estado=7)";
                 } else {
                     if ($_SESSION["ROL_COD"] == "TEC") {
                         $whereEstado = " (pav_estado=8 OR pav_estado=9)";
                     } else {
                         $whereEstado = " (pav_estado=1 OR pav_estado=2)";
                         $whereUsuario = " AND usu_id=" . $_SESSION['USU_ID'] . "";
                     }
                 }
             }
         }
     }
     $sql = "SELECT\r\n                pav_id,\r\n                usu_id,\r\n                pav_fecreg,\r\n                pav_nromemo,\r\n                pav_objcom,\r\n                pav_tipo,\r\n                pav_subtipo,\r\n                pav_de,\r\n                pav_a,\r\n                pav_medtrans,\r\n                pav_lugcom,\r\n                pav_fecsal,\r\n                pav_horsal,\r\n                pav_fecret,\r\n                pav_horret,\r\n                (SELECT fin_cod FROM tab_financiador WHERE tab_financiador.fin_id=tab_pasaje_viatico.fin_id) AS fin_id,\r\n                pav_porcvia,\r\n                pav_alimen,\r\n                pav_hosp,\r\n                pav_pasajes,\r\n                pav_ferfinsem,\r\n                pav_resalc,\r\n                pav_catprog,\r\n                pav_fueorg,\r\n                pav_conrec,\r\n                pav_obs,\r\n                usu_id_apr,\r\n                pav_estado,\r\n                (CASE tab_pasaje_viatico.pav_estado\r\n                    WHEN '1' THEN 'SOLICITUD'\r\n                    WHEN '2' THEN 'ELIMINADO'\r\n                    WHEN '3' THEN 'APROBADO'\r\n                    WHEN '4' THEN 'DEVUELTO'\r\n                    WHEN '5' THEN 'AUTORIZADO'\r\n                    WHEN '6' THEN 'LIQUIDACION'\r\n                    WHEN '7' THEN 'CERTIFICACION'\r\n                    WHEN '8' THEN 'FINALIZADO' END) AS pav_estado\r\n                FROM tab_pasaje_viatico\r\n                WHERE {$whereEstado}\r\n                {$whereUsuario}\r\n                {$where}\r\n                {$sort}\r\n                {$limit}";
     $result = $this->pasaje_viatico->dbselectBySQL($sql);
     $total = $this->pasaje_viatico->countBySQL("SELECT COUNT(pav_id)\r\n                                FROM tab_pasaje_viatico\r\n                                WHERE {$whereEstado}\r\n                                {$whereUsuario}\r\n                                {$where} ");
     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;
     foreach ($result as $un) {
         if ($rc) {
             $json .= ",";
         }
         $json .= "\n{";
         $json .= "id:'" . $un->pav_id . "',";
         $json .= "cell:['" . $un->pav_id . "'";
         $json .= ",'" . addslashes($un->pav_fecreg) . "'";
         $json .= ",'" . addslashes($un->pav_nromemo) . "'";
         $json .= ",'" . addslashes($un->pav_objcom) . "'";
         $json .= ",'" . addslashes($un->pav_de) . "'";
         $json .= ",'" . addslashes($un->pav_a) . "'";
         $json .= ",'" . addslashes($un->pav_medtrans) . "'";
         $json .= ",'" . addslashes($un->fin_id) . "'";
         $json .= ",'" . addslashes($un->pav_fecsal) . "'";
         $json .= ",'" . addslashes($un->pav_horsal) . "'";
         $json .= ",'" . addslashes($un->pav_fecret) . "'";
         $json .= ",'" . addslashes($un->pav_horret) . "'";
         $json .= ",'" . addslashes($un->pav_estado) . "'";
         $json .= "]}";
         $rc = true;
         $i++;
     }
     $json .= "]\n";
     $json .= "}";
     echo $json;
 }
コード例 #10
0
 function add()
 {
     $contenedor = new contenedor();
     $this->registry->template->con_id = "";
     $this->registry->template->tipo_contenedores = $contenedor->obtenerTiposContenedor("");
     $this->registry->template->con_codigo = "";
     $this->registry->template->con_codbs = "";
     $usuario = new usuario();
     $adm = $usuario->esAdm();
     if ($adm) {
         $sel_usu = '<select name="usu_id" id="usu_id" class="required">';
         $sel_usu .= '<option value="">(seleccionar)</option>';
         $sel_usu .= $usuario->obtenerSelect($_SESSION['USU_ID']);
         $sel_usu .= '</select>';
         $this->registry->template->usuario = $sel_usu;
     } else {
         $this->registry->template->usuario = $usuario->obtenerNombre($_SESSION['USU_ID']);
         $this->registry->template->usu_id = $_SESSION['USU_ID'];
     }
     $this->registry->template->adm = $adm;
     $this->registry->template->PATH_WEB = PATH_WEB;
     $this->registry->template->PATH_CONTROLADOR = 'contenedor';
     $this->registry->template->PATH_DOMAIN = PATH_DOMAIN;
     $this->registry->template->PATH_EVENT = "save";
     $this->registry->template->GRID_SW = "false";
     $this->registry->template->PATH_J = "jquery-1.4.1";
     $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('tab_contenedor.tpl');
     $this->registry->template->show('footer');
 }