Пример #1
0
<?php

/*
# ----------------------------------------------------------------------
# SIZE GROUP - DETAILS: CONTROL
# ----------------------------------------------------------------------
*/
$_get = new SIZE_GET();
$_update = new SIZE_UPDATE();
$req_size_id = filter_var($_REQUEST['size_id'], FILTER_SANITIZE_STRING);
$req_size_name = filter_var($_REQUEST['size_name'], FILTER_SANITIZE_STRING);
$detail_size = $_get->get_detail($req_size_id);
$size = $_get->get_detail_size($detail_size->size_type_id);
$sku = $_get->get_detail_size($detail_size->size_type_id);
if (isset($_POST['btn-detail-size'])) {
    $size_type_name = filter_var($_POST['name'], FILTER_SANITIZE_STRING);
    $size_type_id = $detail_size->size_type_id;
    $max_type_order = $_get->get_order();
    $size_type_order = $detail_size->size_type_order;
    $size_type_active = 'Active';
    $size_type_visibility = filter_var($_POST['visibility'], FILTER_SANITIZE_STRING);
    $size_name_array = filter_var($_POST['size'], FILTER_SANITIZE_STRING);
    $size_name = array();
    $size_name = explode(",", $size_name_array);
    $size_sku_array = filter_var($_POST['sku'], FILTER_SANITIZE_STRING);
    $size_sku = array();
    $size_sku = explode(",", $size_sku_array);
    $check = $_get->count_products($size_type_id);
    $check_name = $_get->count_name($size_type_name, $detail_size->size_type_id);
    if ($_POST['btn-detail-size'] != 'Delete') {
        if ($check_name->rows > 0) {
Пример #2
0
<?php

/*
# ----------------------------------------------------------------------
# SIZE GROUP - ADD: CONTROL
# ----------------------------------------------------------------------
*/
$_get = new SIZE_GET();
$_update = new SIZE_UPDATE();
if (isset($_POST['btn_add_size']) && $_POST['btn_add_size'] == 'Save Changes') {
    $size_type_name = filter_var($_POST['name'], FILTER_SANITIZE_STRING);
    $max_type_order = $_get->get_order();
    $size_type_order = $max_type_order->max_order * 1 + 1;
    $size_type_active = 'Active';
    $size_type_visibility = filter_var($_POST['visibility'], FILTER_SANITIZE_STRING);
    $size_name_array = filter_var($_POST['size'], FILTER_SANITIZE_STRING);
    $size_name = array();
    $size_name = explode(",", $size_name_array);
    $size_sku_array = filter_var($_POST['sku'], FILTER_SANITIZE_STRING);
    $size_sku = array();
    $size_sku = explode(",", $size_sku_array);
    $check = $_get->count_products($size_type_name);
    if ($check->rows > 0) {
        $type = 'danger';
        $msg = $size_type_name . ' has already taken, please input another size group name';
    } else {
        $_update->insert($size_type_name, $size_type_order, $size_type_active, $size_type_visibility, $size_sku, $size_name);
        $type = 'success';
        $msg = 'Item(s) has been successfully saved';
    }
    $page = 'add-size';
Пример #3
0
<?php

/*
# ----------------------------------------------------------------------
# SIZE GROUP: CONTROL
# ----------------------------------------------------------------------
*/
$_get = new SIZE_GET();
$_update = new SIZE_UPDATE();
/*
# ----------------------------------------------------------------------
# SORTING
# ----------------------------------------------------------------------
*/
$equal_search = array('size_type_active', 'size_type_visibility');
$default_sort_by = "size_type_name";
$pgdata = page_init($equal_search, $default_sort_by);
// static/general.php
$page = $pgdata['page'];
$query_per_page = $pgdata['query_per_page'];
$sort_by = $pgdata['sort_by'];
$first_record = $pgdata['first_record'];
$search_parameter = $pgdata['search_parameter'];
$search_value = $pgdata['search_value'];
$search_query = $pgdata['search_query'];
$search = $pgdata['search'];
if (isset($_REQUEST['src'])) {
    $_REQUEST['src'] = $_REQUEST['src'];
} else {
    $_REQUEST['src'] = '';
}