PageRenderTime 44ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/cardepartamento/view/car_departamento.php

https://gitlab.com/talueses/SIPVE
PHP | 237 lines | 175 code | 15 blank | 47 comment | 18 complexity | 732f4e8824e603c232607fd49444c7d7 MD5 | raw file
  1. <?php
  2. /*******************************************************************************\
  3. * @copyright
  4. *
  5. * === SIPve ===
  6. * Sistema Integrado de Protección con capacidades de Videovigilancia
  7. * Control de Acceso y Carnetización para el resguardo físico de instalaciones.
  8. *
  9. * Copyright (C) 2012 Fundación Centro Nacional de Innovación Tecnológica, Cenit.
  10. * Dirección de Investigación, Desarrollo e Innovación.
  11. * Gilda Ramos.
  12. * José Medina.
  13. * Héctor Reverón.
  14. * David Concepción.
  15. * Ronald Delgado.
  16. * Jenner Fuentes.
  17. *
  18. * This program is free software: you can redistribute it and/or modify
  19. * it under the terms of the GNU General Public License as published by
  20. * the Free Software Foundation, either VERSION 3 of the License, or
  21. * (at your option) any later version.
  22. *
  23. * This program is distributed in the hope that it will be useful,
  24. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26. * GNU General Public License for more details.
  27. *
  28. * You should have received a copy of the GNU General Public License
  29. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  30. *
  31. * Para mas información visite
  32. * @link http://repositorio.softwarelibre.gob.ve/ - RNA
  33. * @link http://sourceforge.net/projects/sipve/ - SourceForge
  34. * @link https://gitlab.com/talueses/SIPVE - Gitlab Repositorio.
  35. *
  36. \*******************************************************************************/
  37. ?>
  38. <?php
  39. /**
  40. * Listado de
  41. * @author David Cocepcion CENIT-DIDI
  42. */
  43. session_start(); // start up your PHP session!
  44. if(!isset($_SESSION['usuario'])){
  45. header("location: login.php",true);
  46. return false;
  47. }
  48. header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
  49. header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
  50. require_once "../controller/car_departamento.control.op.php";// Class CONTROLLER
  51. $obj = new CarDepartamentos();
  52. $data = $obj->getCarDepartamentos();
  53. ?>
  54. <html>
  55. <head>
  56. <meta http-equiv="Content-Type" content="text/html; charset=utf-8 ">
  57. <title>CarDepartamentos</title>
  58. <link type="text/css" href="../../inicio/css/jquery-ui.css" rel="stylesheet" />
  59. <link href="../../inicio/css/comunes.css" rel="stylesheet" type="text/css" />
  60. <script type="text/javascript" src="../../inicio/js/jquery.js"></script>
  61. <script type="text/javascript" src="../../inicio/js/jquery-ui.min.js"></script>
  62. <style type="text/css" >
  63. #tabla{
  64. float:left;
  65. width:30%;
  66. height:95%;
  67. border: #aaaaaa solid 1px;
  68. overflow-x:hidden
  69. width:95%;
  70. background:#fff;
  71. -moz-border-radius: 6px;
  72. -webkit-border-radius: 6px;
  73. border-radius: 6px;
  74. }
  75. #listado{
  76. width:99%;
  77. background:#fff;
  78. margin: 0px 1px 0px 1px;
  79. border: #aaaaaa solid 1px;
  80. -moz-border-radius: 6px;
  81. -webkit-border-radius: 6px;
  82. border-radius: 6px;
  83. }
  84. #titulo{
  85. height: 30px;
  86. border: 1px solid #aaaaaa; background: #cccccc url(../../inicio/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold;
  87. -moz-border-radius: 6px;
  88. -webkit-border-radius: 6px;
  89. border-radius: 6px;
  90. }
  91. #listado tr {
  92. background:#fff;
  93. }
  94. #listado tr th {
  95. border: 1px solid #d3d3d3; background: #e6e6e6 url(../../inicio/css/images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555;
  96. -moz-border-radius: 6px;
  97. -webkit-border-radius: 6px;
  98. border-radius: 6px;
  99. }
  100. #listado tr.chequeada {
  101. background:#dd0;
  102. }
  103. #listado tr.pasada {
  104. background:#dd0;
  105. cursor:pointer;
  106. }
  107. #botones{
  108. margin: 10px;
  109. }
  110. </style>
  111. <script type="text/javascript" language="javascript">
  112. $(function() {
  113. $( "input:button, input:submit,button" ).button();
  114. });
  115. function visualizar(fila){
  116. $('#iddepartamento').val(fila.id);
  117. $('#accion').val('visualizar');
  118. $('#f1').attr('action','car_departamento.Acc.php');
  119. $('#f1').submit();
  120. }
  121. filaseleccionada = {};
  122. function oclic(fila){
  123. filaseleccionada.className='';
  124. filaseleccionada = fila;
  125. $('#'+fila.id).addClass('chequeada');
  126. }
  127. function omover(fila){
  128. if (fila.id===filaseleccionada.id ) return false;
  129. $('#'+fila.id).addClass('pasada');
  130. }
  131. function omout(fila){
  132. if (fila.id===filaseleccionada.id ) return false;
  133. $('#'+fila.id).removeClass('pasada');
  134. }
  135. function Accion(acc){
  136. $('#accion').val(acc);
  137. $('#f1').attr('action','car_departamento.Acc.php');
  138. if (acc == "modificar" || acc == "eliminar" || acc == "enviarArchivo"){
  139. if ($('#iddepartamento').val()==""){
  140. alert("Debe seleccionar un registro de la lista");
  141. return false
  142. }
  143. if (acc == "eliminar"){
  144. if (!confirm("\xbf Esta seguro que desea eliminar el registro ?")){
  145. return false;
  146. }
  147. $('#f1').attr('action','car_departamento.Op.php');
  148. }
  149. }
  150. $('#f1').submit();
  151. return true;
  152. }
  153. </script>
  154. </head>
  155. <body style="margin:0px;background:#ddd;">
  156. <div id="principal" style="width:100%;height:650px;border:#000000 solid 1px;" >
  157. <div id="tabla" align="center">
  158. <?php
  159. if (!Controller::chkPermiso($_SESSION["usuario"], CATEGORIA,"listar")){
  160. echo Controller::$mensajePermisos;
  161. }else{
  162. echo Buscador::getObjBuscador("iddepartamento", "departamento_nombre", "car_departamento", "order by departamento_nombre");
  163. ?>
  164. <table id="listado">
  165. <tr>
  166. <td id="titulo" colspan="3" align="center"><b>Departamentos</b></td>
  167. </tr>
  168. <tr>
  169. <th align="center" width="10%">N&deg;</th>
  170. <th>Departamento</th>
  171. </tr>
  172. <?php
  173. if (count($data) > 0){
  174. foreach ($data as $key => $row){?>
  175. <tr id="<?php echo $row->iddepartamento;?>" onclick="visualizar(this);oclic(this)" onmouseover="omover(this)" onmouseout="omout(this)">
  176. <td align="center"><b><?php echo paginationSQL::$start+$key+1;?></b></td>
  177. <td><?php echo $row->departamento_nombre;?></td>
  178. </tr>
  179. <?php
  180. }
  181. }else{
  182. ?>
  183. <tr>
  184. <td colspan="3">
  185. <div id="divmensaje" style="width:99%;border:2px solid red" align="center">No se encontraron registros</div>
  186. </td>
  187. </tr>
  188. <?php
  189. }
  190. ?>
  191. </table>
  192. <?php echo paginationSQL::links();?>
  193. <div id="botones" >
  194. <center>
  195. <form name="f1" id="f1" target="frm1" action="car_departamento.Acc.php" method="POST">
  196. <input type="hidden" name="iddepartamento" id="iddepartamento" value="">
  197. <input type="hidden" name="accion" id="accion" value="">
  198. <?php
  199. if (Controller::chkPermiso($_SESSION["usuario"], CATEGORIA,"agregar")){
  200. ?><input type="submit" value="Agregar" onclick="return Accion('agregar')" class="boton"><?php
  201. }
  202. if (Controller::chkPermiso($_SESSION["usuario"], CATEGORIA,"modificar")){
  203. ?><input type="submit" value="Modificar" onclick="return Accion('modificar')" class="boton"><?php
  204. }
  205. if (Controller::chkPermiso($_SESSION["usuario"], CATEGORIA,"eliminar")){
  206. ?><input type="button" value="Eliminar" onclick="return Accion('eliminar')" class="boton"><?php
  207. }
  208. ?>
  209. <input type="submit" value="Ayuda" onclick="this.form.action='car_departamento.Ayuda.php'" class="boton">
  210. </form>
  211. </center>
  212. </div>
  213. <?php
  214. }
  215. ?>
  216. </div>
  217. <div id="detalle" style="float:left;width:69%;height:650px;border-left:#000000 solid 1px;">
  218. <iframe name="frm1" id="frm1" frameborder="0" scrolling="no" style="width:100%; height:650px" src="car_departamento.Acc.php?accion=agregar"></iframe>
  219. </div>
  220. </div>
  221. </body>
  222. </html>