session_start(); require_once "database/user_table.php"; require_once "database/user_role_table.php"; require_once "database/category_table.php"; require_once "database/item_table.php"; require_once "database/inventory_table.php"; require_once "database/base_quantity_table.php"; require_once "database/variables_table.php"; require_once "database/conversation_table.php"; require_once "database/timeslot_table.php"; require_once "database/timeslot_item_table.php"; require_once "database/recipe_item_table.php"; require_once "database/recipe_table.php"; /*---------------manage_users.php-------------*/ if (isset($_POST["newRole"])) { UserRoleTable::update_user_role($_POST["roleUserName"], $_POST["newRole"]); } /*----------------------update_inventory.php-----------------*/ if (isset($_POST["itemQuantity"])) { echo InventoryTable::update_inventory($_POST["itemDate"], $_POST["itemId"], $_POST["itemQuantity"], $_POST["itemNote"]); } /*-----------------------print_preview.php---------------*/ if (isset($_POST["sales"])) { VariablesTable::update_expected_sales($_POST["sales"]); } /*--------------edit_items.php------------*/ if (isset($_POST["quantity"])) { BaseQuantityTable::update_base_quantity($_POST["itemId"], $_POST["quantity"]); } /*-----------------edit_categories.php-------------*/ if (isset($_POST["getCategorizedItems"])) {
echo $userdata["first_name"] . " " . $userdata["last_name"]; ?> </td> <td id="name"><?php echo $userdata["username"]; ?> </td> <td id="role"> <select onchange=updateRole(this) id=""class="none" <?php if ($userdata["username"] == $_SESSION["username"]) { echo "disabled"; } ?> > <?php $result2 = UserRoleTable::get_roles(); ?> <?php while ($row = $result2->fetch_assoc()) { ?> <option value="<?php echo $row["role"]; ?> " <?php if ($userdata["role"] == $row["role"]) { echo "selected"; } ?> > <?php echo $row["role"]; ?>