update
This commit is contained in:
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
use Hura8\Components\Product\AdminController\AProductCategoryController;
|
||||
|
||||
$objAProductCategoryController = new AProductCategoryController();
|
||||
|
||||
|
||||
$id = (int) getRequest("id");
|
||||
$item_info = ($id > 0) ? $objAProductCategoryController->getFullInfo($id) : null;
|
||||
if(!$item_info) $item_info = $objAProductCategoryController->getEmptyInfo([]);
|
||||
|
||||
|
||||
return [
|
||||
'item_info' => $item_info,
|
||||
'categoryDropBox' => $objAProductCategoryController->getDropBox( $item_info['parent_id'], 0, 1),
|
||||
'update_status' => getRequest("us"),
|
||||
];
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
353
data/product/detail.php
Normal file
353
data/product/detail.php
Normal file
File diff suppressed because one or more lines are too long
@@ -1,174 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
use Hura8\Components\Product\AdminController\AProductController;
|
||||
|
||||
|
||||
$objAProductController = new AProductController();
|
||||
$product_id = getRequestInt('id', 0);
|
||||
|
||||
$product_info = $objAProductController->getFullInfo($product_id);
|
||||
|
||||
$view_part = getRequest("part", "basic");
|
||||
|
||||
$view_part_file = str_replace("-", "_", $view_part);
|
||||
|
||||
$part_file = __DIR__."/form_components/". $view_part_file .".php";
|
||||
if(@file_exists($part_file)) {
|
||||
include $part_file;
|
||||
}else{
|
||||
die("File: /form_components/". $view_part_file .".php does not exist!");
|
||||
}
|
||||
|
||||
|
||||
return [
|
||||
"product_info" => $product_info,
|
||||
"product_menu" => _get_product_menu(),
|
||||
"view_part" => $view_part,
|
||||
];
|
||||
|
||||
// helpers
|
||||
|
||||
function _get_product_menu() {
|
||||
$current_selected = getRequest('part', 'basic');
|
||||
$product_menu = array(
|
||||
array(
|
||||
'id' => 'basic',
|
||||
"name" => "Cơ bản",
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'store',
|
||||
"name" => "Cửa hàng",
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'category',
|
||||
"name" => "Danh mục",
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'seo',
|
||||
"name" => "SEO",
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'description',
|
||||
"name" => "Mô tả",
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'spec-group',
|
||||
"name" => "Thông số kỹ thuật",//"Thông số",
|
||||
),
|
||||
|
||||
/*"spec" => array(
|
||||
"name" => "Thông số kỹ thuật nhập text", //"Bộ lọc thuộc tính", //"Thông số",
|
||||
"must_have_id" => true,
|
||||
"change_language" => true,
|
||||
),*/
|
||||
|
||||
/*"image-spec" => array(
|
||||
"name" => "Ảnh thông số",
|
||||
"must_have_id" => true,
|
||||
"change_language" => true,
|
||||
),*/
|
||||
|
||||
array(
|
||||
'id' => 'instruction',
|
||||
"name" => "Hướng dẫn sử dụng",
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'image',
|
||||
"name" => "Ảnh",
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'variant',
|
||||
"name" => "Cấu hình",
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'accessory',
|
||||
"name" => "Phụ kiện",
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'addon',
|
||||
"name" => "Dịch vụ/SP đi kèm",
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'video',
|
||||
"name" => "Youtube",
|
||||
),
|
||||
|
||||
/* "video-list" => array(
|
||||
"name" => "Thư viện Youtube",
|
||||
"must_have_id" => true,
|
||||
"change_language" => false,
|
||||
),*/
|
||||
|
||||
/*"relate-article" => array(
|
||||
"name" => "Nội dung liên quan",
|
||||
"must_have_id" => true,
|
||||
"change_language" => false,
|
||||
),*/
|
||||
|
||||
/*"web-link" => array(
|
||||
"name" => "So sánh giá",
|
||||
"must_have_id" => true,
|
||||
"change_language" => false,
|
||||
),*/
|
||||
|
||||
array(
|
||||
'id' => 'tag',
|
||||
"name" => "Tags",
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'relation',
|
||||
"name" => "Nội dung liên quan",
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'customer-group',
|
||||
"name" => "Giá theo nhóm khách hàng",
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'component',
|
||||
"name" => "Thành phần",
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'configurable',
|
||||
"name" => "Tùy chọn thành phần",
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'compatible',
|
||||
"name" => "Sp tương thích",
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'similar',
|
||||
"name" => "Sp tương tự",
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'combo-set',
|
||||
"name" => "Combo Set",
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
return array_map(function ($item) use ($current_selected){
|
||||
$copy = $item;
|
||||
$copy['is_current'] = $item['id'] == $current_selected ? 1 : 0;
|
||||
|
||||
return $copy;
|
||||
|
||||
}, $product_menu);
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1,228 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Hura8\Components\Product\AdminController\AProductController;
|
||||
use Hura8\System\Paging;
|
||||
|
||||
$objAProductController = new AProductController();
|
||||
|
||||
//Paging setting
|
||||
$numPerPage = getPageSize(15);
|
||||
$conditions = [
|
||||
"category" => explode("-", getRequest("category", '')),
|
||||
"brand" => explode("-", getRequest("brand", '')),
|
||||
"hotType" => explode("-", getRequest("hotType", '')),
|
||||
"other_filter" => [getRequest("other_filter", '')],
|
||||
"q" => getRequest("q", ''),
|
||||
'numPerPage' => $numPerPage,
|
||||
'page' => getPageId(),
|
||||
'translated' => getRequestInt('translated', 0),
|
||||
//... more extended filters
|
||||
];
|
||||
//debug_var($objAProductController->getFilterConditions());
|
||||
|
||||
$totalResults = $objAProductController->getTotal($conditions);
|
||||
$item_list = $objAProductController->getList($conditions);
|
||||
|
||||
list($page_collection, $tb_page, $total_pages) = Paging::paging_template($totalResults, $numPerPage);
|
||||
|
||||
return [
|
||||
"total" => $totalResults,
|
||||
"item_list" => $item_list,
|
||||
"pagination" => [
|
||||
'collection' => $page_collection,
|
||||
'html' => $tb_page,
|
||||
'total_pages' => $total_pages,
|
||||
],
|
||||
|
||||
"list_category" => [
|
||||
[
|
||||
'id' => 1,
|
||||
'title' => 'Màn hình máy tính',
|
||||
'url' => '/admin/product?category=9',
|
||||
'parentId' => 0,
|
||||
'isParent' => 1,
|
||||
'children' => [
|
||||
[
|
||||
'id' => 10,
|
||||
'title' => 'Màn hình theo khoảng giá',
|
||||
'url' => '/admin/product?category=148',
|
||||
'parentId' => 1,
|
||||
'isParent' => 0,
|
||||
'totalProduct' => 0,
|
||||
'children' => [
|
||||
|
||||
]
|
||||
],
|
||||
[
|
||||
'id' => 11,
|
||||
'title' => 'Màn Hình Theo Kích Thước',
|
||||
'url' => '/admin/product?category=54',
|
||||
'parentId' => 1,
|
||||
'isParent' => 0,
|
||||
'totalProduct' => 0,
|
||||
'children' => [
|
||||
[
|
||||
'id' => 148,
|
||||
'title' => '17 inch - 21.5 inch',
|
||||
'url' => '/admin/product?category=148',
|
||||
'parentId' => 11,
|
||||
'isParent' => 0,
|
||||
'totalProduct' => 5,
|
||||
],
|
||||
[
|
||||
'id' => 66,
|
||||
'title' => '22 inch - 24 inch',
|
||||
'url' => '/admin/product?category=66',
|
||||
'parentId' => 11,
|
||||
'isParent' => 0,
|
||||
'totalProduct' => 41,
|
||||
],
|
||||
[
|
||||
'id' => 67,
|
||||
'title' => '25 inch - 27 inch',
|
||||
'url' => '/admin/product?category=67',
|
||||
'parentId' => 11,
|
||||
'isParent' => 0,
|
||||
'totalProduct' => 42,
|
||||
],
|
||||
[
|
||||
'id' => 68,
|
||||
'title' => '28 inch - 32 inch',
|
||||
'url' => '/admin/product?category=68',
|
||||
'parentId' => 11,
|
||||
'isParent' => 0,
|
||||
'totalProduct' => 11,
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
]
|
||||
],
|
||||
[
|
||||
'id' => 65,
|
||||
'title' => 'PC, Workstation',
|
||||
'url' => '/admin/product?category=65',
|
||||
'parentId' => 0,
|
||||
'isParent' => 1,
|
||||
'children' => []
|
||||
],
|
||||
[
|
||||
'id' => 3,
|
||||
'title' => 'Gaming Gear',
|
||||
'url' => '/admin/product?category=3',
|
||||
'parentId' => 0,
|
||||
'isParent' => 1,
|
||||
'children' => []
|
||||
],[
|
||||
'id' => 4,
|
||||
'title' => 'CPU - Bộ Vi Xử Lý',
|
||||
'url' => '/admin/product?category=4',
|
||||
'parentId' => 0,
|
||||
'isParent' => 1,
|
||||
'children' => []
|
||||
]
|
||||
|
||||
],
|
||||
|
||||
"brand_letters" => [
|
||||
[
|
||||
'key' => 'A',
|
||||
'url' => '/ajax/brand.php?action=show-brand-list&letter=A&popup=1',
|
||||
'total' => 13,
|
||||
],
|
||||
[
|
||||
'key' => 'B',
|
||||
'url' => '/ajax/brand.php?action=show-brand-list&letter=B&popup=1',
|
||||
'total' => 2,
|
||||
],
|
||||
[
|
||||
'key' => 'C',
|
||||
'url' => '/ajax/brand.php?action=show-brand-list&letter=C&popup=1',
|
||||
'total' => 5,
|
||||
]
|
||||
|
||||
],
|
||||
|
||||
"list_brands" => [
|
||||
|
||||
'A' => [
|
||||
[
|
||||
'id' => 1,
|
||||
'name' => 'ABS',
|
||||
'letter' => 'A',
|
||||
'url' => '/admin/?brand=83&opt=product',
|
||||
'product' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 2,
|
||||
'name' => 'ACE GAMING',
|
||||
'letter' => 'A',
|
||||
'url' => '/admin/?brand=83&opt=product',
|
||||
'product' => 6,
|
||||
],
|
||||
[
|
||||
'id' => 3,
|
||||
'name' => 'ADATA',
|
||||
'letter' => 'A',
|
||||
'url' => '/admin/?brand=83&opt=product',
|
||||
'product' => 15,
|
||||
]
|
||||
],
|
||||
|
||||
'B' => [
|
||||
[
|
||||
'id' => 3,
|
||||
'name' => 'BE QUIET ',
|
||||
'letter' => 'B',
|
||||
'url' => '/admin/?brand=83&opt=product',
|
||||
'product' => 2,
|
||||
],
|
||||
[
|
||||
'id' => 3,
|
||||
'name' => 'BENQ',
|
||||
'letter' => 'B',
|
||||
'url' => '/admin/?brand=83&opt=product',
|
||||
'product' => 6,
|
||||
],
|
||||
],
|
||||
|
||||
'C' => [
|
||||
[
|
||||
'id' => 3,
|
||||
'name' => 'CISCO',
|
||||
'letter' => 'C',
|
||||
'url' => '/admin/?brand=83&opt=product',
|
||||
'product' => 2,
|
||||
],
|
||||
[
|
||||
'id' => 3,
|
||||
'name' => 'Colorful',
|
||||
'letter' => 'C',
|
||||
'url' => '/admin/?brand=83&opt=product',
|
||||
'product' => 6,
|
||||
],
|
||||
[
|
||||
'id' => 3,
|
||||
'name' => 'COOLER MASTER',
|
||||
'letter' => 'C',
|
||||
'url' => '/admin/?brand=83&opt=product',
|
||||
'product' => 6,
|
||||
],
|
||||
[
|
||||
'id' => 3,
|
||||
'name' => 'COOLMOON',
|
||||
'letter' => 'C',
|
||||
'url' => '/admin/?brand=83&opt=product',
|
||||
'product' => 6,
|
||||
],
|
||||
[
|
||||
'id' => 3,
|
||||
'name' => 'CORSAIR',
|
||||
'letter' => 'C',
|
||||
'url' => '/admin/?brand=83&opt=product',
|
||||
'product' => 6,
|
||||
],
|
||||
]
|
||||
]
|
||||
|
||||
];
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
@@ -1 +0,0 @@
|
||||
<?php
|
||||
Reference in New Issue
Block a user