PageRenderTime 22ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/ctrlcontroladora/view/ctrl_controladora.estado.list.php

https://gitlab.com/talueses/SIPVE
PHP | 243 lines | 175 code | 14 blank | 54 comment | 11 complexity | a43bc359abe635aa69a6c48de89f0d6c 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 estados
  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. //echo "<div align='left'><pre>".print_r($_REQUEST,true)."</pre></div>";
  51. require_once "../controller/ctrl_controladora.control.op.php";// Class CONTROLLER
  52. $obj = new ControlOpCtrlControladora();
  53. if ($_REQUEST["accion"]=="enviarPeticion"){
  54. //echo "<p>enviarPeticion</p>";
  55. $obj->enviarPeticion();
  56. }
  57. $data = $obj->getEstado();
  58. if ($_REQUEST["accion"]=="modificarEstados"){
  59. //echo "<p>modificarEstados</p>";
  60. $obj->modificarEstados($data);
  61. header("Location: ctrl_controladora.estado.list.php?accion=verPeticion&intento=".($_REQUEST["intento"]+1));
  62. }
  63. ?>
  64. <html>
  65. <head>
  66. <meta http-equiv="Content-Type" content="text/html; charset=utf-8 ">
  67. <link type="text/css" href="../../inicio/css/jquery-ui.css" rel="stylesheet" />
  68. <link rel="stylesheet" href="../css/jquery.treeview.css" >
  69. <link href="../../inicio/css/comunes.css" rel="stylesheet" type="text/css" />
  70. <script type="text/javascript" src="../../inicio/js/jquery.js"></script>
  71. <script type="text/javascript" src="../../inicio/js/jquery-ui.min.js"></script>
  72. <script type="text/javascript" src="../js/jquery.cookie.js"></script>
  73. <script type="text/javascript" src="../js/jquery.treeview.js"></script>
  74. <style type="text/css">
  75. .list{
  76. color: #000000;
  77. font-style: oblique;
  78. background-color: #f0ebe2;
  79. width: 300px;
  80. border: 1px solid #ccc0a9;
  81. }
  82. .contenido{
  83. width:98%;
  84. padding: 2px;
  85. border: #aaaaaa solid 1px;
  86. background:#fff;
  87. -moz-border-radius: 6px;
  88. -webkit-border-radius: 6px;
  89. border-radius: 6px;
  90. }
  91. #controles{
  92. width: 100px;
  93. padding: 0px;
  94. position: absolute;
  95. opacity: 0.8;
  96. right: 10px;
  97. cursor: move;
  98. }
  99. .titulo{
  100. height: 20px;
  101. 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;
  102. -moz-border-radius: 6px;
  103. -webkit-border-radius: 6px;
  104. border-radius: 6px;
  105. }
  106. #datos{
  107. width: 500px;
  108. background:#fff;
  109. margin: 5px 1px 0px 1px;
  110. padding: 5px;
  111. border: #aaaaaa solid 1px;
  112. -moz-border-radius: 6px;
  113. -webkit-border-radius: 6px;
  114. border-radius: 6px;
  115. }
  116. #botones{
  117. margin: 10px;
  118. }
  119. #main { padding: 1em; }
  120. </style>
  121. <script type="text/javascript" language="javascript">
  122. $(function() {
  123. $( "input:button, input:submit,button" ).button();
  124. $( "#controles" ).draggable({ containment: "body" });
  125. });
  126. $(document).ready(function(){
  127. $("#list").treeview({
  128. control: "#treecontrol",
  129. collapsed: true,
  130. animated: "medium",
  131. persist: "cookie",
  132. cookieId: "treeview-black"
  133. });
  134. if ($('#chkingEstado').val()=="true"){
  135. setTimeout("reloadPage();",15000);
  136. }
  137. });
  138. function reloadPage(){
  139. var intento = parseInt($('#intento').val()) + 1;
  140. //alert('Intento: ' + intento);
  141. if (intento<5 ){
  142. document.location.href = "ctrl_controladora.estado.list.php?accion=verPeticion&intento="+intento;
  143. }
  144. if (intento == 5 && $('#chkingEstado').val()=="true"){
  145. document.location.href = "ctrl_controladora.estado.list.php?accion=modificarEstados&intento="+intento;
  146. }
  147. }
  148. </script>
  149. </head>
  150. <body style="margin:0px;background:#fff;">
  151. <div class="contenido">
  152. <div id="controles" class="contenido" >
  153. <div id="treecontrol" align="center" style="margin: 1px;">
  154. <a title="" href="#"><button style="font-size: 1px;margin: 1px;"><img src="../images/Bullet-Toggle-Minus-32.png" /></button></a>
  155. <a title="" href="#"><button style="font-size: 1px;margin: 1px;"><img src="../images/Bullet-Toggle-Plus-32.png" /></button></a>
  156. </div>
  157. </div>
  158. <ul id="list" class="treeview-black">
  159. <?php
  160. /*foreach ($data as $key => $row){
  161. echo $key;
  162. echo "<div align='left'><pre>".print_r($row,true)."</pre></div>";
  163. ?>
  164. <?php
  165. }*/
  166. if (count($data) > 0){
  167. foreach ($data->ctr as $ctr){
  168. ?>
  169. <li>
  170. <span>
  171. <?php
  172. echo $ctr->imgEstadoCtrl.$ctr->nombreControladora. "&nbsp;(IPv4: ".$ctr->ipv4." - Nodo: ".$ctr->nodo.")";
  173. echo "&nbsp;&nbsp;&nbsp;".$ctr->chkEstado;
  174. ?>
  175. </span>
  176. <ul>
  177. <li>
  178. <div class="contenido">
  179. <table style="margin: 5px 0px 0px 10px;" cellpadding="0" cellspacing="0" border="0">
  180. <tr>
  181. <td align="left">
  182. <small class="comment" ><b>&Uacute;ltima Petici&oacute;n Enviada</b>: <?php echo ControlCtrlControladora::formatoFecha($ctr->fecha_peticion_estado);?></small>
  183. </td>
  184. </tr>
  185. <tr>
  186. <td align="left">
  187. <small class="comment" ><b>&Uacute;ltima Respuesta Recibida</b>: <?php echo ControlCtrlControladora::formatoFecha($ctr->fecha_respuesta_estado);?></small>
  188. </td>
  189. </tr>
  190. </table>
  191. </div>
  192. </li>
  193. <?php
  194. foreach ($data->reader as $reader){
  195. if ($ctr->idcontroladora == $reader->idcontroladora){
  196. ?>
  197. <li class="closed">
  198. <?php echo $reader->imgEstadoReader.$reader->nombreLectora;?>
  199. </li>
  200. <?php
  201. }
  202. }
  203. ?>
  204. </ul>
  205. </li>
  206. <?php
  207. }
  208. }else{
  209. echo "<div class=\"ui-widget\">\n";
  210. echo " <div class=\"ui-state-error ui-corner-all\" style=\"margin-top: 20px; padding: 0 .7em;\">\n";
  211. echo " <p>\n";
  212. echo " <span class=\"ui-icon ui-icon-alert\" style=\"float: left; margin-right: .3em;\"></span>\n";
  213. echo " No se encontraron registros\n";
  214. echo " </p>\n";
  215. echo " </div>\n";
  216. echo "</div>\n";
  217. echo "<br>&nbsp;\n";
  218. }
  219. ?>
  220. </ul>
  221. </div>
  222. <form method="POST" name="f1" action="#" target="ifrm1">
  223. <input type="hidden" name="accion" id="accion" value="<?php echo $_REQUEST["accion"];?>">
  224. <input type="hidden" name="intento" id="intento" value="<?php echo $_REQUEST["intento"];?>">
  225. <input type="hidden" name="chkingEstado" id="chkingEstado" value="<?php echo $data->chkingEstado;?>">
  226. </form>
  227. </body>
  228. </html>