} } } } $param = $max_id; $image = 'files/uploads/gallery/' . $prefix . $userfile_name; $active = 1; $visibility = 1; if ($count_banner->rows > 0) { $_update->update_inspiration_image($image, $arr_img); } else { $_update->insert_inspiration_image($inspiration_id, $image, $active, $visibility, $arr_img); } } /* --- INSPIRATION FETURED --- */ $param = $max_id; $feat = $_POST['product_featured']; $_update->delete_inspiration_featured($inspiration->inspiration_id); foreach ($feat as $feat) { $_update->insert_inspiration_featured($inspiration->inspiration_id, $feat, 1, 1); } foreach ($sort as $key => $order) { $slide_id = (int) $key + 1; $_update->update_order($slide_id, $order); } $type = "success"; $msg = "Item has been successfully added."; $page = 'self'; set_alert($type, $msg); safe_redirect($page); }
} else { if ($file_error != 0) { $error_msg = upload_code_message($file_error); $type = 'danger'; $msg = 'Error: ' . $error_msg; set_alert($type, $msg); safe_redirect('self'); } } } } $param = $max_id; $image = 'files/uploads/gallery/' . $prefix . $userfile_name; $active = 1; $visibility = 1; $_update->insert_inspiration_image($param, $image, $key, $active, $visibility, $key); } /* --- INSPIRATION FETURED --- */ $param = $max_id; $arr_help = $_POST['product_featured']; foreach ($arr_help as $help) { $arr_help = filter_var($help, FILTER_SANITIZE_NUMBER_INT); $active = 1; $visibility = 1; $_update->insert_inspiration_featured($get_max->latest_inspiration_id, $help, $active, $visibility); } $type = "success"; $msg = "Item has been successfully added."; set_alert($type, $msg); safe_redirect('self'); }