inventory.ejs 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>The Subline</title>
  6. <link rel="icon" type="img/png" href="/shared/images/logo.png">
  7. <link rel="stylesheet" href="/inventoryPage/inventory.css">
  8. <link rel="stylesheet" href="/shared/shared.css">
  9. </head>
  10. <body>
  11. <% include ../shared/header %>
  12. <% include ../shared/banner %>
  13. <h1 id="title"><%=merchant.name%></h1>
  14. <strand-selector></strand-selector>
  15. <div id="inventoryStrand" class="strand">
  16. <div class="options">
  17. <a class="button" href="/recipes">View Recipes</a>
  18. <button class="button" onclick="addIngredientObj.display()">Add Ingredient</button>
  19. <button class="button" onclick="enterPurchaseObj.display()">Enter Purchases</button>
  20. <% if(merchant.pos === "none"){ %>
  21. <button class="button" onclick="enterTransactionsObj.display()">Enter Transactions</button>
  22. <% } %>
  23. </div>
  24. <input id="filter" onkeyup="inventoryObj.filter()" type="text" placeholder="FILTER INGREDIENTS">
  25. <table>
  26. <thead>
  27. <tr>
  28. <th onclick="inventoryObj.sortIngredients('name')">Item</th>
  29. <th onclick="inventoryObj.sortIngredients('category')">Category</th>
  30. <th onclick="inventoryObj.sortIngredients('quantity')">Quantity</th>
  31. <th onclick="inventoryObj.sortIngredients('unit')">Unit</th>
  32. <th>Actions</th>
  33. </tr>
  34. <tbody></tbody>
  35. </thead>
  36. </table>
  37. </div>
  38. <div id="recipesStrand" class="strand">
  39. <div>
  40. <% if(merchant.pos !== "none"){ %>
  41. <button class="button" id="recipeUpdate" onclick="recipesObj.updateRecipes()">Update Recipes</button>
  42. <% } %>
  43. </div>
  44. <div id="recipesContainer"></div>
  45. </div>
  46. <div id="accountStrand" class="strand">
  47. <h1>Account Strand</h1>
  48. <form onsubmit="accountObj.submitForm()"></form>
  49. </div>
  50. <div id="addIngredientAction" class="action">
  51. <button class="button" onclick="inventoryObj.display()">Back to Inventory</button>
  52. <div class="container">
  53. <form onsubmit="addIngredientObj.submitAdd()">
  54. <h2>Select Ingredient</h2>
  55. <label>Ingredient
  56. <select id="addName"></select>
  57. </label>
  58. <label>Quantity
  59. <input id="addQuantity" type="number" step="0.01" required>
  60. </label>
  61. <input class="button" type="submit" value="Add Ingredient">
  62. </form>
  63. <form onsubmit="addIngredientObj.submitNew()">
  64. <h2>Create New Ingredient</h2>
  65. <label>Name
  66. <input id="newName" type="text" required>
  67. </label>
  68. <label>Category
  69. <input id="newCategory" type="text" required>
  70. </label>
  71. <label>Unit
  72. <input id="newUnit" type="text" required>
  73. </label>
  74. <label>Quantity
  75. <input id="newQuantity" type="number" step="0.01" required>
  76. </label>
  77. <input class="button" type="submit" value="Create Ingredient">
  78. </form>
  79. </div>
  80. </div>
  81. <div id="enterTransactionsAction" class="action">
  82. <h1>Enter items sold since (Date)</h1>
  83. <button class="button" onclick="inventoryObj.display()">Back to inventory</button>
  84. <table>
  85. <thead>
  86. <tr>
  87. <th>Recipe</th>
  88. <th>Number sold</th>
  89. </tr>
  90. </thead>
  91. <tbody></tbody>
  92. </table>
  93. <button class="button" onclick="enterTransactionsObj.submit()">Submit</button>
  94. </div>
  95. <div id="enterPurchaseAction" class="action">
  96. <h1>Enter Purchases</h1>
  97. <button class="button" onclick="inventoryObj.display()">Back to inventory</button>
  98. <table>
  99. <thead>
  100. <tr>
  101. <th>Ingredient</th>
  102. <th>Amount</th>
  103. </tr>
  104. </thead>
  105. <tbody></tbody>
  106. </table>
  107. <button class="button" onclick="enterPurchaseObj.submit()">Submit</button>
  108. </div>
  109. <div id="singleRecipeAction" class="action">
  110. <h1><span><%=merchant.name%></span>'s</h1>
  111. <h1 id="recipeName"></h1>
  112. <div class="buttonsDiv">
  113. <button class="button" id="addButton">Add Ingredient</button>
  114. <button class="button" onclick="recipesObj.display()">Back to Recipes</button>
  115. </div>
  116. <table>
  117. <thead>
  118. <tr>
  119. <th>Name</th>
  120. <th>Quantity</th>
  121. <th>Actions</th>
  122. </tr>
  123. </thead>
  124. <tbody></tbody>
  125. </table>
  126. </div>
  127. <script>
  128. <% if(locals.error){ %>
  129. let error = <%- JSON.stringify(error) %>;
  130. <% }else{ %>
  131. let error = undefined;
  132. <% } %>
  133. </script>
  134. <script>
  135. let merchant = <%- JSON.stringify(merchant) %>;
  136. </script>
  137. <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  138. <script src="../shared/validation.js"></script>
  139. <script src="/inventoryPage/inventory.js"></script>
  140. <script src="/inventoryPage/recipes.js"></script>
  141. <script src="/inventoryPage/account.js"></script>
  142. <script src="/inventoryPage/addIngredient.js"></script>
  143. <script src="/inventoryPage/enterTransactions.js"></script>
  144. <script src="/inventoryPage/enterPurchase.js"></script>
  145. <script src="/inventoryPage/singleRecipe.js"></script>
  146. <script src="/shared/controller.js"></script>
  147. </body>
  148. </html>