示例#1
0
     $foreach_city_name = filter_var($_POST['city_name'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
     $foreach_rate = filter_var($_POST['array_rate'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
     $weight = filter_var($_POST['weight'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
     foreach ($foreach_province as $provinces) {
         $provinces = filter_var($provinces, FILTER_SANITIZE_STRING);
         $city = $_get->get_city($provinces);
         foreach ($city as $key => $city) {
             $_update->insertCourierRate($courier_id->latest_id, $provinces, $city->city_name, '0', '0', $weight);
         }
     }
     $rate = $_POST['courier_rate'];
     $courier_rate_id = $_get->get_min_courier($courier_id->latest_id);
     $initial_id = $courier_rate_id->latest_id;
     foreach ($rate as $rate) {
         $rate = filter_var($rate, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
         $_update->update_rate($rate, '0', $initial_id);
         $initial_id++;
     }
 } else {
     if ($courier_service == "International Only") {
         $courier_name = $courier_id->latest_id;
         $courier_province = "international";
         $courier_city = $_POST['international_id'];
         $courier_rate = $_POST['international_rate'];
         $courier_extend = $_POST['international_rate_extend'];
         $courier_weight = filter_var($_POST['weight'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
         $courier_rate_id = $_get->get_min_courier($courier_id->latest_id);
         $initial_id = $courier_rate_id->latest_id;
         foreach ($courier_city as $key => $city) {
             $city = filter_var($city, FILTER_SANITIZE_STRING);
             $rate = filter_var($courier_rate[$key], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);