예제 #1
0
    $reset = "hidden";
} else {
    $reset = "";
}
/* -- DATABASE ACTION -- */
if (isset($_POST['btn-index-shipping']) and $_POST['btn-index-shipping'] == 'GO') {
    $courier_id = $_POST['courier_id'];
    if ($_POST['ship-action'] == "delete") {
        if (in_array('1', $courier_id)) {
            $type = 'danger';
            $msg = "Can't delete mandatory courier";
        } else {
            foreach ($courier_id as $courier_id) {
                $courier_id = filter_var($courier_id, FILTER_SANITIZE_NUMBER_INT);
                $_update->deleteCourier($courier_id);
                $_update->deleteCourierRste($courier_id);
            }
            $type = 'success';
            $msg = 'Item(s) has been successfully deleted';
        }
    } else {
        if ($_POST['ship-action'] == "change") {
            if ($_POST['ship-option'] == 'Active') {
                $active_status = 'Active';
            } else {
                if ($_POST['ship-option'] == 'Inactive') {
                    $active_status = 'Inactive';
                }
            }
            foreach ($courier_id as $courier_id) {
                $_update->updateCourierRate($active_status, $courier_id);