logout(); break; case 4: addEquipment(); break; case 5: getEquipments(); break; case 6: editEquipment(); break; case 7: deleteEquipment(); break; case 8: addLab(); break; case 9: getLabs(); break; case 10: editLab(); break; case 11: deleteLab(); break; case 12: addManufacturer(); break; case 13: getManufacturers();
} if (isset($_POST['submit'])) { // form was submitted $id = $_POST['inputLabId']; $description = $_POST['inputLabDesc']; // check for duplicate lab // lab with that name exists if (getLabById($id) != null) { $msg = "Can't add Lab {$id}, already exists."; } else { // add lab $testCases = array(); for ($i = 1; $i <= $_POST['numTestCases']; $i++) { array_push($testCases, array($i . 'name' => $_POST['testCase' . $i . 'Name'], $i . 'description' => $_POST['testCase' . $i . 'Description'])); } addLab($id, $description); addTestCasesForLab($id, $testCases); $msg = "Lab {$id} added."; } } else { // form was not submitted (GET request) $msg = "Add Lab"; } ob_flush(); include_once "templates/page_head.php"; ?> <div class="container"> <?php include_once "templates/navigation.php"; ?>