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

/a_cuenta.php

https://github.com/ejgallegos/tgpcuentas
PHP | 316 lines | 289 code | 14 blank | 13 comment | 11 complexity | 28687e233cd37d46f050b65f9ea12242 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-3-Clause
  1. <?php
  2. require_once("class/class.php");
  3. require_once("class/class_usuarios.php");
  4. if ($_SESSION["session_user"] and $_SESSION["session_perfil"]) {
  5. $obj = new Usuarios();
  6. $perfil = $obj->get_permisos_por_id();
  7. require_once 'class/cuentas.php';
  8. require_once 'class/saf.php';
  9. require_once 'class/firmantes.php';
  10. $obj3= new Saf();
  11. $saf = $obj3->Ordenar_Saf();
  12. if (!empty($_GET["id"])) {
  13. $id = $_GET["id"];
  14. $obj1 = new Cuentas();
  15. $row = $obj1->idCuenta($id);
  16. }
  17. if (isset($_POST["Guardar"]) AND $_POST["Guardar"]=="Si") {
  18. $obj2 = new Cuentas();
  19. $obj2->altaCuenta($_POST["id"], $_POST["tipo"], $_POST["nro_cta"], $_POST["acto_adm"], $_POST["fecha_acto"], $_POST["observacion"]);
  20. }
  21. ?>
  22. <!DOCTYPE html>
  23. <html lang="es">
  24. <head>
  25. <meta charset="utf-8">
  26. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  27. <meta name="viewport" content="width=device-width, initial-scale=1">
  28. <title>Sistema de Padrč´¸n de Cuentas Oficiales</title>
  29. <link rel="shortcut icon" href="img/favicon.ico"/>
  30. <!-- Bootstrap core CSS -->
  31. <link href="css/bootstrap.css" rel="stylesheet">
  32. <link href="css/bootstrap-theme.css" rel="stylesheet">
  33. <link href="css/datepicker.css" rel="stylesheet">
  34. <!-- Just for debugging purposes. Don't actually copy this line! -->
  35. <!--[if lt IE 9]><script src="assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
  36. <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
  37. <!--[if lt IE 9]>
  38. <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  39. <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
  40. <![endif]-->
  41. <style type="text/css"> body {padding-bottom: 40px; background-color: #eee; } </style>
  42. </head>
  43. <body>
  44. <div class="container">
  45. <?php include ("partes/nav.php"); ?>
  46. <div class="row">
  47. <div class="col-md-12">
  48. <ul class="breadcrumb" style="margin-bottom: 5px;">
  49. <li><a href="home.php"><span class="glyphicon glyphicon-home"></a></li>
  50. <li>CUENTAS OFICIALES</li>
  51. <li><a href="alta_cuentas.php">ALTA DE CUENTAS</a></li>
  52. <li class="active">RESOLUCION DE CUENTA</li>
  53. </ul>
  54. </div>
  55. <?php include ("partes/menu.php"); ?>
  56. <div class="col-md-10">
  57. <div class="panel panel-primary">
  58. <div class="panel-heading">
  59. <h3 class="panel-title"><span class="glyphicon glyphicon-chevron-right"></span>&nbsp;Resoluci&oacute;n de Cuenta</h3>
  60. </div>
  61. <div class="panel-body">
  62. <form class="form-horizontal" role="form" action="#">
  63. <div class="form-group">
  64. <label class="col-sm-2 control-label">SAF</label>
  65. <div class="col-sm-3">
  66. <input type="text" class="form-control" readonly value="<?php echo $row[0]['saf']; ?>">
  67. </div>
  68. </div>
  69. <div class="form-group">
  70. <label class="col-sm-2 control-label">Sector</label>
  71. <div class="col-sm-5">
  72. <input type="text" class="form-control" readonly value="<?php echo $row[0]['sector']; ?>">
  73. </div>
  74. </div>
  75. <div class="form-group">
  76. <label class="col-sm-2 control-label">Denominacič´¸n</label>
  77. <div class="col-sm-9">
  78. <input type="text" class="form-control" readonly value='<?php echo $row[0]['denominacion']; ?>' name="denominacion">
  79. </div>
  80. </div>
  81. <div class="form-group">
  82. <label class="col-sm-2 control-label">Banco</label>
  83. <div class="col-sm-5">
  84. <input type="text" class="form-control" readonly value="<?php echo $row[0]['banco']; ?>">
  85. </div>
  86. </div>
  87. </form>
  88. <hr>
  89. <form action="a_cuenta.php" method="POST" class="form-horizontal">
  90. <div class="form-group">
  91. <label class="col-sm-2 control-label">Tipo de Cuenta</label>
  92. <div class="col-sm-5">
  93. <select class="form-control" name="tipo" required autofocus title="Seleccione un Tipo de Cuenta">
  94. <option value="">Sin Especificar</option>
  95. <option value="OPERATIVA">OPERATIVA</option>
  96. <option value="CTA. UNICA">CTA. UNICA</option>
  97. </select>
  98. </div>
  99. </div>
  100. <div class="form-group">
  101. <label class="col-sm-2 control-label">Nro. Cuenta</label>
  102. <div class="col-sm-5">
  103. <input type="text" class="form-control" value="" placeholder="Nro. de Cuenta" name="nro_cta" required title="Ingrese el Nro. de Cuenta">
  104. </div>
  105. </div>
  106. <?php
  107. if (isset($_GET["error"]) AND $_GET["error"]==2) {
  108. ?>
  109. <div class="form-group">
  110. <label class="col-sm-2 control-label">&nbsp;</label>
  111. <div class="col-sm-5">
  112. <div class="alert alert-danger alert-dismissable">
  113. <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
  114. <strong>El Nro. de Cuenta: <?php echo $_GET['cta']; ?> Ya existe!</strong>
  115. </div>
  116. </div>
  117. </div>
  118. <div class="form-group">
  119. <label class="col-sm-2 control-label">Acto Administrativo</label>
  120. <div class="col-sm-5">
  121. <input type="text" class="form-control" value="<?php echo $_GET['aa'];?>" name="acto_adm" required title="Ingrese el Acto Administrativo">
  122. </div>
  123. </div>
  124. <div class="form-group">
  125. <label class="col-sm-2 control-label">Fecha Acto</label>
  126. <div class="col-sm-3">
  127. <div class="input-append date" id="dp3" data-date="" data-date-format="yyyy/mm/dd">
  128. <div class="input-group">
  129. <input class="form-control" type="text" value="<?php echo $_GET["fa"]; ?>" name="fecha_acto" required placeholder="aaaa/mm/dd" title="Ingrese la Fecha del Acto">
  130. <span class="input-group-btn">
  131. <button class="btn btn-default" type="button"><span class="add-on"><span class="glyphicon glyphicon-calendar"></span></span></button>
  132. </span>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. <?php
  138. }else
  139. {
  140. ?>
  141. <div class="form-group">
  142. <label class="col-sm-2 control-label">Acto Administrativo</label>
  143. <div class="col-sm-5">
  144. <input type="text" class="form-control" value="" placeholder="Acto Administrativo" name="acto_adm" required title="Ingrese el Acto Administrativo">
  145. </div>
  146. </div>
  147. <div class="form-group">
  148. <label class="col-sm-2 control-label">Fecha Acto</label>
  149. <div class="col-sm-3">
  150. <div class="input-append date" id="dp3" data-date="" data-date-format="yyyy/mm/dd">
  151. <div class="input-group">
  152. <input class="form-control" type="text" value="" name="fecha_acto" required placeholder="aaaa/mm/dd" title="Ingrese la Fecha del Acto">
  153. <span class="input-group-btn">
  154. <button class="btn btn-default" type="button"><span class="add-on"><span class="glyphicon glyphicon-calendar"></span></span></button>
  155. </span>
  156. </div>
  157. </div>
  158. </div>
  159. </div>
  160. <div class="form-group">
  161. <label class="col-sm-2 control-label">Observaciones</label>
  162. <div class="col-sm-5">
  163. <textarea class="form-control" placeholder="Observaciones" type="text" name="observacion" value=""></textarea>
  164. </div>
  165. </div>
  166. <?php
  167. }
  168. ?>
  169. <div class="form-group">
  170. <div class="col-sm-offset-2 col-sm-10">
  171. <button type="submit" class="btn btn-primary">Aceptar</button>
  172. <button type="button" class="btn btn-default" onclick="location='alta_cuentas.php'">Cancelar</button>
  173. <input type="hidden" name="Guardar" value="Si">
  174. <input type="hidden" name="id" value="<?php echo $row[0]["id"]; ?>">
  175. </div>
  176. </div>
  177. </form>
  178. </div>
  179. <div class="panel-footer"><?php include ("partes/footer.php");?></div>
  180. </div>
  181. </div>
  182. </div>
  183. </div> <!-- /container -->
  184. <!-- Bootstrap core JavaScript
  185. ================================================== -->
  186. <!-- Placed at the end of the document so the pages load faster -->
  187. <script src="js/jquery.min.js"></script>
  188. <script src="js/bootstrap.min.js"></script>
  189. <script type="text/javascript" src="js/bootstrap-datepicker.js" charset="UTF-8"></script>
  190. <script>
  191. $('#dp3').datepicker();
  192. </script>
  193. <script language='javascript' type='text/javascript'>
  194. function slctr(texto,valor)
  195. {
  196. this.texto = texto
  197. this.valor = valor
  198. }
  199. </script>
  200. <?php
  201. ///////////////////////////////////////////////////////////////////////////////////
  202. // SCRIPT QUE AUTOMATIZA LA SELECCION DE DOS SELECT POR EJ: LOCALIDADES - PCIA
  203. ///////////////////////////////////////////////////////////////////////////////////
  204. echo "<script language='javascript' type='text/javascript'>".chr(13).chr(10);
  205. $varaux= $sector[0]['cod_saf'];
  206. echo "var ".$sector[0]['cod_saf']."=new Array()".chr(13).chr(10);
  207. $cont=0;
  208. //MENSAJE DESPUES DE SELECCIONAR SELECT
  209. //echo $sector[0]['cod_saf']."[$cont] = new slctr('Seleccione Sector','d00')".chr(13).chr(10);
  210. //$cont++;
  211. echo $sector[0]['cod_saf']."[$cont] = new slctr('".trim($sector[0]['sector'])."','".$sector[0]['id']."')";
  212. echo chr(13).chr(10);
  213. //$cont++; GENERA ERROR
  214. for($i=0;$i<sizeof($sector);$i++)
  215. {
  216. if ($sector[$i]['cod_saf']==$varaux)
  217. {
  218. $vcod=$sector[$i]['cod_saf'];
  219. echo $sector[$i]['cod_saf']."[$cont] = new slctr('".trim($sector[$i]['sector'])."','".$sector[$i]['id']."')";
  220. echo chr(13).chr(10);
  221. $cont++;
  222. }
  223. else
  224. {
  225. $varaux=$sector[$i]['cod_saf'];
  226. echo "var ".$sector[$i]['cod_saf']."=new Array()".chr(13).chr(10);
  227. $cont=0;
  228. //MENSAJE DESPUES DE SELECCIONAR SELECT
  229. //echo $sector[$i]['cod_saf']."[$cont] = new slctr('Seleccione Sector','d00')".chr(13).chr(10);
  230. //$cont++;
  231. echo $sector[$i]['cod_saf']."[$cont] = new slctr('".trim($sector[$i]['sector'])."','".$sector[$i]['id']."')";
  232. echo chr(13).chr(10);
  233. $cont++;
  234. }
  235. }
  236. echo "</script>";
  237. ///////////////////////////////////////////////////////////////////////////////////
  238. // SCRIPT QUE AUTOMATIZA LA SELECCION DE DOS SELECT POR EJ: LOCALIDADES - PCIA
  239. ///////////////////////////////////////////////////////////////////////////////////
  240. ?>
  241. <script language='javascript' type='text/javascript'>
  242. function slctryole(cual,donde)
  243. {
  244. if(cual.selectedIndex != 0)
  245. {
  246. donde.length=0
  247. cual = eval(cual.value)
  248. for(m=0;m<cual.length;m++)
  249. {
  250. var nuevaOpcion = new Option(cual[m].texto);
  251. donde.options[m] = nuevaOpcion;
  252. if(cual[m].valor != null)
  253. {
  254. donde.options[m].value = cual[m].valor
  255. }
  256. else
  257. {
  258. donde.options[m].value = cual[m].texto
  259. }
  260. }
  261. }
  262. }
  263. </script>
  264. </body>
  265. </html>
  266. <!--FINALIZA LA SESION-->
  267. <?php
  268. }else
  269. {
  270. echo "<script type='text/javascript'>
  271. alert('Ud debe Iniciar Sesi\u00f3n para acceder a este contenido.');
  272. window.location='index.php';
  273. </script>";
  274. }