PageRenderTime 51ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/vidcamara/view/camarasOp.php

https://gitlab.com/talueses/SIPVE
PHP | 141 lines | 88 code | 7 blank | 46 comment | 8 complexity | c78f79ff68adeda2f637a67779966e58 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. *
  17. * This program is free software: you can redistribute it and/or modify
  18. * it under the terms of the GNU General Public License as published by
  19. * the Free Software Foundation, either VERSION 3 of the License, or
  20. * (at your option) any later version.
  21. *
  22. * This program is distributed in the hope that it will be useful,
  23. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. * GNU General Public License for more details.
  26. *
  27. * You should have received a copy of the GNU General Public License
  28. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  29. *
  30. * Para mas información visite
  31. * @link http://repositorio.softwarelibre.gob.ve/ - RNA
  32. * @link http://sourceforge.net/projects/sipve/ - SourceForge
  33. *
  34. \*******************************************************************************/
  35. ?>
  36. <?php
  37. /*
  38. * Autor David Concepcion 16-09-2010 CENIT
  39. * Ejecucion de operaciones agregar, modificar y eliminar datos
  40. *
  41. * Modificado por David Concepcion 21-09-2010 CENIT
  42. * Aumento de tiempo de redirección
  43. *
  44. * Modificado por David Concepcion 07-10-2010 CENIT
  45. * Mensaje Cargando...
  46. */
  47. session_start(); // start up your PHP session!
  48. //echo "<div align='left'><pre>".print_r($_POST,true)."</pre></div>";
  49. //sleep('1');
  50. if(!isset($_SESSION['usuario'])){
  51. echo "Sesión vencida. Recargue la página para iniciar la sesión.";
  52. return false;
  53. }
  54. header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
  55. header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
  56. require_once "../controller/camaras_vid_camara.control.php";
  57. $camara = new ControlCamara();
  58. $camara ->setAccion($_POST["accion"]);
  59. if ($_POST["accion"]=="agregar" || $_POST["accion"]=="modificar"){
  60. $exito = $camara->setCamara();
  61. }
  62. if ($_POST["accion"]=="eliminar"){
  63. $exito = $camara->eliminarCamara();
  64. }
  65. if ($_POST["accion"]=="ajaxZonaCamara"){
  66. $camara ->setAccion("modificar");
  67. $_POST["idzona"] = explode(",", $_POST["idzona"]);
  68. $exito = $camara->setZonas();
  69. }
  70. ?>
  71. <html>
  72. <head>
  73. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  74. <title><?php echo ucfirst($_POST["accion"]);?> Servidores Grabadores de Video</title>
  75. <link href="../../inicio/css/comunes.css" rel="stylesheet" type="text/css" />
  76. <link type="text/css" href="../../inicio/css/jquery-ui.css" rel="stylesheet" />
  77. <script type="text/javascript" src="../../inicio/js/jquery.js"></script>
  78. <script type="text/javascript" src="../../inicio/js/jquery-ui.min.js"></script>
  79. <style type="text/css">
  80. #contenido{
  81. float:left;
  82. width:99%;
  83. height:95%;
  84. padding: 2px;
  85. border: #aaaaaa solid 1px;
  86. overflow-x:hidden
  87. width:95%;
  88. background:#fff;
  89. -moz-border-radius: 6px;
  90. -webkit-border-radius: 6px;
  91. border-radius: 6px;
  92. }
  93. </style>
  94. <script type="text/javascript" language="javascript">
  95. $(function() {
  96. <?php
  97. echo "var mensaje = \"".$camara->mensaje."\";\n";
  98. echo "var str;\n";
  99. if($exito){
  100. echo "str = '<div class=\"ui-widget\">';\n";
  101. echo "str += ' <div class=\"ui-state-highlight ui-corner-all\" style=\"margin-top: 20px; padding: 0 .7em;\">';\n";
  102. echo "str += ' <p>';";
  103. echo "str += ' <span class=\"ui-icon ui-icon-info\" style=\"float: left; margin-right: .3em;\"></span>';\n";
  104. echo "str += ' '+mensaje;\n";
  105. echo "str += ' </p>';\n";
  106. echo "str += ' </div>';\n";
  107. echo "str += '</div>';\n";
  108. }
  109. if(!$exito){
  110. echo "str = '<div class=\"ui-widget\">';\n";
  111. echo "str += ' <div class=\"ui-state-error ui-corner-all\" style=\"margin-top: 20px; padding: 0 .7em;\">';\n";
  112. echo "str += ' <p>';\n";
  113. echo "str += ' <span class=\"ui-icon ui-icon-alert\" style=\"float: left; margin-right: .3em;\"></span>';\n";
  114. echo "str += ' '+mensaje;\n";
  115. echo "str += ' </p>';\n";
  116. echo "str += ' </div>';\n";
  117. echo "str += '</div>';\n";
  118. }
  119. echo "$('#divmensaje').html(str);\n";
  120. echo "$('#divmensaje',parent.document).html(str);\n";
  121. if($exito){
  122. echo "setTimeout('top.location.href=\"../../inicio/view/index.php?op=Camaras\";', 5*1000 );";
  123. }
  124. ?>
  125. });
  126. </script>
  127. </head>
  128. <body onload="parent.hideLoading();" style="margin:0px;background:#ddd;">
  129. <div id="contenido" align="center">
  130. <br>&nbsp;<br>&nbsp;
  131. <div id="divmensaje" style="width:99%;"></div>
  132. </div>
  133. </body>
  134. </html>