PageRenderTime 24ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/info_alcancias_registradas.php

https://gitlab.com/juliocesartors/t-rex-proyect
PHP | 119 lines | 57 code | 51 blank | 11 comment | 7 complexity | 30e16984321c407579b2bede3447195a MD5 | raw file
  1. <?php
  2. //VERIFICACION DE CONEXCION
  3. session_start();
  4. if (!(isset($_SESSION['login']) && $_SESSION['login'] != '')) {
  5. header ("Location: index.php");
  6. }
  7. ?>
  8. <!DOCTYPE html>
  9. <?php
  10. require "base.php";?>
  11. <html class="no-js" lang="">
  12. <head>
  13. <meta charset="utf-8">
  14. </head>
  15. <body>
  16. <center>
  17. <?php
  18. /*if ($_SESSION['rol'] != 'Oficina' ) {
  19. header ("Location: 404.html");
  20. }
  21. */
  22. // SE CREA LA CONEXCION A LA BASE DE DATOS DREAMHOST
  23. $conexion = new mysqli("mysql.campanaarquidiocesana.com","mgcdb","proyectosaga","campana_saga");
  24. if($conexion -> connect_error){
  25. die("Error en la conexion!");
  26. }
  27. else {
  28. ?>
  29. <form method="post" action="">
  30. <?php
  31. echo("<u><h2>Consulta de alcancias por parroquias</h2></u><br/>");
  32. }
  33. // OBTENEMOS EL VALOR QUE SE PASA DEL SELECT1 DEL FORMULARIO ALCANCIAS REGISTRADAS
  34. $alcancia = $_POST['select1'];
  35. // SE SELECCIONA DEPENDIENDO DE LA VICARIA Y PARROQUIA ESCOGIDA LA INFORMACION DE LA FAMILIA Y LA ALCANCIA
  36. $result3 = $conexion->query("SELECT `familia`.codigo_alcancia,`familia`.apellido,`familia`.direccion, `alcancia`.codigo_alcancia, `alcancia`.codigo_vicaria, `alcancia`.codigo_parroquia, `alcancia`.fecha_entrega,`alcancia`.fecha_devolucion
  37. FROM `familia` INNER JOIN `alcancia` ON `familia`.codigo_alcancia = `alcancia`.codigo_alcancia WHERE `alcancia`.codigo_alcancia ='{$alcancia}'" );
  38. // SE IMPRIME EN UNA TABLA A TRAVÉS DE UN ARREGLO
  39. if ($result3->num_rows > 0 ) {
  40. echo "<strong>Alcancias registrada ".$alcancia."</strong><br/><br>";
  41. echo '<div id="div1"><table id="testTable" class="scroll" > <tr> <th>Codigo de Alcancia</th><th>Familia</th><th>Dirección</th><th>Fecha de Entrega</th><th>Fecha de Devolución</th></tr>';
  42. while($row2= $result3->fetch_assoc()) {
  43. echo "<tr><td>".$row2["codigo_alcancia"]."</td><td>".$row2["apellido"]."</td><td>".$row2["direccion"]."</td><td>".$row2["fecha_entrega"]."</td><td>".$row2["fecha_devolucion"]."</td></tr>";
  44. }
  45. echo '</table></div>';
  46. } else {
  47. echo "0 Resultados.";
  48. }
  49. $conexion->close();
  50. ?>
  51. <br>
  52. <br>
  53. <br>
  54. <!--BOTON DE ACCION -->
  55. <div class="imagenes">
  56. <a href="consultar.php"> <button class= "icon" name="submit" type="submit" style='width:70px; height:50px' ><img src="css/fondos/checkmark.png"></button> </a>
  57. <button class= "icon" name="reset" type="reset" style='width:70px; height:50px' ><img src="css/fondos/cross.png"></button>
  58. <br/> <a href="consultar.php"></a>
  59. </div>
  60. </form> <br>
  61. </body>
  62. <center>
  63. </html>
  64. <?php
  65. require "footer.html";
  66. ?>