if(isset($_POST['btn-edit-shipping']) && $_POST['btn-edit-shipping'] == 'Save Changes'){ $courier_ids = $ship_id; $courier_name = filter_var($_POST['name'], FILTER_SANITIZE_STRING); $courier_description = filter_var($_POST['description'], FILTER_SANITIZE_STRING); $courier_service = filter_var($_POST['service'], FILTER_SANITIZE_STRING); $courier_weight = filter_var($_POST['weight'], FILTER_SANITIZE_STRING); $courier_id = $_POST['city_name']; $courier_rate = $_POST['courier_rate']; $_update->update_local_courier($courier_name, $courier_description, $courier_service, 'Active', $courier_weight, $courier_ids); foreach($courier_id as $index=>$courier_id){ $courier_id = filter_var($courier_id, FILTER_SANITIZE_STRING); $courier_rate[$index] = filter_var($courier_rate[$index], FILTER_SANITIZE_NUMBER_INT); $_update->update_local_rate($courier_rate[$index], $courier_weight, $courier_id); } $page = 'edit-shipping/'.$courier->courier_id; $type = 'success'; $msg = 'Changes have been successfully saved.'; set_alert($type, $msg); safe_redirect($page); } ?>