示例#1
0
<?php

/*
# ----------------------------------------------------------------------
# PRODUCTS - DETAIL: CONTROL
# ----------------------------------------------------------------------
*/
include "get.php";
include "update.php";
if (isset($_REQUEST['lang'])) {
    $lang = filter_var($_REQUEST['lang'], FILTER_SANITIZE_STRING);
} else {
    $lang = 'ID';
}
$_get = new PRODUCTS_GET();
if ($lang === 'ID') {
    $data = $_get->get_product_details();
}
$all_category = $_get->get_all_category();
$all_size_group = $_get->get_all_size_group();
$all_color_group = $_get->get_all_color_group();
/* --- PRODUCT PHOTO --- */
$product_photo = 5;
/* --- BUTTON HANDLER --- */
if ($lang === 'ID') {
    if (isset($_POST["btn-product-detail"]) && $_POST["btn-product-detail"] == 'Save Changes') {
        $_update = new PRODUCTS_UPDATE();
        $_update->insert_product();
    } else {
        if (isset($_POST["btn-product-detail"]) && $_POST["btn-product-detail"] == 'Delete') {
            $_update = new PRODUCTS_UPDATE();
示例#2
0
     {
         $this->conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
     }
     function get_size($size_type_id)
     {
         $sql = "SELECT * from tbl_size WHERE size_type_id = '{$size_type_id}' ORDER BY size_order";
         $query = $this->conn->query($sql);
         $row = array();
         while ($result = $query->fetch_object()) {
             array_push($row, $result);
         }
         return $row;
     }
 }
 $_ajax = new AJAX();
 $_get = new PRODUCTS_GET();
 $_GET["product_alias"] = $_POST["product_alias"];
 $data = $_get->get_product_details();
 $size_type_id = filter_var($_POST["size_type_id"], FILTER_SANITIZE_STRING);
 $type_order = filter_var($_POST["type_order"], FILTER_SANITIZE_NUMBER_INT);
 $check_array = $_ajax->get_size($size_type_id);
 //if (mysql_num_rows($check)!=null){
 //for($i=0;$i<mysql_num_rows($check);$i++){
 //$check_array = mysql_fetch_array($check);
 //}
 //}
 $i = 0;
 foreach ($check_array as $key => $check_array) {
     $size_name = $check_array->size_name;
     if ($data['quantity'][$type_order][$size_name] == '') {
         $data['quantity'][$type_order][$size_name] = 0;
示例#3
0
<?php

/*
# ----------------------------------------------------------------------
# PRODUCTS - INACTIVE: CONTROL
# ----------------------------------------------------------------------
*/
$_get = new PRODUCTS_GET();
$equal_search = array('type_price', 'type_visibility');
$default_sort_by = "product_order";
$pgdata = page_init($equal_search, $default_sort_by);
$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'] = '';
}
/* --- CATEGORY --- */
if (isset($_REQUEST['cat'])) {
    if ($_REQUEST["cat"] == "" || $_REQUEST["cat"] == "top") {
        $cat = 'top';
    } else {
        $cat = $_REQUEST["cat"];
    }
示例#4
0
<?php

/*
# ----------------------------------------------------------------------
# PRODUCTS - ADD: CONTROL
# ----------------------------------------------------------------------
*/
include "get.php";
include "update.php";
$_get = new PRODUCTS_GET();
$all_category = $_get->get_all_category();
$all_size_group = $_get->get_all_size_group();
$all_color_group = $_get->get_all_color_group();
/* --- BUTTON HANDLER --- */
if (isset($_POST['add-product']) && $_POST["add-product"] == 'Save & Create New') {
    $_update = new PRODUCTS_UDPATE();
    $_update->insert_product();
    $page = 'add-product';
    $type = 'success';
    $msg = 'Item successfully saved';
    set_alert($type, $msg);
    //safe_redirect($page);
    /*
    echo '<pre>';
    print_r($_FILES);
    echo '</pre>';
    
    echo '<pre>';
    print_r($_POST);
    echo '</pre>';
    */