PageRenderTime 34ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/informecoordinador.php

https://gitlab.com/juliocesartors/t-rex-proyect
PHP | 153 lines | 87 code | 54 blank | 12 comment | 10 complexity | 8a3d1fc634abfd7cfc5259d902be4dd0 MD5 | raw file
  1. <?php
  2. session_start();
  3. if (!(isset($_SESSION['login']) && $_SESSION['login'] != '')) {
  4. header ("Location: index.php");
  5. }
  6. if ($_SESSION['rol'] =='visitador' || $_SESSION['rol'] == 'Oficina') {
  7. header ("Location: 404.html");
  8. }
  9. ?>
  10. <!doctype html>
  11. <!-- LLAMA A LA BASE DE CSS PARA DAR ESTILO -->
  12. <?php
  13. require "base_parroco_coordinador.php";
  14. ?>
  15. <html>
  16. <head>
  17. <style>
  18. table, th, td {
  19. border: 1px solid black;
  20. }
  21. th{
  22. background: gray;
  23. /*position:fixed; */
  24. }
  25. table.scroll {
  26. /*width: 100%;
  27. border-collapse: collapse; */
  28. border-spacing: 0;
  29. /*border: 2px solid black;*/
  30. }
  31. table.scroll tbody,
  32. table.scroll thead { display: inline-block;}
  33. thead tr th {
  34. height: 30px;
  35. line-height: 30px;
  36. /*text-align: left;*/
  37. }
  38. table.scroll tbody {
  39. height: 250px;
  40. overflow-y: auto;
  41. overflow-x: hidden;
  42. }
  43. tbody { /*border-top: 2px solid black;*/ }
  44. tbody td, thead th {
  45. width: 20%; /* Optional */
  46. /*border-right: 1px solid black;*/
  47. }
  48. tbody td:last-child, thead th:last-child {
  49. border-right: none;
  50. }
  51. </style>
  52. </head>
  53. <body>
  54. <center>
  55. <div id="contenedor2">
  56. <div id="contenedor3">
  57. <div id="tabla">
  58. <?php
  59. /*
  60. se muestra informacion del status actual de las alcancías, los cuales son:
  61. alcancia disponible, alcancia devuelta, y 'hoy es el dia de entrega'
  62. */
  63. $conexion = new mysqli("mysql.campanaarquidiocesana.com","mgcdb","proyectosaga","campana_saga");
  64. if($conexion -> connect_error){
  65. die("Error en la conexion!");
  66. }
  67. else {
  68. echo("<u><h2>Informe sobre el estatus de las alcancías </h2></u><br/>");
  69. }
  70. $vicaria = $_SESSION['vicaria'];
  71. $parroquia = $_SESSION['parroquia'];
  72. $sql = "SELECT `familia`.codigo_alcancia, `alcancia`.codigo_alcancia, `alcancia`.codigo_vicaria, `alcancia`.codigo_parroquia, `alcancia`.estado
  73. FROM `familia` INNER JOIN `alcancia` ON `familia`.codigo_alcancia = `alcancia`.codigo_alcancia WHERE `alcancia`.codigo_vicaria = '$vicaria' AND `alcancia`.codigo_parroquia = '$parroquia'";
  74. $result = $conexion->query($sql);
  75. if ($result->num_rows > 0) {
  76. echo '<table id="testTable" class="scroll"> <tr> <th>Codigo de Alcancia</th> <th>Codigo de Parroquia</th> <th>Codigo de Vicaria</th> <th>Estado de la alcancía</th> </tr>';
  77. while($row = $result->fetch_assoc()) {
  78. echo "<tr><td>".$row["codigo_alcancia"]."</td><td>".$row["codigo_parroquia"]."</td><td>".$row["codigo_vicaria"]."</td><td>".$row["estado"]."</td></tr>";
  79. }
  80. echo '</table>';
  81. } else {
  82. echo "0 Resultados.";
  83. }
  84. $conexion->close();
  85. ?>
  86. </div>
  87. <br>
  88. <!-- <button class= "boton" type="button" onclick="tableToExcel('testTable', 'W3C Example Table')" style='width:35%; height:10%'>Guardar en Excel <img src="css/fondos/save.png"> </button>
  89. <br/> <a href="#"><img class="scrollup" src="img/arrowtop.png"/></a> -->
  90. <br>
  91. </div>
  92. </div>
  93. </body>
  94. </html>
  95. <?php
  96. require "footer.html";
  97. ?>