inventory.ejs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. <div id="inventoryStrand">
  14. <h1><span><%= merchant.name %></span> inventory</h1>
  15. <div class="options">
  16. <a class="button" href="/recipes">View Recipes</a>
  17. <input id="filter" onkeyup="inventoryObj.filter()" type="text" placeholder="FILTER INGREDIENTS">
  18. <button class="button" onclick="addIngredientObj.display()">Add Ingredient</button>
  19. <% if(merchant.pos === "none"){ %>
  20. <button class="button" onclick="enterTransactionsObj.display()">Enter Transactions</button>
  21. <% } %>
  22. </div>
  23. <table>
  24. <thead>
  25. <tr>
  26. <th onclick="inventoryObj.sortIngredients('name')">Item</th>
  27. <th onclick="inventoryObj.sortIngredients('category')">Category</th>
  28. <th onclick="inventoryObj.sortIngredients('quantity')">Quantity</th>
  29. <th onclick="inventoryObj.sortIngredients('unit')">Unit</th>
  30. <th>Actions</th>
  31. </tr>
  32. <tbody></tbody>
  33. </thead>
  34. </table>
  35. </div>
  36. <div id="addIngredientStrand" class="add-ingredient">
  37. <button onclick="inventoryObj.display()">Back to Inventory</button>
  38. <form onsubmit="addIngredientObj.submitAdd()">
  39. <h2>Select Ingredient</h2>
  40. <label>Ingredient
  41. <select id="addName"></select>
  42. </label>
  43. <label>Quantity
  44. <input id="addQuantity" type="number" step="0.01" required>
  45. </label>
  46. <input type="submit" value="Add Ingredient">
  47. </form>
  48. <form onsubmit="addIngredientObj.submitNew()">
  49. <h2>Create New Ingredient</h2>
  50. <label>Name
  51. <input id="newName" type="text" required>
  52. </label>
  53. <label>Category
  54. <input id="newCategory" type="text" required>
  55. </label>
  56. <label>Unit
  57. <input id="newUnit" type="text" required>
  58. </label>
  59. <label>Quantity
  60. <input id="newQuantity" type="number" step="0.01" required>
  61. </label>
  62. <input type="submit" value="Create Ingredient">
  63. </form>
  64. </div>
  65. <div id="enterTransactionsStrand">
  66. <h1>Enter items sold since (Date)</h1>
  67. <button onclick="inventoryObj.display()">Back to inventory</button>
  68. <table>
  69. <thead>
  70. <tr>
  71. <th>Recipe</th>
  72. <th>Number sold</th>
  73. </tr>
  74. </thead>
  75. <tbody></tbody>
  76. </table>
  77. <button onclick="enterTransactionsObj.submit()">Submit</button>
  78. </div>
  79. <script>
  80. <% if(locals.error){ %>
  81. let error = <%- JSON.stringify(error) %>;
  82. <% }else{ %>
  83. let error = undefined;
  84. <% } %>
  85. </script>
  86. <script>
  87. let merchant = <%- JSON.stringify(merchant) %>;
  88. </script>
  89. <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  90. <script src="../shared/validation.js"></script>
  91. <script src="/inventoryPage/inventory.js"></script>
  92. <script src="/inventoryPage/recipe.js"></script>
  93. <script src="/inventoryPage/addIngredient.js"></script>
  94. <script src="/inventoryPage/enterTransactions.js"></script>
  95. <script src="/inventoryPage/controller.js"></script>
  96. </body>
  97. </html>