Esempio n. 1
0
        } else {
            $stmt->bind_param("ssss", $name, $description, $visibility, $category_id);
            $stmt->execute();
        }
        $stmt->close();
    }
}
/*
*---------------------------------------------
* CONTROL
*---------------------------------------------
*/
$_get = new INSPIRATION_GET();
$_update = new INSPIRATION_UPDATE();
$category_id = filter_var($_REQUEST['ins_id'], FILTER_SANITIZE_NUMBER_INT);
$category = $_get->get_category($category_id);
$detail_category = $_get->get_category($category_id);
/* --- BUTTON HANDLER --- */
if (isset($_POST['btn_detail_project_category'])) {
    $category_name = filter_var($_POST['category_name'], FILTER_SANITIZE_STRING);
    $description = '';
    $visibility = filter_var($_POST['visibility_status'], FILTER_SANITIZE_STRING);
    $category_id = filter_var($detail_category->category_id, FILTER_SANITIZE_NUMBER_INT);
    $_update->update($category_name, $description, $visibility, $category_id);
    $page = 'self';
    $type = 'success';
    $msg = 'Changes has been successfully saved';
    set_alert($type, $msg);
    safe_redirect($page);
}
?>
Esempio n. 2
0
/*
# ----------------------------------------------------------------------
# INSPIRATION - DETAILS: CONTROL
# ----------------------------------------------------------------------
*/
$_get = new INSPIRATION_GET();
$inspiration_id = filter_var($_REQUEST['ins_id'], FILTER_SANITIZE_NUMBER_INT);
$inspiration = $_get->get_inspiration($inspiration_id);
$banner = $_get->get_inspiration_images($inspiration_id);
$latest_id_img = $_get->get_latest_inspiration_image_id();
$count_images = $_get->count_inspiration_images($inspiration_id);
$products = $_get->get_products();
$featured_ct = $_get->get_inspiration_featured($inspiration_id);
$featured_js = $_get->get_inspiration_featured($inspiration_id);
$category = $_get->get_category();
if (isset($_POST['btn_edit_inspiration'])) {
    $_update = new INSPIRATION_UPDATE();
    /* --- INSPIRATION --- */
    $name = filter_var($_POST['inspiration_name'], FILTER_SANITIZE_STRING);
    $name_japan = $_POST['inspiration_name_japan'];
    $description = $_POST['description'];
    $japan = $_POST['description-japan'];
    $date_created = date('Y-m-d');
    $active = 1;
    $visibility = 1;
    $sort = $_POST['order_banner'];
    $category = filter_var($_POST['inspiration_category'], FILTER_SANITIZE_NUMBER_INT);
    if ($_POST['meta-description'] != '' && !empty($_POST['meta-description'])) {
        $meta_desc = filter_var($_POST['meta-description'], FILTER_SANITIZE_STRING);
    } else {