horario_profesor.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?php
  2. require_once 'class/c_login.php';
  3. $user = Login::get_user();
  4. $user->access();
  5. if (in_array($user->acceso, ['n']))
  6. die(header('Location: main.php?error=1'));
  7. $user->print_to_log('Consultar horario');
  8. $write = $user->admin || in_array($user->acceso, ['w']);
  9. // var_dump($user);
  10. ?>
  11. <!DOCTYPE html>
  12. <html lang="en">
  13. <head>
  14. <title>Consultar horario | <?= $user->facultad['facultad'] ?? 'General' ?></title>
  15. <meta charset="utf-8">
  16. <meta http-equiv="content-type" content="text/plain; charset=UTF-8" />
  17. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  18. <?php include_once "import/html_css_files.php"; ?>
  19. <script src="js/scrollables.js" defer></script>
  20. <script src="js/jquery.min.js" defer></script>
  21. <script src="js/bootstrap/bootstrap.min.js" defer></script>
  22. <script src="js/messages.js" defer></script>
  23. <script>
  24. const write = <?= $write ? 'true' : 'false' ?>;
  25. </script>
  26. <script src="js/moment.js" defer></script>
  27. <script src="js/horario_profesor.js" defer></script>
  28. </head>
  29. <!-- -->
  30. <body style="display: block;">
  31. <?php
  32. include('include/constantes.php');
  33. include("import/html_header.php");
  34. html_header("Consultar horario", "Sistema de gestión de checador");
  35. ?>
  36. <?= "<!-- $user -->" ?>
  37. <main class="container content marco content-margin" id="local-app">
  38. <section id="message"></section>
  39. <?php require('import/periodo.php') ?>
  40. <form id="form" class="form-horizontal">
  41. <div class="form-group">
  42. <div class="form-box">
  43. <input type="hidden" name="periodo" value="<?= $user->periodo_id ?>" />
  44. <div class="form-group row">
  45. <label for="clave_profesor" class="col-4 col-form-label">Profesor</label>
  46. <div class="col-6">
  47. <input list="lista_profesores" name="clave_profesor" id="clave_profesor" class="form-control" placeholder="Profesor" required="required">
  48. <div class="valid-feedback">
  49. Profesor encontrado
  50. </div>
  51. <div class="invalid-feedback">
  52. Profesor no encontrado
  53. </div>
  54. <datalist id="lista_profesores">
  55. <?php
  56. $profesores = $db->where('facultad_id', $user->facultad['facultad_id'])->get("fs_profesor");
  57. foreach ($profesores as $profesor) {
  58. extract($profesor);
  59. ?>
  60. <option data-grado="<?= $grado ?>" data-clave="<?= $clave ?>" data-profesor="<?= $profesor ?>" data-id="<?= $id; ?>" value="<?= "$clave | $grado $profesor" ?>"></option>
  61. <?php
  62. }
  63. ?>
  64. </datalist>
  65. <ul class="list-group" id="profesores"></ul>
  66. <input type="hidden" id="periodo_id" name="periodo_id" value="<?= $user->periodo_id ?>">
  67. <input type="hidden" id="profesor_id" name="profesor_id" value="">
  68. </div>
  69. </div>
  70. <!-- ICO-BUSCAR FILTRAR & ICO-BORRAR LIMPIAR -->
  71. <div class="form-group row justify-content-center">
  72. <button class="btn btn-outline-primary mr-2">
  73. <span class="ing-buscar icono"></span>
  74. Buscar horario
  75. </button>
  76. <button type="button" class="btn btn-outline-danger" onclick="location.reload()">
  77. <span class="ing-borrar icono"></span>
  78. Limpiar
  79. </button>
  80. </div>
  81. </div>
  82. </div>
  83. </form>
  84. <div class="form-group mt-4 row justify-content-center">
  85. <?php if ($write) { ?>
  86. <button type="button" id="nuevo" class="btn btn-outline-primary ml-4 d-none" title="Nuevo horario" data-toggle="modal" data-target="#modal-editar">
  87. <span class="ing-mas ing-fw"></span> Nuevo
  88. </button>
  89. <?php } ?>
  90. </div>
  91. </div>
  92. </div>
  93. </form>
  94. <!-- Horario is a (table with one a cell) within a table
  95. 7:15 - 8:45, 8:45 - 10:15, 10:30 - 12:00, 12:00 - 13:30
  96. de lunes a viernes, a excepción de que tenga sábado
  97. -->
  98. <div id="btn-excel-horario" class="mb-2 float-right hidden">
  99. <button class="btn btn-outline-secondary " title="Exportar a Excel">
  100. <span class="ing-descarga ing-fw"></span> Exportar a Excel
  101. </button>
  102. </div>
  103. <!-- Table responsive -->
  104. <div class="table-responsive">
  105. <table class="table table-bordered table-sm table-responsive-md" id="table-horario">
  106. <thead class="thead-dark">
  107. <tr id="headers">
  108. <th scope="col" class="text-center">Hora</th>
  109. <th scope="col" class="text-center">Lunes</th>
  110. <th scope="col" class="text-center">Martes</th>
  111. <th scope="col" class="text-center">Miércoles</th>
  112. <th scope="col" class="text-center">Jueves</th>
  113. <th scope="col" class="text-center">Viernes</th>
  114. <th scope="col" class="text-center">Sábado</th>
  115. </tr>
  116. </thead>
  117. <tbody id="horario"></tbody>
  118. </table>
  119. </div>
  120. </main>
  121. </body>
  122. </html>