No results to display!
Add New Location
getConnection(); $off = new office($db); $stmtoff = $off->off_read(); $numoff = $stmtoff->rowCount(); // Check if the form has been submitted if (isset($_POST['save'])) { // Capture the form data $branch_id = $_POST['offbranch']; $location = $_POST['lo_name']; // Check if the branch is selected and location is entered if ($branch_id != '-1' && !empty($location)) { // Prepare the query to insert data into acts_location table $query = "INSERT INTO acts_location (branch_id, lo_name) VALUES (:branch_id, :lo_name)"; // Prepare statement $stmt = $db->prepare($query); // Bind the parameters $stmt->bindParam(':branch_id', $branch_id); $stmt->bindParam(':lo_name', $location); // Execute the query if ($stmt->execute()) { // Success: Data saved successfully echo ""; } else { // Error: Failed to insert data echo ""; } } else { // Error: Validation failed echo ""; } } ?>
No results to display!
Add New Location