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

/segmento/view/segmento.Acc.php

https://gitlab.com/talueses/SIPVE
PHP | 175 lines | 123 code | 8 blank | 44 comment | 13 complexity | b179df9da0f59610af30d100bf5d4f66 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. * Formulario de acciones agregar, modificar y visualizar datos
  41. * @author David Concepcion
  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/segmento.control.op.php";// Class CONTROLLER
  52. if ($_REQUEST["accion"] == "modificar" || $_REQUEST["accion"] == "visualizar"){
  53. $obj = new Segmentos();
  54. $data = $obj->get_Segmento($_REQUEST["idsegmento"]);
  55. if (!$data ){
  56. echo $obj->getMensaje();
  57. }
  58. }
  59. $disabled = "";
  60. if ($_REQUEST["accion"] == "visualizar"){
  61. $disabled = "disabled";
  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 href="../../inicio/css/comunes.css" rel="stylesheet" type="text/css" />
  69. <script type="text/javascript" src="../../inicio/js/jquery.js"></script>
  70. <script type="text/javascript" src="../../inicio/js/jquery-ui.min.js"></script>
  71. <script type="text/javascript" src="../../inicio/js/jquery.textarea.maxlength.js"></script>
  72. <style type="text/css">
  73. .list{
  74. color: #000000;
  75. font-style: oblique;
  76. background-color: #f0ebe2;
  77. width: 300px;
  78. border: 1px solid #ccc0a9;
  79. }
  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. #titulo{
  94. height: 20px;
  95. 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;
  96. -moz-border-radius: 6px;
  97. -webkit-border-radius: 6px;
  98. border-radius: 6px;
  99. }
  100. #datos{
  101. width: 500px;
  102. background:#fff;
  103. margin: 5px 1px 0px 1px;
  104. padding: 5px;
  105. border: #aaaaaa solid 1px;
  106. -moz-border-radius: 6px;
  107. -webkit-border-radius: 6px;
  108. border-radius: 6px;
  109. }
  110. #botones{
  111. margin: 10px;
  112. }
  113. </style>
  114. <script type="text/javascript" language="javascript">
  115. $(function() {
  116. $( "input:button, input:submit,button" ).button();
  117. });
  118. </script>
  119. </head>
  120. <body style="margin:0px;background:#ddd;">
  121. <div id="contenido" align="center">
  122. <?php
  123. if (!Controller::chkPermiso($_SESSION["usuario"], CATEGORIA,$_REQUEST["accion"])){
  124. echo Controller::$mensajePermisos;
  125. }else{
  126. ?>
  127. <div id="titulo" style="padding: 5px" ><?php echo ucfirst($_REQUEST["accion"] );?> Segmento</div>
  128. <br/>
  129. <div id="divmensaje" style="width:99%;"></div>
  130. <iframe name="ifrm1" id="ifrm1" frameborder="0" width="0" height="0" scrolling="no"></iframe>
  131. <form method="POST" name="f1" action="segmento.Op.php" target="ifrm1">
  132. <div id="datos" align="center">
  133. <table>
  134. <tr title="Segmento">
  135. <td align="right">Segmento:</td>
  136. <td>
  137. <input type="text" name="segmento" id="segmento" maxlength="50" value="<?php echo $data->segmento;?>" <?php echo $disabled;?>>
  138. </td>
  139. </tr>
  140. <tr title="Descripcion">
  141. <td align="right" valign="top">Descripci&oacute;n:</td>
  142. <td>
  143. <div class="divTextarea" >
  144. <textarea name="descripcion" id="descripcion" <?php echo $disabled;?> rows="6" cols="28" maxlength="100" <?php echo $disabled;?>><?php echo $data->descripcion;?></textarea>
  145. <div class="charLeftDiv" align="right"><input type="text" class="charLeft" id="charLeft_descripcion" size="4" readonly > Caracteres Restantes</div>
  146. </div>
  147. <!--input type="text" name="descripcion" id="descripcion" maxlength="100" value="<?php echo $data->descripcion;?>" <?php echo $disabled;?>-->
  148. </td>
  149. </tr>
  150. </table>
  151. </div>
  152. <div id="botones" style="clear:left">
  153. <input type="hidden" name="accion" id="accion" value="<?php echo $_REQUEST["accion"];?>">
  154. <input type="hidden" name="idsegmento" id="idsegmento" value="<?php echo $data->idsegmento ?>">
  155. <?php
  156. if ($_REQUEST["accion"] == "agregar" || $_REQUEST["accion"] == "modificar"){
  157. echo "<input type=\"submit\" value=\"".ucfirst($_REQUEST["accion"])." Segmento\" />";
  158. }
  159. ?>
  160. </div>
  161. </form>
  162. <?php
  163. }
  164. ?>
  165. </div>
  166. </body>
  167. </html>