Proyecto en colaboración con OPASO

manage-laboratories.php 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <!-- Authors : Carlos C. Corrada-Bravo
  2. David J. Ortiz-Rivera
  3. Organization : Centro de Desarrollo y Consultoria Computacional
  4. Project : OPASO Material Registry
  5. File : manage-laboratories
  6. Description : Edit laboratory data -->
  7. <!-- verify session -->
  8. <?php require_once("header.php");
  9. /* start user session */
  10. if(!isset($_SESSION)){
  11. session_start();
  12. }
  13. if(!($_SESSION["access_level"] === "admin") and !($_SESSION["access_level"] === "investigator")){
  14. header("Location: /menu");
  15. die();
  16. }
  17. ?>
  18. <!doctype html>
  19. <html lang="en">
  20. <!-- encoding/imports/styling -->
  21. <head>
  22. <meta charset="utf-8">
  23. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  24. <title class="title">Manage Laboratories</title>
  25. <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
  26. <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  27. <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
  28. <link rel="stylesheet" href="./style/main.css">
  29. <link rel="stylesheet" href="/style/manage.css">
  30. <link rel="stylesheet" href="/style/add.css">
  31. </head>
  32. <!-- content -->
  33. <body>
  34. <!-- lab forms -->
  35. <div class="form-shader close-form">
  36. <!-- edit form -->
  37. <div class="main-form close-form">
  38. <div class="form-wrapper edit-lab">
  39. <div class="form-header-wrapper">
  40. <h5 class="form-header main-header">Edit Laboratory</h5>
  41. <div class="close-icon"><i class="close-form material-icons">close</i></div>
  42. </div>
  43. <div class="form">
  44. <div class="form-body edit-lab-body">
  45. <div class="li-wrapper large-field">
  46. <label for="lab_name">Lab Name</label>
  47. <input id="lab_name" class="main-required ap-field" type="text" placeholder="Lab Name" name="lab_name">
  48. <div class="invalid-feedback lab_name">Please provide a valid name</div>
  49. </div>
  50. <div class="li-append">
  51. <div class="li-wrapper small-field">
  52. <label for="lab_room">Room</label>
  53. <input id="lab_room" class="main-required ap-field" type="text" placeholder="Lab Room" name="lab_room">
  54. <div class="invalid-feedback lab_room">Please provide a valid lab room</div>
  55. </div>
  56. <div class="li-wrapper margin-left medium-field">
  57. <label for="department">Department</label>
  58. <input id="department" class="main-required ap-field" type="text" placeholder="Department" name="department">
  59. <div class="invalid-feedback department">Please provide a valid department</div>
  60. </div>
  61. </div>
  62. <div class="li-append">
  63. <div class="li-wrapper medium-field">
  64. <label for="building">Building</label>
  65. <input id="building" class="main-required ap-field" type="text" placeholder="Building" name="building">
  66. <div class="invalid-feedback building">Please provide a valid building</div>
  67. </div>
  68. <div class="li-wrapper margin-left small-field">
  69. <label for="extension">Extension</label>
  70. <input id="extension" class="ap-field" type="text" name="extension" placeholder="Extension" oninput="this.value = this.value.replace(/[^0-9.]/g,'').replace(/(\..*)\./g, '$1');">
  71. </div>
  72. </div>
  73. <div class="li-wrapper medium-field">
  74. <label for="number">Principal Investigator</label>
  75. <!-- Select form -->
  76. <div class="select-form">
  77. <select class="pi main-pi">
  78. </select>
  79. </div>
  80. </div>
  81. </div>
  82. <div class="form-actions">
  83. <button class="btn btn-primary action-btn submit" id="main-submit">Submit</button>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. <!-- add form -->
  89. <div class="add-form close-form">
  90. <div class="add-form-wrapper edit-lab">
  91. <div class="add-form-header-wrapper">
  92. <h5 class="form-header">Add Laboratory</h5>
  93. <div class="close-icon"><i class="close-form material-icons">close</i></div>
  94. </div>
  95. <div class="add-form-body-wrapper">
  96. <div class="add-form-body">
  97. <div class="li-wrapper large-field">
  98. <label for="lab_name">Lab Name</label>
  99. <input id="add_lab_name" class="required ap-field" type="text" placeholder="Lab name" name="lab_name">
  100. <div class="invalid-feedback add_lab_name">Please provide a valid name</div>
  101. </div>
  102. <div class="li-append">
  103. <div class="li-wrapper small-field">
  104. <label for="lab_room">Lab Room</label>
  105. <input id="add_lab_room" class="required ap-field" type="text" placeholder="Lab room" name="lab_room">
  106. <div class="invalid-feedback add_lab_room">Please provide a valid lab room</div>
  107. </div>
  108. <div class="li-wrapper margin-left medium-field">
  109. <label for="department">Department</label>
  110. <input id="add_department" class="required ap-field" type="text" placeholder="Department" name="department">
  111. <div class="invalid-feedback add_department">Please provide a valid department</div>
  112. </div>
  113. </div>
  114. <div class="li-append">
  115. <div class="li-wrapper medium-field">
  116. <label for="building">Building</label>
  117. <input id="add_building" class="required ap-field" type="text" placeholder="Building" name="building">
  118. <div class="invalid-feedback add_building">Please provide a valid building</div>
  119. </div>
  120. <div class="li-wrapper margin-left small-field">
  121. <label for="extension">Extension</label>
  122. <input id="add_extension" class="ap-field" type="text" name="extension" placeholder="Extension" oninput="this.value = this.value.replace(/[^0-9.]/g,'').replace(/(\..*)\./g, '$1');">
  123. </div>
  124. </div>
  125. <div class="li-wrapper medium-field">
  126. <label for="number">Principal Investigator</label>
  127. <!-- Select form -->
  128. <div class="select-form">
  129. <select class="pi add-pi">
  130. </select>
  131. </div>
  132. </div>
  133. <small class="add-lab-warning">*All PIs must already be in the system</small>
  134. </div>
  135. <div class="add-form-actions">
  136. <button class="btn btn-primary action-btn submit" id="add-submit">Submit</button>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. <!-- alerts -->
  143. <div class="alerts">
  144. <div class="alert">
  145. <div class="message-icon-wrapper">
  146. <i class="message-icon success-icon material-icons">done</i>
  147. <i class="message-icon error-icon failed-icon warning-icon material-icons">close</i>
  148. </div>
  149. <p class="alert-status"></p>
  150. <p class="alert-message"></p>
  151. </div>
  152. </div>
  153. <div class="content">
  154. <!-- navbar -->
  155. <?php require_once("navbar.php")?>
  156. <div class="main">
  157. <div class="header-wrapper">
  158. <h5 class="header">Manage Laboratories</h5>
  159. <!-- processing -->
  160. <div class="processing">
  161. <p class="processing-text">Fetching laboratories...</p>
  162. <div class="loader"></div>
  163. </div>
  164. </div>
  165. <div class="main-wrapper">
  166. <!-- search form -->
  167. <div class="float-right">
  168. <?php
  169. /* start user session */
  170. if(!isset($_SESSION)){
  171. session_start();
  172. }
  173. if($_SESSION["access_level"] == "admin"){
  174. echo '<!-- Add Material -->
  175. <div class="transaction btn btn-light" id="add">
  176. <i class="fas fa-plus add-personnel-icon"></i>
  177. <p class="add-text">Add</p>
  178. </div>';
  179. }
  180. ?>
  181. <div class="search-form-wrapper">
  182. <input class="search-form" placeholder="Search for laboratories" type="text" name="search-form">
  183. <button class="clear-btn search-form-submit">
  184. <i class="material-icons clear-icon">close</i>
  185. </button>
  186. </div>
  187. </div>
  188. <!-- laboratories -->
  189. <h6 class="header sub-header">Full Laboratory List</h6>
  190. <div class="table-wrapper content-wrapper manage-labs">
  191. <table class="table">
  192. <thead class="table-header">
  193. <tr>
  194. <th class="sort" value="lab_room">Lab Room
  195. <i class="sort-primary fas fa-caret-down"></i>
  196. </th>
  197. <th value="lab_name">Lab Name</th>
  198. <th>Department</th>
  199. <th class="sort" value="building"> Building
  200. <i class="sort-alt fas fa-caret-down"></i>
  201. </th>
  202. <th >Extension</th>
  203. <th >PI</th>
  204. <th >Actions</th>
  205. </tr>
  206. </thead>
  207. <tbody></tbody>
  208. </table>
  209. </div>
  210. <h6 class="header table-total"></h6>
  211. </div>
  212. </div>
  213. <!-- footer -->
  214. <?php require_once("footer.php")?>
  215. </div>
  216. <!-- scripts -->
  217. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  218. <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
  219. <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
  220. <script type="text/javascript" src="/scripts/main.js"></script>
  221. <script type="text/javascript" src="/scripts/manage-laboratories.js"></script>
  222. </body>
  223. </html>