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

/apertura_cta.php

https://github.com/ejgallegos/tgpcuentas
PHP | 263 lines | 248 code | 15 blank | 0 comment | 4 complexity | 7f47e9e16afa6e60356431923cafff9a 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/aperturaCuenta.php';
  8. require_once 'class/saf.php';
  9. require_once 'class/sectores.php';
  10. require_once 'class/bancos.php';
  11. $obj1 = new Saf();
  12. $saf = $obj1->Ordenar_Saf();
  13. $obj20 = new Sectores();
  14. $sector = $obj20->Ordenar_Sector();
  15. $obj3 = new Bancos();
  16. $banco = $obj3->Ordenar_Banco();
  17. $obj2 = new AperturaCta();
  18. if (isset($_POST["Guardar"]) and $_POST["Guardar"] == "Si") {
  19. $obj4 = new AperturaCta();
  20. $id_acta = $obj4->idActa($_POST["saf"]);
  21. $obj5 = new AperturaCta();
  22. $id_bco = $obj5->idBanco($_POST["banco"]);
  23. $obj6 = new AperturaCta();
  24. $id_sector = $obj6->idSector($_POST["sector"]);
  25. $bco = $id_bco[0]['nombre'];
  26. $saf = $id_acta[0]['servicio'];
  27. $nombre_sector = $id_sector[0]['sector'];
  28. $obj2->Alta_Acta($saf, $nombre_sector, $_POST["sector"], $_POST["denominacion"], $bco);
  29. exit;
  30. }
  31. ?>
  32. <!DOCTYPE html>
  33. <html lang="es">
  34. <head>
  35. <meta charset="utf-8">
  36. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  37. <meta name="viewport" content="width=device-width, initial-scale=1">
  38. <title>Sistema de Padr贸n de Cuentas Oficiales</title>
  39. <link rel="shortcut icon" href="img/favicon.ico"/>
  40. <!-- Bootstrap core CSS -->
  41. <link href="css/bootstrap.css" rel="stylesheet">
  42. <link href="css/bootstrap-theme.css" rel="stylesheet">
  43. <!-- Just for debugging purposes. Don't actually copy this line! -->
  44. <!--[if lt IE 9]><script src="assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
  45. <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
  46. <!--[if lt IE 9]>
  47. <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  48. <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
  49. <![endif]-->
  50. <style type="text/css"> body {padding-bottom: 40px; background-color: #eee; } </style>
  51. </head>
  52. <body>
  53. <div class="container">
  54. <?php include ("partes/nav.php"); ?>
  55. <div class="row">
  56. <div class="col-md-12">
  57. <ul class="breadcrumb" style="margin-bottom: 5px;">
  58. <li><a href="home.php"><span class="glyphicon glyphicon-home"></a></li>
  59. <li>CUENTAS OFICIALES</li>
  60. <li class="active">APERTURA DE CUENTAS</li>
  61. </ul>
  62. </div>
  63. <?php include ("partes/menu.php"); ?>
  64. <div class="col-md-10">
  65. <div class="panel panel-primary">
  66. <div class="panel-heading">
  67. <h3 class="panel-title"><span class="glyphicon glyphicon-chevron-right"></span>&nbsp;Apertura de Cuentas</h3>
  68. </div>
  69. <div class="panel-body">
  70. <form class="form-horizontal" role="form" action="apertura_cta.php" method="POST">
  71. <div class="form-group">
  72. <label class="col-sm-2 control-label">SAF</label>
  73. <div class="col-sm-3">
  74. <select class="form-control" name="saf" onchange="slctryole(this,this.form.sector)" autofocus required title="Debe Seleccionar un SAF">
  75. <option value="">Sin Especificar</option>
  76. <?php
  77. for($i=0;$i<sizeof($saf);$i++){
  78. ?>
  79. <option title="<?php echo $saf[$i]["nombre"]; ?>" value="<?php echo $saf[$i]["cod_ser"]; ?>"> <?php echo $saf[$i]["servicio"]; ?></option>
  80. <?php
  81. }
  82. ?>
  83. </select>
  84. </div>
  85. </div>
  86. <div class="form-group">
  87. <label class="col-sm-2 control-label">Sector</label>
  88. <div class="col-sm-5">
  89. <select class="form-control" name="sector" id="sector" required title="Debe Seleccionar un Sector">
  90. <option value="">Sin Especificar</option>
  91. </select>
  92. </div>
  93. </div>
  94. <div class="form-group">
  95. <label class="col-sm-2 control-label">Denominaci贸n</label>
  96. <div class="col-sm-9">
  97. <input type="text" class="form-control" placeholder="Denominaci贸n" name="denominacion" required title="Ingrese una Denominaci&oacute;n">
  98. </div>
  99. </div>
  100. <div class="form-group">
  101. <label class="col-sm-2 control-label">Banco</label>
  102. <div class="col-sm-5">
  103. <select class="form-control" name="banco" required title="Debe Seleccionar un Banco">
  104. <option value="">Sin Especificar</option>
  105. <?php
  106. for($i=0;$i<sizeof($banco);$i++){
  107. ?>
  108. <option value="<?php echo $banco[$i]["id"]; ?>"> <?php echo $banco[$i]["nombre"]; ?></option>
  109. <?php
  110. }
  111. ?>
  112. </select>
  113. </div>
  114. </div>
  115. <br>
  116. <div class="form-group">
  117. <div class="col-sm-offset-2 col-sm-10">
  118. <button type="submit" class="btn btn-primary">Aceptar</button>
  119. <button type="button" class="btn btn-default" onclick="location='home.php'">Cancelar</button>
  120. <input type="hidden" name="Guardar" value="Si" />
  121. </div>
  122. </div>
  123. </form>
  124. </div>
  125. <div class="panel-footer"><?php include ("partes/footer.php");?></div>
  126. </div>
  127. </div>
  128. </div>
  129. </div> <!-- /container -->
  130. <!-- Bootstrap core JavaScript
  131. ================================================== -->
  132. <!-- Placed at the end of the document so the pages load faster -->
  133. <script src="js/jquery.min.js"></script>
  134. <script src="js/bootstrap.min.js"></script>
  135. <script language='javascript' type='text/javascript'>
  136. function slctr(texto,valor)
  137. {
  138. this.texto = texto
  139. this.valor = valor
  140. }
  141. </script>
  142. <?php
  143. ///////////////////////////////////////////////////////////////////////////////////
  144. // SCRIPT QUE AUTOMATIZA LA SELECCION DE DOS SELECT POR EJ: LOCALIDADES - PCIA
  145. ///////////////////////////////////////////////////////////////////////////////////
  146. echo "<script language='javascript' type='text/javascript'>".chr(13).chr(10);
  147. $varaux= $sector[0]['cod_saf'];
  148. echo "var ".$sector[0]['cod_saf']."=new Array()".chr(13).chr(10);
  149. $cont=0;
  150. //MENSAJE DESPUES DE SELECCIONAR SELECT
  151. //echo $sector[0]['cod_saf']."[$cont] = new slctr('Seleccione Sector','d00')".chr(13).chr(10);
  152. //$cont++;
  153. echo $sector[0]['cod_saf']."[$cont] = new slctr('".trim($sector[0]['sector'])."','".$sector[0]['id']."')";
  154. echo chr(13).chr(10);
  155. //$cont++; GENERA ERROR
  156. for($i=0;$i<sizeof($sector);$i++)
  157. {
  158. if ($sector[$i]['cod_saf']==$varaux)
  159. {
  160. $vcod=$sector[$i]['cod_saf'];
  161. echo $sector[$i]['cod_saf']."[$cont] = new slctr('".trim($sector[$i]['sector'])."','".$sector[$i]['id']."')";
  162. echo chr(13).chr(10);
  163. $cont++;
  164. }
  165. else
  166. {
  167. $varaux=$sector[$i]['cod_saf'];
  168. echo "var ".$sector[$i]['cod_saf']."=new Array()".chr(13).chr(10);
  169. $cont=0;
  170. //MENSAJE DESPUES DE SELECCIONAR SELECT
  171. //echo $sector[$i]['cod_saf']."[$cont] = new slctr('Seleccione Sector','d00')".chr(13).chr(10);
  172. //$cont++;
  173. echo $sector[$i]['cod_saf']."[$cont] = new slctr('".trim($sector[$i]['sector'])."','".$sector[$i]['id']."')";
  174. echo chr(13).chr(10);
  175. $cont++;
  176. }
  177. }
  178. echo "</script>";
  179. ///////////////////////////////////////////////////////////////////////////////////
  180. // SCRIPT QUE AUTOMATIZA LA SELECCION DE DOS SELECT POR EJ: LOCALIDADES - PCIA
  181. ///////////////////////////////////////////////////////////////////////////////////
  182. ?>
  183. <script language='javascript' type='text/javascript'>
  184. function slctryole(cual,donde)
  185. {
  186. if(cual.selectedIndex != 0)
  187. {
  188. donde.length=0
  189. cual = eval(cual.value)
  190. for(m=0;m<cual.length;m++)
  191. {
  192. var nuevaOpcion = new Option(cual[m].texto);
  193. donde.options[m] = nuevaOpcion;
  194. if(cual[m].valor != null)
  195. {
  196. donde.options[m].value = cual[m].valor
  197. }
  198. else
  199. {
  200. donde.options[m].value = cual[m].texto
  201. }
  202. }
  203. }
  204. }
  205. </script>
  206. </body>
  207. </html>
  208. <!--FINALIZA LA SESION-->
  209. <?php
  210. }else
  211. {
  212. echo "<script type='text/javascript'>
  213. alert('Ud debe Iniciar Sesi\u00f3n para acceder a este contenido.');
  214. window.location='index.php';
  215. </script>";
  216. }