editar_horario.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?php
  2. require_once 'class/c_login.php';
  3. if (!isset($_SESSION['user'])) {
  4. header('Location: index.php');
  5. exit;
  6. } else
  7. $user = unserialize($_SESSION['user']);
  8. if (!$user->admin)
  9. header('Location: main.php?error=1');
  10. ?>
  11. <!DOCTYPE html>
  12. <html lang="en">
  13. <head>
  14. <meta charset="UTF-8">
  15. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  16. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  17. <title>Editar Horarios | <?php echo $_SESSION['facultad'] ?? "Administrador"; ?></title>
  18. <link rel="icon" type="image/png" href="imagenes/favicon.png" />
  19. <link rel="stylesheet" href="css/bootstrap-ulsa.min.css" type="text/css">
  20. <link rel="stylesheet" href="css/indivisa.css" type="text/css">
  21. <link rel="stylesheet" href="css/sgi.css?rand=<?php echo rand(); ?>" type="text/css">
  22. </head>
  23. <body>
  24. <?php
  25. include "import/html_header.php";
  26. html_header("Editar Horarios", "Gestión de Checador");
  27. ?>
  28. <!-- Create a schedule design -->
  29. <main class="content marco">
  30. <div class="container-fluid">
  31. <div class="row">
  32. <div class="col-sm-12">
  33. <!-- Nivel select option -->
  34. <div class="form-group">
  35. <label for="nivel">Nivel</label>
  36. <select class="form-control" id="nivel">
  37. <option value="0">Selecciona un nivel</option>
  38. <option value="1">Nivel 1</option>
  39. <option value="2">Nivel 2</option>
  40. <option value="3">Nivel 3</option>
  41. <option value="4">Nivel 4</option>
  42. <option value="5">Nivel 5</option>
  43. <option value="6">Nivel 6</option>
  44. <option value="7">Nivel 7</option>
  45. <option value="8">Nivel 8</option>
  46. <option value="9">Nivel 9</option>
  47. <option value="10">Nivel 10</option>
  48. </select>
  49. </div>
  50. </div>
  51. </div>
  52. <!-- Table Schedule -->
  53. <div class="row">
  54. <div class="col-sm-12">
  55. <table class="table table-bordered table-hover">
  56. <thead>
  57. <tr>
  58. <th scope="col">Hora</th>
  59. <th scope="col">Lunes</th>
  60. <th scope="col">Martes</th>
  61. <th scope="col">Miércoles</th>
  62. <th scope="col">Jueves</th>
  63. <th scope="col">Viernes</th>
  64. <th scope="col">Sábado</th>
  65. <th scope="col">Domingo</th>
  66. </tr>
  67. </thead>
  68. <tbody>
  69. <tr>
  70. <th scope="row">7:00 - 8:00</th>
  71. <!-- Matemáticas Martes id horario: 3 edit -->
  72. <td>
  73. </td>
  74. </tbody>
  75. </table>
  76. </div>
  77. </div>
  78. </div>
  79. </main>
  80. <?php
  81. include "import/html_footer.php";
  82. ?>
  83. </body>
  84. </html>
  85. <?php
  86. function get_horarios($facultad_id): array
  87. {
  88. $dias = array("lun", "mar", "mié", "jue", "vie", "sáb",);
  89. foreach ($dias as $dia) {
  90. $horarios = query(
  91. "SELECT * FROM HORARIO_VIEW
  92. WHERE FACULTAD_ID = :facultad_id AND DIA = :dia
  93. ORDER BY HORA",
  94. array(":facultad_id" => $facultad_id, ":dia" => $dia)
  95. );
  96. foreach ($horarios as $h)
  97. $horario[$dia][] = $h;
  98. }
  99. return $horario;
  100. }
  101. ?>