kike0001

cuentas.php

Dec 10th, 2017
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.63 KB | None | 0 0
  1. <?php require 'libs/conexion.php' ?>
  2. <?php
  3.     $idc = $_GET['idc'];
  4.     $sql  = 'SELECT idcuenta, saldo, idtipocuenta, estado ';
  5.     $sql .= 'FROM cuentas ';
  6.     $sql .= 'WHERE idcliente = ?';
  7.  
  8.     $data = $cnn->prepare($sql);
  9.     $data->bind_param('i', $idc);
  10.     $data->execute();
  11.     $data->bind_result($id, $saldo, $idtipocuenta, $estado);
  12.     $data->store_result();
  13. ?>
  14. <!DOCTYPE html>
  15. <html lang="en">
  16. <head>
  17.     <meta charset="UTF-8">
  18.     <title>Banco App v2.0.0</title>
  19.     <link rel="stylesheet" href="static/bootstrap/css/bootstrap.css">
  20.     <link rel="stylesheet" href="static/x-editable/css/bootstrap-editable.css">
  21. </head>
  22. <body>
  23.     <div class="container">
  24.         <!--Pone un sobre, sale del bootstrap !-->
  25.         <h1 class="well">Aplicación banco</h1>
  26.         <div class="col-sm-5">
  27.             <div class="row">
  28.                 <!--Se va a controlar el elemento submit a travez del id del form que será frmClient, programado desde app.js!-->
  29.                 <form id="frmCliente" action="scripts/insert.php" class="form-horizontal" method = 'post'>
  30.                     <!--div.form-group>(labl+div.col-sm-10) !-->
  31.                     <div class="form-group">
  32.                         <label class="col-sm-2 control-label" for="nombre">
  33.                             Tipo de cuenta
  34.                         </label>
  35.                         <div class="col-sm-10">
  36.                             <input required name = "nombre" id="nombre" type="text" class="form-control">
  37.                         </div>
  38.                     </div>
  39.  
  40.                     <div class="form-group">
  41.                         <!--Si el for = "nombre" el id del input también tiene que ser "nombre" !-->
  42.                         <label class="col-sm-2 control-label" for="apellidos">
  43.                             Saldo
  44.                         </label>
  45.                         <div class="col-sm-10">
  46.                             <input required name = "apellidos" id="apellidos" type="text" class="form-control">
  47.                         </div>
  48.                     </div>
  49.  
  50.                     <div class="form-group">
  51.                         <!--Si el for = "nombre" el id del input también tiene que ser "nombre" !-->
  52.                         <label class="col-sm-2 control-label" for="correo">
  53.                             Estado
  54.                         </label>
  55.                         <div class="col-sm-10">
  56.                             <input name = "correo" id="correo" type="email" class="form-control">
  57.                         </div>
  58.                     </div>
  59.  
  60.                     <div class="form-group">
  61.                         <div class="col-sm-offset-2 col-sm-10 ">
  62.                             <button type = "submit" class = "btn btn-success">
  63.                                 Guardar
  64.                             </button>
  65.                         </div>
  66.                     </div>
  67.                 </form>
  68.             </div>
  69.         </div>
  70.  
  71.         <div class="col-sm-1"></div>
  72.  
  73.         <div class="col-sm-6">
  74.             <!--El table es un cotenedor... y tienen otro contenedor que se llama thead y tiene otro contenedor de columnas que llama tr!-->
  75.             <table class="table">
  76.                 <thead>
  77.                     <tr>
  78.                         <th>ID</th>
  79.                         <th>Saldo</th>
  80.                         <th>Tipo</th>
  81.                         <th>TipoCuenta</th>
  82.                         <th>Acción</th>
  83.                     </tr>
  84.                 </thead>
  85.                 <tbody id = "rows">
  86.                     <?php while($data->fetch()): ?>
  87.                         <tr>
  88.                             <td><?php echo $id ?></td>
  89.                             <!--El span lo utilizó para poder actualizar, despues de haber depositado o retirado !-->
  90.                             <td><span id = "saldo<?php echo $id ?>"><?php echo $saldo ?></span></td>
  91.                             <td><?php echo $idtipocuenta ?></td>
  92.                             <td><?php echo $estado ?></td>
  93.                             <td >
  94.                                 <button data-accion="d" data-pk="<?php echo $id ?>" class="btn btn-primary btn-sm btn-accion">
  95.                                     D
  96.                                 </button>
  97.                                 <button data-accion="r" data-pk="<?php echo $id ?>" class="btn btn-success btn-sm btn-accion">
  98.                                     R
  99.                                 </button>
  100.                             </td>                          
  101.                         </tr>
  102.                     <?php endwhile?>
  103.                 </tbody>
  104.             </table>
  105.         </div>
  106.     </div>
  107.  
  108.  
  109.     <script src="static/js/jquery.min.js"></script>
  110.     <script src="static/bootstrap/js/bootstrap.js"></script>
  111.     <script src="static/x-editable/js/bootstrap-editable.min.js"></script>
  112.     <script src="static/js/jquery.mockjax.min.js"></script>
  113.     <script src="static/js/app.js"></script>
  114. </body>
  115. </html>
Add Comment
Please, Sign In to add comment