Proyecto en colaboración con OPASO

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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 : laboratory
  6. Description : Display 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(!(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 href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
  36. <link rel="stylesheet" href="/style/main.css">
  37. <link rel="stylesheet" href="/style/laboratory.css">
  38. </head>
  39. <!-- content -->
  40. <body>
  41. <!-- transaction forms -->
  42. <div class="form-shader close-form">
  43. <!-- main transactions -->
  44. <div class="main-form close-form">
  45. <div class="form-wrapper">
  46. <div class="form-header-wrapper">
  47. <h4 class="form-header main-header">Material Use</h4>
  48. <div class="close-icon"><i class="material-icons close-form">close</i></div>
  49. </div>
  50. <div class="form">
  51. <div class="form-body">
  52. <div class="li-wrapper total">
  53. <label class="label" for="total">Limit</label>
  54. <input class="text-field" id="total" type="text" name="total" disabled>
  55. </div>
  56. <div class="li-wrapper">
  57. <label class="label transaction-label" for="transaction"></label>
  58. <div class="control-wrapper">
  59. <input class="text-field" id="transaction" type="text" name="transaction">
  60. <!-- <i class="control control-plus fas fa-plus" id="plus"></i><br>
  61. <i class="control control-minus fas fa-minus" id="minus"></i> -->
  62. </div>
  63. </div>
  64. </div>
  65. <div class="form-actions">
  66. <button class="btn btn-primary action-btn submit" id="main-submit">Submit</button>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. <!-- add material -->
  72. <div class="add-form close-form">
  73. <div class="add-form-wrapper">
  74. <div class="add-form-header-wrapper">
  75. <h4 class="form-header">Add Material</h4>
  76. <div class="close-icon"><i class="material-icons close-form">close</i></div>
  77. </div>
  78. <div class="add-form-body-wrapper">
  79. <div class="add-form-body">
  80. <div class="details material">
  81. <h5 class="details-header">Material Details</h5>
  82. <div class="add-li-wrapper large-field">
  83. <label for="mat_name">Material</label>
  84. <input class="material-input" type="text" placeholder="Material name" name="mat_name">
  85. </div>
  86. <div class="add-li-wrapper medium-field">
  87. <label for="cas-number">CAS Number</label>
  88. <input class="material-input" type="text" placeholder="CAS Num." name="cas">
  89. </div>
  90. <div class="add-li-wrapper medium-field">
  91. <label for="man_name">Manufacturer</label>
  92. <input class="material-input" type="text" placeholder="Manufacturer name" name="man_name">
  93. </div>
  94. <div class="add-li-wrapper large-field">
  95. <label for="sds-link">SDS Link</label>
  96. <input class="material-input" type="text" placeholder="SDS Link" name="sds">
  97. </div>
  98. <div class="add-li-wrapper extra-small-field">
  99. <label for="state">State</label>
  100. <input class="material-input" type="text" placeholder="State" name="state">
  101. </div>
  102. </div>
  103. <div class="details hazard">
  104. <h5 class="details-header">Hazard Details</h5>
  105. <div class="add-li-wrapper small-field">
  106. <label for="ghs">GHS</label>
  107. <input class="material-input" type="text" placeholder="GHS" name="ghs">
  108. </div>
  109. <div class="add-li-wrapper medium-field">
  110. <label for="hazard">Hazard</label>
  111. <input class="material-input" type="text" placeholder="Hazard" name="hazard">
  112. </div>
  113. </div>
  114. <div class="details container-details">
  115. <h5 class="details-header">Container Details</h5>
  116. <div class="add-li-wrapper extra-small-field">
  117. <label for="type">Type</label>
  118. <input class="material-input" type="text" placeholder="Type" name="type">
  119. </div>
  120. <div class="add-li-wrapper small-field">
  121. <label for="capacity">Capacity</label>
  122. <input class="material-input" type="text" name="capacity" placeholder="Capacity" oninput="this.value = this.value.replace(/[^0-9.]/g,'').replace(/(\..*)\./g, '$1');">
  123. </div>
  124. <div class="add-li-wrapper small-field quantity">
  125. <label for="quantity">Quantity</label>
  126. <input class="material-input" type="text" name="quantity" placeholder="Quantity" oninput="this.value = this.value.replace(/[^0-9.]/g,'').replace(/(\..*)\./g, '$1');">
  127. </div>
  128. <div class="add-li-wrapper small-field uom">
  129. <label for="uom">UOM</label>
  130. <input class="material-input" type="text" placeholder="UOM" name="uom">
  131. </div>
  132. <div class="add-li-wrapper medium-field">
  133. <label for="location">Location</label>
  134. <input class="material-input" type="text" placeholder="Location" name="location">
  135. </div>
  136. </div>
  137. </div>
  138. <div class="add-form-actions">
  139. <button class="btn btn-primary action-btn submit" id="add-submit">Submit</button>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. </div>
  145. <!-- alerts -->
  146. <div class="alerts">
  147. <div class="alert">
  148. <div class="message-icon-wrapper">
  149. <i class="message-icon success-icon material-icons">done</i>
  150. <i class="message-icon error-icon failed-icon warning-icon material-icons">close</i>
  151. </div>
  152. <p class="alert-status"></p>
  153. <p class="alert-message"></p>
  154. </div>
  155. </div>
  156. <!-- confirm alert -->
  157. <div class="alert-wrapper hide-confirm">
  158. <div class="confirm-alert">
  159. <h5 class="header confirm-header">Confirm</h5>
  160. <div class="mi-wrapper">
  161. <div class="confirm-message"></div>
  162. <div class="query-actions">
  163. <button class="btn query-btn" id="yes">Yes</button>
  164. <button class="btn query-btn hide-confirm">No</button>
  165. </div>
  166. </div>
  167. </div>
  168. </div>
  169. <!-- material data -->
  170. <div class="material-data-shader hide-material-data">
  171. <div class="material-data-wrapper">
  172. <div class="material-data-icon-wrapper">
  173. <i class="hide-material-data-icon hide-material-data material-icons">close</i>
  174. </div>
  175. <div class="material-data">
  176. <div class="material-name-wrapper">
  177. <h5 class="header material-data-header material-name" value="mat_name"></h6>
  178. <a class="material-link" target="_blank" rel="noopener noreferrer" title="material"><i class="fas fa-external-link-alt"></i></a>
  179. </div>
  180. <div class="material-data-row">
  181. <h6 class="header material-data-header">CAS Num.</h6>
  182. <span class="material-data-text" value="cas"></span>
  183. </div>
  184. <div class="material-data-row">
  185. <h6 class="header material-data-header">State</h6>
  186. <span class="material-data-text" value="state"></span>
  187. </div>
  188. <div class="material-data-row">
  189. <h6 class="header material-data-header">Type</h6>
  190. <span class="material-data-text" value="type"></span>
  191. </div>
  192. <div class="material-data-row">
  193. <h6 class="header material-data-header">SDS Link</h6>
  194. <span class="material-data-text" value="sds"></span>
  195. </div>
  196. <div class="material-data-row">
  197. <h6 class="header material-data-header">GHS</h6>
  198. <span class="material-data-text" value="ghs"></span>
  199. </div>
  200. </div>
  201. </div>
  202. </div>
  203. <div class="content">
  204. <!-- navbar -->
  205. <?php require_once("navbar.php")?>
  206. <div class="main">
  207. <div class="header-wrapper">
  208. <h5 class="header lab-header"><?php echo $_SESSION["authorized"][$_GET["lab_id"]]["lab_room"]; ?></h5>
  209. <!-- processing -->
  210. <div class="processing">
  211. <p class="processing-text">Fetching inventory...</p>
  212. <div class="loader"></div>
  213. </div>
  214. </div>
  215. <div class="main-wrapper">
  216. <!-- inventory -->
  217. <div class="personnel-wrapper">
  218. <h6 class="header sub-header">Personnel</h6>
  219. <table class="table personnel">
  220. <thead class="table-header">
  221. <tr>
  222. <th value="person_name" >Person Name</th>
  223. <th value="access_level">Access level</th>
  224. </tr>
  225. </thead>
  226. <tbody class="personnel-body"></tbody>
  227. </table>
  228. </div>
  229. <div class="float-right">
  230. <div class="dropdown download">
  231. <button class="btn btn-outline-success download-btn" type="button" title="Download" id="dropdown-menu-button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="material-icons download-icon">archived</i></button>
  232. <div class="dropdown-menu" aria-labelledby="dropdown-menu-button">
  233. <span class="download-option" value="lab_report">Lab Report</span>
  234. </div>
  235. </div>
  236. <div class="btn btn-light transaction add-material" id="add-material">
  237. <i class="fas fa-plus add-material-icon"></i>
  238. <p class="add-text">Add</p>
  239. </div>
  240. <div class="search-form-wrapper">
  241. <input class="search-form" type="text" placeholder="Search for materials" name="search-form">
  242. <button class="clear-btn search-form-submit">
  243. <i class="material-icons clear-icon">close</i>
  244. </button>
  245. </div>
  246. </div>
  247. <!-- inventory -->
  248. <div class="sub-header-wrapper">
  249. <h6 class="header sub-header table-sub-header">Inventory</h6>
  250. <?php
  251. /* start user session */
  252. if(!isset($_SESSION)){
  253. session_start();
  254. }
  255. if($_SESSION["access_level"] == "admin" or $_SESSION["access_level"] == "investigator"){
  256. echo '<a class="edit-link" href="/inventory?lab_id=' . $_GET["lab_id"] . '" title="edit inventory">(Edit)</a>';
  257. }
  258. ?>
  259. </div>
  260. <div class="table-wrapper content-wrapper inventory">
  261. <table class="table">
  262. <thead class="table-header">
  263. <tr>
  264. <th class="sort" value="mat_name" >Material
  265. <i class="sort-icon sort-material fas fa-caret-down"></i>
  266. </th>
  267. <th class="sort" value="man_name">Manufacturer
  268. <i class="sort-alt fas fa-caret-down"></i>
  269. </th>
  270. <th value="capacity">Capacity</th>
  271. <th value="quantity">Quantity</th>
  272. <th value="total">Total</th>
  273. <th value="uom">UOM</th>
  274. <th >Location</th>
  275. <th >Transactions</th>
  276. </tr>
  277. </thead>
  278. <tbody class="inventory-body"></tbody>
  279. </table>
  280. </div>
  281. <h6 class="header table-total"></h6>
  282. </div>
  283. </div>
  284. <!-- footer -->
  285. <?php require_once("footer.php")?>
  286. </div>
  287. <!-- scripts -->
  288. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  289. <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
  290. <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
  291. <script type="text/javascript" src="/scripts/main.js"></script>
  292. <script type="text/javascript" src="/scripts/laboratory.js"></script>
  293. </body>
  294. </html>