inventory.ejs 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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. <button class="button" onclick="addIngredientObj.display()">Add Ingredient</button>
  18. <button class="button" onclick="enterPurchaseObj.display()">Enter Purchases</button>
  19. <% if(merchant.pos === "none"){ %>
  20. <button class="button" onclick="enterTransactionsObj.display()">Enter Transactions</button>
  21. <% } %>
  22. </div>
  23. <input id="filter" onkeyup="inventoryObj.filter()" type="text" placeholder="FILTER INGREDIENTS">
  24. <table>
  25. <thead>
  26. <tr>
  27. <th onclick="inventoryObj.sortIngredients('name')">Item</th>
  28. <th onclick="inventoryObj.sortIngredients('category')">Category</th>
  29. <th onclick="inventoryObj.sortIngredients('quantity')">Quantity</th>
  30. <th onclick="inventoryObj.sortIngredients('unit')">Unit</th>
  31. <th>Actions</th>
  32. </tr>
  33. <tbody></tbody>
  34. </thead>
  35. </table>
  36. </div>
  37. <div id="recipesStrand" class="strand">
  38. <div>
  39. <% if(merchant.pos !== "none"){ %>
  40. <button class="button" id="recipeUpdate" onclick="recipesObj.updateRecipes()">Update Recipes</button>
  41. <% } %>
  42. </div>
  43. <div id="recipesContainer"></div>
  44. </div>
  45. <div id="accountStrand" class="strand">
  46. <form onsubmit="accountObj.submitForm()">
  47. <label>Name:&nbsp;&nbsp;
  48. <p><%=merchant.name%></p>
  49. </label>
  50. <label>Email:&nbsp;&nbsp;
  51. <p><%=merchant.email%></p>
  52. </label>
  53. </form>
  54. </div>
  55. <div id="addIngredientAction" class="action">
  56. <div class="container">
  57. <form onsubmit="addIngredientObj.submitAdd()">
  58. <h2>Select Ingredient</h2>
  59. <label>Ingredient
  60. <select id="addName"></select>
  61. </label>
  62. <label>Quantity
  63. <input id="addQuantity" type="number" step="0.01" required>
  64. </label>
  65. <input class="button" type="submit" value="Add Ingredient">
  66. </form>
  67. <form id="createIngredientInput" onsubmit="addIngredientObj.submitNew()">
  68. <h2>Create New Ingredient</h2>
  69. <label>Name
  70. <input id="newName" type="text" required>
  71. </label>
  72. <label>Category
  73. <input id="newCategory" type="text" required>
  74. </label>
  75. <label>Unit
  76. <input id="newUnit" type="text" required>
  77. </label>
  78. <label>Quantity
  79. <input id="newQuantity" type="number" step="0.01" required>
  80. </label>
  81. <button class="button">Create Ingredient</button>
  82. </form>
  83. </div>
  84. </div>
  85. <div id="enterTransactionsAction" class="action">
  86. <h1>Enter all sales</h1>
  87. <h3>Last updated: <span id="updated"></span></h3>
  88. <table>
  89. <thead>
  90. <tr>
  91. <th>Recipe</th>
  92. <th>Number sold</th>
  93. </tr>
  94. </thead>
  95. <tbody></tbody>
  96. </table>
  97. <button class="button" onclick="enterTransactionsObj.submit()">Submit</button>
  98. </div>
  99. <div id="enterPurchaseAction" class="action">
  100. <h1>Enter Purchases</h1>
  101. <table>
  102. <thead>
  103. <tr>
  104. <th>Ingredient</th>
  105. <th>Amount</th>
  106. </tr>
  107. </thead>
  108. <tbody></tbody>
  109. </table>
  110. <button class="button" onclick="enterPurchaseObj.submit()">Submit</button>
  111. </div>
  112. <div id="singleRecipeAction" class="action">
  113. <h2 id="recipeName"></h2>
  114. <div class="buttonsDiv">
  115. <button class="button" id="addButton">Add Ingredient</button>
  116. </div>
  117. <table>
  118. <thead>
  119. <tr>
  120. <th>Name</th>
  121. <th>Quantity</th>
  122. <th>Actions</th>
  123. </tr>
  124. </thead>
  125. <tbody></tbody>
  126. </table>
  127. </div>
  128. <script>
  129. <% if(locals.error){ %>
  130. let error = <%- JSON.stringify(error) %>;
  131. <% }else{ %>
  132. let error = undefined;
  133. <% } %>
  134. </script>
  135. <script>
  136. let merchant = <%- JSON.stringify(merchant) %>;
  137. </script>
  138. <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  139. <script src="../shared/validation.js"></script>
  140. <script src="/inventoryPage/inventory.js"></script>
  141. <script src="/inventoryPage/recipes.js"></script>
  142. <script src="/inventoryPage/account.js"></script>
  143. <script src="/inventoryPage/addIngredient.js"></script>
  144. <script src="/inventoryPage/enterTransactions.js"></script>
  145. <script src="/inventoryPage/enterPurchase.js"></script>
  146. <script src="/inventoryPage/singleRecipe.js"></script>
  147. <script src="/shared/controller.js"></script>
  148. </body>
  149. </html>