Proyecto en colaboración con OPASO

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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 : inventory
  6. Description : Edit laboratory inventory -->
  7. <!-- Verify Session -->
  8. <?php require_once("header.php");
  9. /* start user session */
  10. if(!isset($_SESSION)){
  11. session_start();
  12. }
  13. /* verify lab id */
  14. if(!isset($_GET["lab_id"])){
  15. header("Location: /menu");
  16. die();
  17. }
  18. else{
  19. if(!($_SESSION["authorized"][$_GET["lab_id"]]["access_level"] === "admin") and !($_SESSION["authorized"][$_GET["lab_id"]]["access_level"] === "investigator") and !(array_key_exists($_GET["lab_id"],$_SESSION["authorized"]))){
  20. header("Location: /menu");
  21. die();
  22. }
  23. }
  24. ?>
  25. <!doctype html>
  26. <html lang="en">
  27. <!-- encoding/imports/styling -->
  28. <head>
  29. <meta charset="utf-8">
  30. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  31. <title class="title"><?php echo $_SESSION["authorized"][$_GET["lab_id"]]["lab_room"]; ?></title>
  32. <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
  33. <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  34. <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
  35. <link rel="stylesheet" href="/style/main.css">
  36. <link rel="stylesheet" href="/style/laboratory.css">
  37. </head>
  38. <!-- content -->
  39. <body>
  40. <div class="form-shader close-form">
  41. <div class="edit-form close-form">
  42. <div class="edit-form-wrapper">
  43. <div class="edit-form-header-wrapper">
  44. <h4 class="form-header">Edit Material</h4>
  45. <div class="close-icon"><i class="material-icons close-form">close</i></div>
  46. </div>
  47. <div class="edit-form-body-wrapper">
  48. <div class="edit-form-body">
  49. <div class="details material">
  50. <h5 class="details-header">Material Details</h5>
  51. <div class="edit-li-wrapper large-field">
  52. <label for="mat_name">Material</label>
  53. <input class="material-input" type="text" placeholder="Material" name="mat_name">
  54. </div>
  55. <div class="edit-li-wrapper medium-field">
  56. <label for="cas-number">CAS Num.</label>
  57. <input class="material-input" type="text" placeholder="Cas Num." name="cas">
  58. </div>
  59. <div class="edit-li-wrapper medium-field">
  60. <label for="man_name">Manufacturer</label>
  61. <input class="material-input" type="text" placeholder="Manufacturer" name="man_name">
  62. </div>
  63. <div class="edit-li-wrapper large-field">
  64. <label for="sds-link">SDS Link</label>
  65. <input class="material-input" type="text" placeholder="SDS Link" name="sds">
  66. </div>
  67. <div class="edit-li-wrapper extra-small-field">
  68. <label for="state">State</label>
  69. <input class="material-input" type="text" placeholder="State" name="state">
  70. </div>
  71. </div>
  72. <div class="details hazard">
  73. <h5 class="details-header">Hazard Details</h5>
  74. <div class="edit-li-wrapper medium-field">
  75. <label for="ghs">GHS</label>
  76. <input class="material-input" type="text" placeholder="GHS" name="ghs">
  77. </div>
  78. </div>
  79. <div class="details container">
  80. <h5 class="details-header">Container Details</h5>
  81. <div class="edit-li-wrapper extra-small-field">
  82. <label for="type">Type</label>
  83. <input class="material-input" type="text" placeholder="Type" name="type">
  84. </div>
  85. <div class="edit-li-wrapper small-field">
  86. <label for="capacity">Capacity</label>
  87. <input class="material-input" type="text" name="capacity" placeholder="Capacity" oninput="this.value = this.value.replace(/[^0-9.]/g,'').replace(/(\..*)\./g, '$1');">
  88. </div>
  89. <div class="edit-li-wrapper small-field quantity">
  90. <label for="quantity">Quantity</label>
  91. <input class="material-input" type="text" name="quantity" placeholder="Quantity" oninput="this.value = this.value.replace(/[^0-9.]/g,'').replace(/(\..*)\./g, '$1');">
  92. </div>
  93. <div class="edit-li-wrapper small-field uom">
  94. <label for="uom">UOM</label>
  95. <input class="material-input" type="text" placeholder="UOM" name="uom">
  96. </div>
  97. <div class="edit-li-wrapper medium-field">
  98. <label for="location">Location</label>
  99. <input class="material-input" type="text" placeholder="Location" name="location">
  100. </div>
  101. </div>
  102. </div>
  103. <div class="edit-form-actions">
  104. <button class="btn btn-primary action-btn submit" id="edit-submit">Submit</button>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. <!-- alerts -->
  111. <div class="alerts">
  112. <div class="alert">
  113. <div class="message-icon-wrapper">
  114. <i class="message-icon success-icon material-icons">done</i>
  115. <i class="message-icon error-icon failed-icon warning-icon material-icons">close</i>
  116. </div>
  117. <p class="alert-status"></p>
  118. <p class="alert-message"></p>
  119. </div>
  120. </div>
  121. <!-- confirm alert -->
  122. <div class="alert-wrapper hide-confirm">
  123. <div class="confirm-alert">
  124. <h5 class="header confirm-header">Confirm</h5>
  125. <div class="mi-wrapper">
  126. <div class="confirm-message"></div>
  127. <div class="query-actions">
  128. <button class="btn query-btn" id="yes">Yes</button>
  129. <button class="btn query-btn hide-confirm">No</button>
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. <div class="content">
  135. <!-- navbar -->
  136. <?php require_once("navbar.php")?>
  137. <div class="main">
  138. <div class="header-wrapper">
  139. <h5 class="header lab-header"><?php echo $_SESSION["authorized"][$_GET["lab_id"]]["lab_room"]; ?></h5>
  140. <!-- processing -->
  141. <div class="processing">
  142. <p class="processing-text">Fetching inventory...</p>
  143. <div class="loader"></div>
  144. </div>
  145. </div>
  146. <div class="main-wrapper">
  147. <!-- search form -->
  148. <div class="float-right">
  149. <div class="search-form-wrapper">
  150. <input class="search-form" type="text" placeholder="Search for materials" name="search-form">
  151. <button class="clear-btn search-form-submit">
  152. <i class="material-icons clear-icon">close</i>
  153. </button>
  154. </div>
  155. </div>
  156. <!-- inventory -->
  157. <h6 class="header sub-header">Edit Inventory</h6>
  158. <div class="table-wrapper inventory">
  159. <table class="table">
  160. <thead>
  161. <tr>
  162. <th class="sort" value="mat_name" >Material
  163. <i class="sort-icon sort-material fas fa-caret-down"></i>
  164. </th>
  165. <th >Manufacturer</th>
  166. <th >CAS Num.</th>
  167. <th >SDS</th>
  168. <th >GHS</th>
  169. <th >State</th>
  170. <th >Type</th>
  171. <th value="capacity">Capacity</th>
  172. <th value="quantity">Quantity</th>
  173. <th value="total">Total</th>
  174. <th value="uom">UOM</th>
  175. <th >Location</th>
  176. <th >Options</th>
  177. </tr>
  178. </thead>
  179. <tbody></tbody>
  180. </table>
  181. </div>
  182. <h6 class="header table-total"></h6>
  183. </div>
  184. </div>
  185. <!-- footer -->
  186. <?php require_once("footer.php")?>
  187. </div>
  188. <!-- scripts -->
  189. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  190. <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
  191. <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
  192. <script type="text/javascript" src="/scripts/main.js"></script>
  193. <script type="text/javascript" src="/scripts/inventory.js"></script>
  194. </body>
  195. </html>