This function is called when the window has finished loading. It initializes the page by showing the form for adding a new ingredient.
/**
* This function is called when the window has finished loading. It initializes the page by showing the form for adding a new ingredient.
*/
window.onload = function() {
showNewIngredientForm();
};
Updates the graph based on the selected item.
Parameters:
item_id
(string
): The ID of the selected item.
/**
* Updates the graph based on the selected item.
* @param {string} item_id - The ID of the selected item.
*/
function updateGraph(item_id) {
// ... Function code ...
}
Displays the stock update form for a specific item.
Parameters:
item_id
(string
): The ID of the item to update.item_name
(string
): The name of the item.current_stock
(number
): The current stock value of the item.
/**
* Displays the stock update form for a specific item.
* @param {string} item_id - The ID of the item to update.
* @param {string} item_name - The name of the item.
* @param {number} current_stock - The current stock value of the item.
*/
function showStockUpdate(item_id, item_name, current_stock) {
// ... Function code ...
}
Updates the stock of a specific item based on user input.
Parameters:
item_id
(string
): The ID of the item to update.
/**
* Updates the stock of a specific item based on user input.
* @param {string} item_id - The ID of the item to update.
*/
function updateStock(item_id) {
// ... Function code ...
}
Deletes a specific ingredient.
Parameters:
item_id
(string
): The ID of the item to delete.
/**
* Deletes a specific ingredient.
* @param {string} item_id - The ID of the item to delete.
*/
function deleteIngredient(item_id) {
// ... Function code ...
}
Displays the form for adding a new ingredient.
/**
* Displays the form for adding a new ingredient.
*/
function showNewIngredientForm() {
// ... Function code ...
}
Adds a new ingredient based on user input.
/**
* Adds a new ingredient based on user input.
*/
function addNewIngredient() {
// ... Function code ...
}