This commit is contained in:
2024-01-31 11:36:25 +07:00
parent caef156a05
commit 4561bd68d1
125 changed files with 9117 additions and 58 deletions

View File

@@ -1,17 +1,55 @@
<?php
return _get_order_list();
// helpers
function _get_order_list() {
$main_items = [
'detail_new',
];
use Hura8\Components\Order\AdminController\AOrderController;
use Hura8\Components\Order\Controller\OrderStatus;
use Hura8\System\Paging;
$menu_list = [];
foreach ($main_items as $item) {
$menu_list[$item] = include_once __DIR__."/".$item.".php";
}
$numPerPage = 30;
return $menu_list;
}
$conditions = array(
'orderCode' => getRequest('orderCode', ''),
'q' => getRequest('q', ''),
//'coupon' => getRequest('coupon', ''),
'cus_id' => getRequest('cus_id', ''),
'province' => getRequest('province', ''),
//'district' => getRequest('district', ''),
'folder' => getRequest('folder', ''),
'view_status' => getRequest('view_status', ''),
'update_by' => getRequest('update_by', ''),
//'shipping_status' => getRequest('shipping_status', ''),
'assign_to' => getRequest('assign_to', ''),
'from_date' => getRequest('from_date', ''),
'to_date' => getRequest('to_date', ''),
//'from_hour' => getRequest('from_hour', ''),
//'to_hour' => getRequest('to_hour', ''),
'payment' => getRequest('payment', ''),
'fullfillment' => getRequest('fullfillment', ''),
'status' => getRequest('status', ''),
//'excluded_ids' => getRequest('', ''),
//'included_ids' => getRequest('', ''),
'list' => getRequest('list', ''),
'numPerPage' => $numPerPage,
'page' => getPageId(),
);
$objAOrderController = new AOrderController();
$totalResults = $objAOrderController->getTotal($conditions);
$item_list = $objAOrderController->getList($conditions);
debug_var($item_list);
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,
],
"order_status_list" => OrderStatus::ORDER_STATUS ,
"payment_status_list" => OrderStatus::PAYMENT_STATUS,
"fullfillment_status_list" => OrderStatus::FULFILLMENT_STATUS ,
];

102
data/product/category.php Normal file
View File

@@ -0,0 +1,102 @@
<?php
use Hura8\Components\Product\AdminController\AProductCategoryController;
$objAProductCategoryController = new AProductCategoryController();
$category_collection = $objAProductCategoryController->getAllParent();
return [
'category_list' => get_category_list(0, getRequest("id"), $level=1, $prefix="", $category_collection )
];
function get_category_list($parentId=0, $currentCat="",$level=1, $prefix="", $category_collection = array()){
$categoryTree = "";
$extra_space = "";
for($i = 1; $i < $level; $i++){
$extra_space .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
}
$stt = 0;
if(isset($category_collection[$parentId])) {
foreach($category_collection[$parentId] as $index => $cat_info){
$cat_id = $cat_info['id'];
$stt ++;
$imgUrl = (strlen($cat_info["thumbnail"]) > 2) ? " <img src=\"".$cat_info["thumbnail"]."\" style=\"max-width:30px; max-height:30px;\" />" : "";
if($cat_info["status"]) $status = "<a href=\"javascript:update_status(".$cat_id.",'off')\">Hạ xuống</a>";
else $status = "<a href=\"javascript:update_status(".$cat_id.",'on')\" style=\"background-color:#FFCC00;\">Hiển thị</a>";
$edit_link ="/admin/product/category-form?id=".$cat_id;
$hide_this = ($parentId > 0) ? "style='display: none;'" : '';
$show_category_name = $cat_info["title"];
if(!IS_DEFAULT_LANGUAGE && isset($cat_info["not_translated"]) && $cat_info["not_translated"]) {
$show_category_name = "<span style='color: red'>[Chưa dịch]</span> ".$cat_info["title"];
}
if($cat_info['is_parent']) {
$show_category_name = "<a href=\"javascript:;\" onclick=\"RowExpand.open_child('parent_".$cat_id."')\">".$show_category_name."</a>";
}
$categoryTree .= "
<tr id='row_".$cat_id."' class='parent_".$parentId." row' ". $hide_this ."
onmouseover=\"this.className='row-hover parent_".$parentId."'\" onmouseout=\"this.className='parent_".$parentId."'\">
<td>".$cat_id."</td>
<td>
<a name='cat_".$cat_id."'></a>
". $extra_space . $prefix . $stt.". ". $show_category_name . $imgUrl."
</td>
<td>".$cat_info['item_count']." - <a href='/admin/product?category=".$cat_id."'>Xem</a></td>
<td>
<a href='".$cat_info['request_path']."' title='Mở tại website' target='_blank'>Web</a>
</td>
<td>
<input type=text id=order_".$cat_id." value='".$cat_info["ordering"]."' size=2 onchange=\"update_order(".$cat_id.",this.value)\" />
<span class='status-ordering-".$cat_id."'></span>
</td>
";
if(IS_DEFAULT_LANGUAGE) {
$categoryTree .= "
<td>
<a href='/admin/product/category-attribute?id=".$cat_id."&popup=1' class='pop-up'>Thuộc tính</a> (".$cat_info['attribute_count'].")
</td>
<td>
<span id=status-".$cat_id.">".$status."</span> |
<a href=\"".$edit_link."\">Sửa lại</a> |
<span class='status-delete-".$cat_id."'><a href=\"javascript:deleteThis(".$cat_id.")\">Xóa</a></span>
</td>
";
}else{
$categoryTree .= "
<td>
<a href=\"".$edit_link."\">Sửa lại</a>
</td>
";
}
$categoryTree .= "
</tr>
";
if($cat_info["is_parent"]) $categoryTree .= get_category_list($cat_id, $currentCat, $level + 1, $prefix . $stt.".", $category_collection);
}
}
return $categoryTree;
}

View File

@@ -0,0 +1,18 @@
<?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"),
];