Compare commits

..

4 Commits

Author SHA1 Message Date
6166366250 category 2024-02-27 13:35:20 +07:00
4773342421 category 2024-02-27 13:33:08 +07:00
1a5515ed95 category 2024-02-27 13:31:27 +07:00
22ceb73fb1 a 2024-02-23 09:18:06 +07:00
12 changed files with 579 additions and 223 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -735,6 +735,11 @@ input[type=radio]:focus:before {
height: 16px;
background-position: -224px -88px;
}
.icons.icon-feature {
width: 18px;
height: 16px;
background-position: -259px -88px;
}
.admin-header-container .menu-hide {
margin-left: 30px;
@@ -746,7 +751,7 @@ input[type=radio]:focus:before {
height: 36px;
padding: 0 10px;
border-radius: 4px;
border: 1px solid #D8D8D8;
border: 1px solid #d8d8d8;
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.1);
}
@@ -964,13 +969,50 @@ input[type=radio]:focus:before {
border: 1px solid #ececec;
}
.table-list-category td {
padding: 6px 5px;
border: 1px solid #ececec;
}
.table-list-category a {
color: #0041e8;
}
.input-file {
position: relative;
}
.input-file input {
opacity: 0;
}
.input-file .title {
position: absolute;
top: 0;
left: 10px;
display: flex;
align-items: center;
}
.input-file .btn-input-file {
width: 120px;
height: 30px;
text-align: center;
line-height: 30px;
border-radius: 4px;
border: 1px solid #0041e8;
color: #0041e8;
cursor: pointer;
margin-right: 10px;
}
.input-file .btn-input-file:hover {
background: #0041e8;
color: #fff;
}
.modal .order-page-table td {
vertical-align: middle;
}
.modal .brand-letters a {
width: 11.1111111111%;
text-transform: capitalize;
color: #0041E8;
color: #0041e8;
}
.modal .brand-letters a:hover {
text-decoration: underline;

File diff suppressed because one or more lines are too long

View File

@@ -743,6 +743,11 @@ input[type="radio"] {
height: 16px;
background-position: -224px -88px;
}
&.icon-feature {
width: 18px;
height: 16px;
background-position: -259px -88px;
}
}
.admin-header-container {
@@ -757,8 +762,8 @@ input[type="radio"] {
height: 36px;
padding: 0 10px;
border-radius: 4px;
border: 1px solid #D8D8D8;
box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.10);
border: 1px solid #d8d8d8;
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.1);
}
.order-page {
@@ -870,8 +875,8 @@ input[type="radio"] {
right: 10px !important;
color: #9e9e9e !important;
}
.td-border-0{
td{
.td-border-0 {
td {
border: 0 !important;
padding: 3px 0;
width: auto;
@@ -997,18 +1002,56 @@ input[type="radio"] {
}
}
.modal{
.table-list-category {
td {
padding: 6px 5px;
border: 1px solid #ececec;
}
a {
color: #0041e8;
}
}
.input-file {
position: relative;
input {
opacity: 0;
}
.title {
position: absolute;
top: 0;
left: 10px;
display: flex;
align-items: center;
}
.btn-input-file {
width: 120px;
height: 30px;
text-align: center;
line-height: 30px;
border-radius: 4px;
border: 1px solid #0041e8;
color: #0041e8;
cursor: pointer;
margin-right: 10px;
&:hover {
background: #0041e8;
color: #fff;
}
}
}
.modal {
.order-page-table {
td{
td {
vertical-align: middle;
}
}
.brand-letters {
a{
a {
width: calc(100% / 9);
text-transform: capitalize;
color: #0041E8;
&:hover{
color: #0041e8;
&:hover {
text-decoration: underline;
}
}

View File

@@ -28,8 +28,8 @@ function get_category_list($parentId=0, $currentCat="",$level=1, $prefix="", $ca
$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>";
if($cat_info["status"]) $status = "<a href=\"javascript:update_status(".$cat_id.",'off')\" class='w-[30px] h-[30px] border-[1px] border-[#9E9E9E] rounded-[4px] text-center leading-[30px] flex items-center justify-center mr-[5px]'><i class='fa-regular fa-eye-slash text-[#9E9E9E]'></i></a>";
else $status = "<a href=\"javascript:update_status(".$cat_id.",'on')\" class='w-[30px] h-[30px] border-[1px] border-[#0041E8] rounded-[4px] text-center leading-[30px] flex items-center justify-center mr-[5px]'><i class='fa-regular fa-eye text-[#0041E8]'></i></a>";
$edit_link ="/admin/product/category-form?id=".$cat_id;
@@ -49,41 +49,47 @@ function get_category_list($parentId=0, $currentCat="",$level=1, $prefix="", $ca
<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>
<a href='".$cat_info['request_path']."' title='Mở tại website' target='_blank'>Xem trang</a>
</td>
<td>".$cat_id."</td>
<td>413787</td>
<td><a href='/admin/product?category=".$cat_id."'>1292</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>
<td>
SP + Danh mục con
</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'].")
<a href='/admin/product/category-attribute?id=".$cat_id."&popup=1' class='pop-up'>Tổng</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>
<div class='list-btn flex items-center'>
<a href=\"".$edit_link."\" class='w-[30px] h-[30px] border-[1px] border-[#0041E8] rounded-[4px] text-center leading-[30px] flex items-center justify-center mr-[5px]'><i class='icons icon-edit'></i></a>
<a class='w-[30px] h-[30px] border-[1px] border-[#0041E8] rounded-[4px] text-center leading-[30px] flex items-center justify-center mr-[5px]' href='javascript:set_category_feature(.$cat_id.,'off')'><i class='icons icon-feature'></i></a>
<span id=status-".$cat_id.">".$status."</span>
<span class='status-delete-".$cat_id."'><a href=\"javascript:deleteThis(".$cat_id.")\" class='w-[30px] h-[30px] border-[1px] border-[#9E9E9E] rounded-[4px] text-center leading-[30px] flex items-center justify-center mr-[5px]'><i class='icons icon-remove'></i></a></span>
</div>
</td>
";
}else{
$categoryTree .= "
<td>
<a href=\"".$edit_link."\">Sửa lại</a>
<a href=\"".$edit_link."\"><i class='icons icon-edit'></i></a>
</td>
";
}

View File

@@ -1,39 +1,50 @@
<div class="m-[16px_0_16px_16px] p-[20px_16px] bg-white rounded-[10px] shadow-[0px_1px_1px_0px_rgba(0,0,0,0.10)] leading-[20px]">
<div
class="m-[16px_0_16px_16px] p-[20px_16px] bg-white rounded-[10px] shadow-[0px_1px_1px_0px_rgba(0,0,0,0.10)] leading-[20px]">
<p class="leading-[31px] font-bold text-[24px] mb-[12px]"> Danh sách banner </p>
<form method='get' enctype="multipart/form-data" action="/admin/" class="border border-[#F6F6F6] m-[12px_0_16px] p-[15px] bg-white rounded-[10px] shadow-[0px_1px_1px_0px_rgba(0,0,0,0.10)]">
<input type='hidden' name='opt' value='banner'/>
<form method='get' enctype="multipart/form-data" action="/admin/"
class="border border-[#F6F6F6] m-[12px_0_16px] p-[15px] bg-white rounded-[10px] shadow-[0px_1px_1px_0px_rgba(0,0,0,0.10)]">
<input type='hidden' name='opt' value='banner' />
<input type='hidden' name='q' value='' />
<input type='hidden' name='page' value=''/>
<input type='hidden' name='page' value='' />
<input type=text name='q' id='keyword' value="" placeholder="Tìm banner(theo tên)" class="w-[375px] h-[36px] border border-[#D8D8D8] m-[0_10px_0_0] p-[0_10px] bg-white rounded-[4px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.12)] "/>
<input type=submit value='Tìm kiếm' class="h-[36px] bg-[#0041E8] text-[#fff] font-[500] p-[0_8px] cursor-pointer rounded-[4px]">
<input type=text name='q' id='keyword' value="" placeholder="Tìm banner(theo tên)"
class="w-[375px] h-[36px] border border-[#D8D8D8] m-[0_10px_0_0] p-[0_10px] bg-white rounded-[4px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.12)] " />
<input type=submit value='Tìm kiếm'
class="h-[36px] bg-[#0041E8] text-[#fff] font-[500] p-[0_8px] cursor-pointer rounded-[4px]">
</form>
<div class="flex items-center flex-wrap justify-between">
<div class="flex items-center">
<select class="m-[0_16px_16px_0] h-[36px] p-[0_15px_0_5px] rounded-[4px] border border-[#d8d8d8] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.12)]">
<select
class="m-[0_16px_16px_0] h-[36px] p-[0_15px_0_5px] rounded-[4px] border border-[#d8d8d8] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.12)]">
<option value="">Xem theo vị trí banner</option>
<option value='43'> - Banner MB Webmau4</option>
<option value='42'> - Brand Homepage</option>
</select>
<select class="m-[0_16px_16px_0] h-[36px] p-[0_15px_0_5px] rounded-[4px] border border-[#d8d8d8] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.12)]">
<select
class="m-[0_16px_16px_0] h-[36px] p-[0_15px_0_5px] rounded-[4px] border border-[#d8d8d8] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.12)]">
<option value="">Lọc hiển thị</option>
<option value="">Chưa hiển thị</option>
<option value="">Đang hiển thị</option>
</select>
<a href="" class="m-[0_16px_16px_0] leading-[36px] p-[0_10px] rounded-[4px] border border-[#0041E8] text-[#0041E8] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.12)] hover:bg-[#0041E8] hover:text-[#fff]">Chọn danh mục sản phẩm để xem</a>
<a href=""
class="m-[0_16px_16px_0] leading-[36px] p-[0_10px] rounded-[4px] border border-[#0041E8] text-[#0041E8] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.12)] hover:bg-[#0041E8] hover:text-[#fff]">Chọn
danh mục sản phẩm để xem</a>
</div>
<div class="flex items-center font-[500] leading-[34.5px]">
<a href="/admin/banner/upload" class="inline-flex items-center whitespace-nowrap border border-[#0041E8] rounded-[4px] bg-[#F5F7FF] text-[#0041E8] p-[0_12px] m-[0_16px_16px_0] group hover:bg-[#0041E8] hover:text-[#fff]">
<span class="border-[1px] border-[#0041E8] h-[13px] w-[13px] leading-[10.2px] text-center rounded-[50%] mr-1 group-hover:border-[#fff]">+</span>
<a href="/admin/banner/upload"
class="inline-flex items-center whitespace-nowrap border border-[#0041E8] rounded-[4px] bg-[#F5F7FF] text-[#0041E8] p-[0_12px] m-[0_16px_16px_0] group hover:bg-[#0041E8] hover:text-[#fff]">
<span
class="border-[1px] border-[#0041E8] h-[13px] w-[13px] leading-[10.2px] text-center rounded-[50%] mr-1 group-hover:border-[#fff]">+</span>
<span>Thêm banner mới</span>
</a>
<a href="/admin/banner/location" class="inline-flex items-center whitespace-nowrap border border-[#0041E8] rounded-[4px] bg-[#F5F7FF] text-[#0041E8] p-[0_12px] m-[0_0_16px_0] group hover:bg-[#0041E8] hover:text-[#fff]">
<a href="/admin/banner/location"
class="inline-flex items-center whitespace-nowrap border border-[#0041E8] rounded-[4px] bg-[#F5F7FF] text-[#0041E8] p-[0_12px] m-[0_0_16px_0] group hover:bg-[#0041E8] hover:text-[#fff]">
<i class="far fa-image mr-[8px]"></i>
<span>Quản trị vị trí banner</span>
</a>
@@ -47,7 +58,7 @@
<td width="280"> Ảnh </td>
<td> Thông tin </td>
<td> Thứ tự </td>
<td> Click </td>
<td> Click </td>
<td> Chỉnh sửa </td>
</thead>
@@ -56,14 +67,15 @@
<td align="center"> 1 </td>
<td>
<img src="https://demopc8.hurasoft.com/media/banner/21_06-1f22593caab42ff1e4ebf38094a75afe.jpeg" width="260"/>
<img src="https://demopc8.hurasoft.com/media/banner/21_06-1f22593caab42ff1e4ebf38094a75afe.jpeg"
width="260" />
</td>
<td>
<table class="td-border-0">
<tr>
<td width="115">Tên gọi:</td>
<td> </td>
<td> </td>
</tr>
<tr>
@@ -107,16 +119,68 @@
<div class="items-center flex justify-center">
<a href="/admin/banner/upload?id=1" class="icons icon-edit" title="Sửa lại"></a>
<a href="javascript:void(0)" title="Hạ Hiển thị" class="far fa-eye-slash bg-[#F9F9F9] leading-[30px] rounded-[5px] text-[#9E9E9E_!important] text-center w-[30px] border border-[#ECECEC] mr-[8px]"></a>
<a href="javascript:void(0)" title="Hạ Hiển thị"
class="far fa-eye-slash bg-[#F9F9F9] leading-[30px] rounded-[5px] text-[#9E9E9E_!important] text-center w-[30px] border border-[#ECECEC] mr-[8px]"></a>
<a href="javascript:void(0)" title="Cho Hiển thị" class="far fa-eye bg-[#F5F7FF] leading-[30px] rounded-[5px] text-[#0041E8_!important] text-center w-[30px] border border-[#0041E8] mr-[8px]"> </a>
<a href="javascript:void(0)" title="Cho Hiển thị"
class="far fa-eye bg-[#F5F7FF] leading-[30px] rounded-[5px] text-[#0041E8_!important] text-center w-[30px] border border-[#0041E8] mr-[8px]">
</a>
<a href="javascript:void(0)" class="icons icon-delete" title="Xóa"></a>
</div>
</td>
</tr>
<tr> <td align="center"> 2 </td><td> <img src="https://demopc8.hurasoft.com/media/banner/21_06-1f22593caab42ff1e4ebf38094a75afe.jpeg" width="260"/> </td><td> <table class="td-border-0"> <tr> <td width="115">Tên gọi:</td><td> </td></tr><tr> <td>Link tới:</td><td> </td></tr><tr> <td>File:</td><td>/media/banner/21_06-1f22593caab42ff1e4ebf38094a75afe.jpeg</td></tr><tr> <td>Kích thước:</td><td>Rộng x Cao (Width x Height)=3130px x 2075px</td></tr><tr> <td>Link:</td><td>/ad.php?id=236</td></tr><tr> <td>Thời gian hiển thị:</td><td>Luôn hiển thị, chỉ ẩn khi hạ bằng tay</td></tr><tr> <td>Cập nhật:</td><td>21-06-2023, 11:08 am</td></tr></table> </td><td align="center"> 0 </td><td align="center"> 0 </td><td> <div class="items-center flex justify-center"> <a href="/admin/banner/upload?id=1" class="icons icon-edit" title="Sửa lại"></a> <a href="javascript:void(0)" title="Hạ Hiển thị" class="far fa-eye-slash bg-[#F9F9F9] leading-[30px] rounded-[5px] text-[#9E9E9E_!important] text-center w-[30px] border border-[#ECECEC] mr-[8px]"></a> <a href="javascript:void(0)" title="Cho Hiển thị" class="far fa-eye bg-[#F5F7FF] leading-[30px] rounded-[5px] text-[#0041E8_!important] text-center w-[30px] border border-[#0041E8] mr-[8px]"> </a> <a href="javascript:void(0)" class="icons icon-delete" title="Xóa"></a> </div></td></tr>
<tr>
<td align="center"> 2 </td>
<td> <img
src="https://demopc8.hurasoft.com/media/banner/21_06-1f22593caab42ff1e4ebf38094a75afe.jpeg"
width="260" /> </td>
<td>
<table class="td-border-0">
<tr>
<td width="115">Tên gọi:</td>
<td> </td>
</tr>
<tr>
<td>Link tới:</td>
<td> </td>
</tr>
<tr>
<td>File:</td>
<td>/media/banner/21_06-1f22593caab42ff1e4ebf38094a75afe.jpeg</td>
</tr>
<tr>
<td>Kích thước:</td>
<td>Rộng x Cao (Width x Height)=3130px x 2075px</td>
</tr>
<tr>
<td>Link:</td>
<td>/ad.php?id=236</td>
</tr>
<tr>
<td>Thời gian hiển thị:</td>
<td>Luôn hiển thị, chỉ ẩn khi hạ bằng tay</td>
</tr>
<tr>
<td>Cập nhật:</td>
<td>21-06-2023, 11:08 am</td>
</tr>
</table>
</td>
<td align="center"> 0 </td>
<td align="center"> 0 </td>
<td>
<div class="items-center flex justify-center"> <a href="/admin/banner/upload?id=1"
class="icons icon-edit" title="Sửa lại"></a> <a href="javascript:void(0)"
title="Hạ Hiển thị"
class="far fa-eye-slash bg-[#F9F9F9] leading-[30px] rounded-[5px] text-[#9E9E9E_!important] text-center w-[30px] border border-[#ECECEC] mr-[8px]"></a>
<a href="javascript:void(0)" title="Cho Hiển thị"
class="far fa-eye bg-[#F5F7FF] leading-[30px] rounded-[5px] text-[#0041E8_!important] text-center w-[30px] border border-[#0041E8] mr-[8px]">
</a> <a href="javascript:void(0)" class="icons icon-delete" title="Xóa"></a>
</div>
</td>
</tr>
</tbody>
</table>
</div>

View File

@@ -13,7 +13,8 @@
<div class="list-filter flex items-center justify-between mt-[15px] mb-[20px]">
<p>Tổng số: <b>1.996</b></p>
<p>Tổng hợp các liên hệ của khách hàng từ form liên hệ trên trang <a href="" class="text-[#0041E8]">liên
hệ</a> của website</p>
<select name="" id=""
class="w-[180px] h-[35px] p-[5px] border-[1px] border-[#D8D8D8] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)]">
<option value="">Chọn bộ lọc</option>

View File

@@ -20,5 +20,21 @@
});
tinymce.init({
selector: 'textarea#product-static',
height: 350,
menubar: true,
plugins: [
'advlist autolink lists link image charmap print preview anchor',
'searchreplace visualblocks code fullscreen',
'insertdatetime media table paste code help wordcount'
],
toolbar: 'undo redo | formatselect | ' +
'bold italic backcolor | alignleft aligncenter ' +
'alignright alignjustify | bullist numlist outdent indent | ' +
'removeformat | help',
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }'
});
</script>

View File

@@ -1,50 +1,71 @@
<div class="w-[100%]">
<div
class="m-[15px] px-[15px] py-[20px] rounded-[15px] bg-white shadow-[0_1px_1px_0_rgba(0,0,0,0.1)] overflow-x-auto">
<h1 class="text-[24px] font-[700] mb-3">Danh sách sản phẩm</h1>
<div id="action-links">
<ul>
<li id="add-prod"><a href="/admin/product/category-form">Thêm mới</a></li>
<li><a href="/admin/product/category">Danh sách</a></li>
</ul>
<div id="action-links" class="mb-[15px]">
<div class="flex item-center justify-between">
<div
class="p-[5px_10px] border-[1px] border-[#79B0E2] rounded-[4px] text-[14px] text-[#79B0E2] hover:bg-[#79B0E2] hover:text-[#fff]">
<a href='javascript:;' onclick="RowExpand.open_all();"><span id='js-row-expand-all'></span> Xem hết
danh mục</a>
</div>
<a href="/admin/product/category-form" id="add-prod"
class="p-[5px_10px] border-[1px] border-[#0041E8] rounded-[4px] text-[14px] text-[#0041E8] flex items-center hover:bg-[#0041E8] hover:text-white"><span
class="border-[1px] border-[#0041E8] h-[14px] w-[14px] leading-[12px] text-center rounded-[50%] mr-1">+</span>
<span class="font-[500]">Thêm
danh mục mới</span></a>
</div>
</div>
<style type="text/css">
.tb-cat-row {
width: 100%;
}
.tb-cat-row td {
padding: 1px
}
</style>
<table id='tb_padding' cellpadding=2 cellspacing=0 width='100%' border=1 bordercolor='#CCCCCC'
class="table-list-category">
<tr style="background-color:#EEE; font-weight:bold;">
<td>Danh mục</td>
<td width=100px>Link web</td>
<td width=40px>ID</td>
<td>Xem</td>
<td width=100px>SP</td>
<td width=100px>STT</td>
<td>Hiển thị nội dung</td>
<td width=100px>Thuộc tính</td>
<td width=200px>Cập nhật</td>
</tr>
{{page.category_list}}
</table>
<p style="margin-top: 10px">
<strong style="color: red">Lưu ý</strong>: Tổng sản phẩm ở danh mục mẹ được tính là tổng sản phẩm sản phẩm
của các danh mục con và danh mục mẹ. Bộ đếm không loại trừ sản phẩm trùng nhau (v.d. trường hợp 1 sản phẩm
thuộc cả 2 danh mục con thì sẽ được đếm 2 lần)
</p>
<input type="hidden" id="save_open_row" value="," />
<input type="hidden" id="track_open_row" value="0" />
</div>
</div>
<style type="text/css">
.tb-cat-row { width:100%;}
.tb-cat-row td { padding:1px}
</style>
<div style='padding-bottom:5px'><a href='javascript:;' onclick="RowExpand.open_all();"><span id='js-row-expand-all'>[+]</span> Xem hết</a></div>
<table id='tb_padding' cellpadding=2 cellspacing=0 width='100%' border=1 bordercolor='#CCCCCC'>
<tr style="background-color:#EEE; font-weight:bold;">
<td width=40px>ID</td>
<td>Tên gọi</td>
<td width=100px>Sản phẩm</td>
<td width=100px>Web</td>
<td width=100px>Thứ tự hiển thị</td>
<td width=100px>Thuộc tính</td>
<td width=200px>Sửa lại</td>
</tr>
{{page.category_list}}
</table>
<p style="margin-top: 10px">
<strong style="color: red">Lưu ý</strong>: Tổng sản phẩm ở danh mục mẹ được tính là tổng sản phẩm sản phẩm của các danh mục con và danh mục mẹ. Bộ đếm không loại trừ sản phẩm trùng nhau (v.d. trường hợp 1 sản phẩm thuộc cả 2 danh mục con thì sẽ được đếm 2 lần)
</p>
<input type="hidden" id="save_open_row" value="," />
<input type="hidden" id="track_open_row" value="0" />
<script src="{{ 'RowExpand.js' | asset_url }}"></script>
<script>
function update_order(id, new_val){
function update_order(id, new_val) {
alert("todo");
}
function update_status(id, status){
function update_status(id, status) {
alert("todo");
}

View File

@@ -1,131 +1,294 @@
{if="$item_info.id > 0"}
{$language_selector}
<br />
{/if}
<div class="w-[100%] mb-[50px]">
<div id="action-links">
<ul>
<li id="add-prod"><a href="/admin/product/category-form">Thêm mới</a></li>
<li class="csv"><a href="/admin/product/category">Xem danh sách</a></li>
</ul>
</div>
{if="$update_status == 'success'"}
<p class="update-success">Cập nhật thành công</p>
{/if}
<form method="post" enctype="multipart/form-data">
<input type=hidden name='info[id]' value='{$item_info.id}' />
<div class="group">
<div class="group-fields">
<dl>
<dt class="top"><label>Tên gọi</label></dt>
<dd><input type="text" size="60" name="info[title]" id="title" value="{$item_info.title}"></dd>
<!-- <dt class="top"><label>API Key</label></dt>
<dd><input type="text" size="40" name="info[api_key]" id="api_key" value="{$item_info.api_key}"></dd>-->
{if="$item_info.id > 0"}
<dt><label>Url Index</label></dt>
<dd><input type=text size=40 value='{$item_info.url_index}' name='info[url_index]' /> (* thay đổi giá trị này sẽ thay đổi link truy cập) </dd>
{/if}
<dt><label>Thông tin tóm tắt</label> <span class="note">(nếu có)</span></dt>
<dd style="margin-bottom: 0">
<!-- editor -->
<textarea name="info[summary]" cols="50" rows="5">{$item_info.summary}</textarea>
<!-- editor -->
</dd>
<dt><label>Là danh mục con của</label></dt>
<dd>
<select name="info[parent_id]" id="parentId">
<option value="0">Danh mục gốc</option>
{$categoryDropBox}
</select>
</dd>
<dt><label>Ảnh icon</label></dt>
<dd>
<span id="js-category-icon">
{if="strlen($item_info.icon) > 3"}
<img src="{$item_info.icon}?{#CURRENT_TIME#}" style="max-width: 80px; max-height: 80px" />
{/if}
</span>
<input type="file" size="30" name="icon_file" />
</dd>
<dt><label>Khoảng lọc giá</label></dt>
<dd>
<input type="text" size="60" name="info[price_range]" value="{$item_info.price_range}"/> (Nhập từng giá cách nhau dấu ;) <br />
ví dụ: 300000;800000;1500000 có nghĩa là tạo ra 4 khoảng giá cho khách hàng lọc, đó là: <br />
- Dưới 300.000,<br />
- Từ 300.000 đến 800.000,<br />
- Từ 800.000 đến 1.500.000 <br />
- Trên 1.500.000
</dd>
<div id="show_static_block" >
<dt><label>Mô tả chi tiết (nếu có)</label></dt>
<dd>
<textarea name="info[description]" id="rich_text">{$item_info.description}</textarea>
</dd>
</div>
<dt><label>Redirect tới URL (khi truy cập danh mục sẽ chuyển sang link này)</label></dt>
<dd><input type="text" size="60" name="info[redirect_url]" value="{$item_info.redirect_url}"></dd>
<dt><label>Template File</label></dt>
{$display_template = isset($item_info.settings.display_template) ? $item_info.settings.display_template : ''}
<dd><input type="text" size="40" name="info[settings][display_template]" value="{$display_template}"> (v.d. landing_page/special_deal_11_2023 - cấu trúc file trong <a href="/admin/?opt=template" target="_blank">template</a>)</dd>
<dt><label>Số sản phẩm hiển thị</label></dt>
{$number_display = isset($item_info.settings.number_display) ? $item_info.settings.number_display : 0}
<dd><input type="text" size="10" name="info[settings][number_display]" value="{$number_display}"> (để = 0 nếu mặc định theo hệ thống cài đặt chung)</dd>
<dt><label>Thứ tự xuất hiện</label></dt>
<dd><input type="text" size="10" name="info[ordering]" id="ordering" value="{$item_info.ordering}"> (cao xếp trước)</dd>
<dt><label>Dùng cho SEO</label></dt>
<dd>
<table id="tb_padding">
<tr>
<td>Url canonical</td>
<td><input type="text" size="40" name="info[url_canonical]" value="{$item_info.url_canonical}" />
<span class="note"> * để trống sẽ dùng link mặc định của hệ thống</span></td>
</tr>
<tr><td>Meta Title</td><td><input type="text" size="60" name="info[meta_title]" value="{$item_info.meta_title}" id="meta_title" maxlength="150" onkeyup="SuggestSEO.show_about(this.id)" /> <span id="note_meta_title"></span> <span class="note"> </span></td></tr>
<tr><td>Meta Keywords</td><td><input type="text" size="60" name="info[meta_keyword]" value="{$item_info.meta_keyword}" id="meta_keyword" onkeyup="SuggestSEO.show_about(this.id)" /> <span id="note_meta_keyword"></span></td></tr>
<tr>
<td>Meta Description</td><td>
<textarea cols="60" rows="6" name="info[meta_description]" onkeyup="SuggestSEO.show_about(this.id)" id="meta_description" >{$item_info.meta_description}</textarea>
<br />
<span id="note_meta_description"></span> (<strong>Khuyến nghị: 160 ký tự</strong>)
<span class="note"> * nếu để trống sẽ dùng tóm tắt danh mục</span>
</td></tr>
</table>
</dd>
<dt><label>Hiển thị</label></dt>
<dd>
{$set_display = 1}
{if="$item_info.id > 0"}
{$set_display = $item_info.status}
{/if}
<label><input type="radio" name="info[status]" value="1" {if="$set_display == 1"}checked{/if} > Cho hiển thị</label>
<label><input type="radio" name="info[status]" value="0" {if="$set_display == 0"}checked{/if} > Ẩn hiển thị</label>
</dd>
</dl>
</div><!-- .group-fields -->
<div class="group-actions">
<input type="hidden" name="send" value="yes" />
<input class="btn" id="submit-collection-btn" name="commit" type="submit" value="Cập nhật" /> hoặc <a href="/admin/product/category">Hủy bỏ</a>
</div><!-- .group-actions -->
<div class="text-sm breadcrumbs ml-[10px]">
<ul>
<li><a href="/admin/product">Danh sách sản phẩm</a></li>
<li class="text-[#0041E8]">Form thêm/sửa sản phẩm</li>
</ul>
</div>
</form>
<div class="w-[1140px] my-0 mx-auto">
<div class="bg-white p-[10px] rounded-[10px] shadow-[0_1px_1px_0px_#0000001A] mb-[10px]">
<div class="flex items-center justify-between">
<h1 class="text-[20px] font-[700]">Cập nhật danh mục</h1>
<a href="/admin/product/category-form"
class="flex items-center border-[1px] border-[#ECECEC] rounded-[4px] p-[5px_10px_5px_10px]">
<span
class="w-[14px] h-[14px] border-[1px] rounded-[50%] border-[#6B7280] text-center leading-[12px] mr-[5px] text-[#6B7280]">+</span>
<span class="text-[#6B7280]">Thêm danh mục mới</span>
</a>
</div>
</div>
{% if page.update_status == 'success' %}
<p class="update-success">Cập nhật thành công</p>
{% endif %}
<div class="flex">
<div class="left w-[270px] mr-[10px]">
<div class="list-tab">
<a href="javascript:void(0)"
class="item block w-[100%] h-[36px] text-white bg-[#0041E8] rounded-[10px] text-[13px] leading-[35px] px-[10px]">Nội
dung</a>
</div>
</div>
<div class="right w-[860px]">
<form method="post" enctype="multipart/form-data">
<input type=hidden name='info[id]' value='{{page.item_info.id}}' />
<div
class="bg-white p-[10px] rounded-[10px_10px_0_0] shadow-[0_-1px_1px_0px_#0000001A] border-b-[6px] border-[#FAFAFB]">
<b class="text-[20px] mb-[10px]">Thông tin cơ bản</b>
<div class="form-control mb-[10px]">
<label class="font-[600] mb-[5px] text-[14px]">Tên danh mục</label>
<input type="text" size="60" name="info[title]" id="title" value="{{page.item_info.title}}"
placeholder="Tên danh mục"
class="w-[100%] border-[1px] border-[#D8D8D8] py-[6px] px-[10px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)]">
</div>
<div class="form-control mn-[10px]">
<label class="font-[600] mb-[5px] text-[14px]">Từ khóa (tag,nếu có - nhập mỗi cụm từ 1
dòng)</label>
<textarea type="text" size="60" name="info[tags]" id="tags" value="{{page.item_info.tags}}"
placeholder="tag"
class="w-[100%] border-[1px] border-[#D8D8D8] py-[6px] px-[10px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)] h-[120px]"></textarea>
</div>
</div>
<div class="bg-white p-[10px]">
<div class="flex items-center justify-between">
<div>
<b>Mô tả (nếu có)</b>
</div>
<div class="flex items-center">
<a href="" class="p-[7px] rounded-[4px] border-[1px] border-[#0041E8] mr-[10px]">
<i class="fa-solid fa-arrow-up-from-bracket text-[#0041E8]"></i>
<span class="pl-[3px] text-[#0041E8] font-[500]">Upload ảnh</span>
</a>
<a href="" class="p-[7px] rounded-[4px] border-[1px] border-[#0041E8] mr-[10px]">
<i class="fa-regular fa-folder text-[#0041E8]"></i>
<span class="pl-[3px] text-[#0041E8] font-[500]">Quản lý</span>
</a>
<a href="" class="p-[7px] rounded-[4px] border-[1px] border-[#0041E8]">
<i class="fa-regular fa-file-image text-[#0041E8]"></i>
<span class="pl-[3px] text-[#0041E8] font-[500]">Chọn ảnh trong kho ảnh</span>
</a>
</div>
</div>
<p class="text-[#6B7280]">Chưa có thư viện ảnh cho phần miêu tả</p>
<div class="py-[10px]">
<textarea id="product-desc"> </textarea>
</div>
<div class="flex justify-between mt-[20px]">
<div>
<b class="font-[20px]">Nhập nội dung cố định (HTML)</b>
</div>
<div class="flex items-center">
<a href="" class="p-[7px] rounded-[4px] border-[1px] border-[#0041E8] mr-[10px]">
<i class="fa-solid fa-arrow-up-from-bracket text-[#0041E8]"></i>
<span class="pl-[3px] text-[#0041E8] font-[500]">Upload ảnh</span>
</a>
<a href="" class="p-[7px] rounded-[4px] border-[1px] border-[#0041E8] mr-[10px]">
<i class="fa-regular fa-folder text-[#0041E8]"></i>
<span class="pl-[3px] text-[#0041E8] font-[500]">Quản lý</span>
</a>
<a href="" class="p-[7px] rounded-[4px] border-[1px] border-[#0041E8]">
<i class="fa-regular fa-file-image text-[#0041E8]"></i>
<span class="pl-[3px] text-[#0041E8] font-[500]">Chọn ảnh trong kho ảnh</span>
</a>
</div>
</div>
<p class="text-[#6B7280]">Chưa có thư viện ảnh cho phần miêu tả</p>
<div class="py-[10px]">
<textarea id="product-static"> </textarea>
</div>
<div class="flex items-center">
<b class="w-[85px] mr-[10px]">Ảnh icon</b>
<div class="input-file">
<input type="file" size="30" name="catThumnail" id="file_input" multiple
placeholder="No file selected">
<div class="title">
<div class="btn-input-file">
<i class="fa-solid fa-file-arrow-up"></i> Upload file
</div>
<span style="color:gray;font-style: italic;">No file chosen</span>
</div>
</div>
</div>
<div class="flex items-center mt-[15px] pb-[15px]">
<b class="w-[85px] mr-[10px]">Ảnh đại diện</b>
<div class="input-file">
<input type="file" size="30" name="category_image" id="file_input" multiple
placeholder="No file selected">
<div class="title">
<div class="btn-input-file">
<i class="fa-solid fa-file-arrow-up"></i> Upload file
</div>
<span style="color:gray;font-style: italic;">No file chosen</span>
</div>
</div>
</div>
</div>
<div class="bg-white p-[10px] border-t-[6px] border-[#FAFAFB]">
<b class="block text-[20px] mb-[15px]">Thông tin danh mục</b>
<div class="form-control mb-[10px]">
<label class="flex items-center mb-[5px] text-[14px]">
<b>Khoảng lọc giá</b>
<span class="ml-[10px] italic text-[#6B7280]">Nhập từng giá các nhau dấu;</span>
</label>
<input type="text" size="60" name="priceRange" id="priceRange"
value="{{page.item_info.priceRange}}"
class="w-[100%] border-[1px] border-[#D8D8D8] py-[6px] px-[10px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)]">
<div class="note py-[10px] italic text-[#6B7280]">
<p>ví dụ: 300000;800000;1500000 có nghĩa là tạo ra 4 khoảng giá cho khách hàng lọc Sản
phẩm, đó là:</p>
<p>- Dưới 300000,</p>
<p>- Từ 300000 đến 800000,</p>
<p>- Từ 800000 đến 1500000</p>
<p>- Trên 1500000</p>
</div>
</div>
<div class="flex items-center">
<div class="form-control mb-[10px] mr-[10px] w-[100%]">
<label class="flex items-center mb-[5px] text-[14px]">
<b>Là danh mục con của</b>
</label>
<select name="parentId" id="parentId"
class="w-[100%] border-[1px] border-[#D8D8D8] py-[6px] px-[10px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)]">
<option value="">Danh mục gốc</option>
{{page.categoryDropBox}}
</select>
</div>
<div class="form-control mb-[10px] ml-[10px] w-[100%]">
<label class="flex items-center mb-[5px] text-[14px]">
<b>Loại nội dung hiển thị</b>
</label>
<select name="display_option" id="display_option"
class="w-[100%] border-[1px] border-[#D8D8D8] py-[6px] px-[10px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)]">
<option value="child_product" selected="selected">Hiển thị sản phẩm + Danh mục con
</option>
<option value="category_as_product">Hiển thị như sản phẩm tổng hợp</option>
</select>
</div>
</div>
<div class="flex items-center">
<div class="form-control w-[100%] mr-[10px]">
<label class="flex items-center mb-[5px] text-[14px]">
<b>Thứ tự xuất hiện</b>
<span class="ml-[10px] italic text-[#6B7280]">(cao xếp trước)</span>
</label>
<input type="text" size="60" name="ordering" id="ordering"
value="{{page.item_info.ordering}}"
class="w-[100%] border-[1px] border-[#D8D8D8] py-[6px] px-[10px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)]">
</div>
<div class="form-control w-[100%] ml-[10px]">
<label class="flex items-center mb-[5px] text-[14px]">
<b>Template File</b>
</label>
<input type="text" size="60" name="template" id="template"
value="{{page.item_info.template}}"
class="w-[100%] border-[1px] border-[#D8D8D8] py-[6px] px-[10px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)]">
</div>
</div>
<div class="form-control w-[100%] my-[10px]">
<label class="flex items-center mb-[5px] text-[14px]">
<b>Số Sản phẩm hiển thị</b>
<span class="ml-[10px] italic text-[#6B7280]">(để = 0 nếu mặc định theo hệ thống cài đặt
chung)
</span>
</label>
<input type="text" size="60" name="number_display" id="number_display" value="0"
class="w-[100%] border-[1px] border-[#D8D8D8] py-[6px] px-[10px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)]">
</div>
<div class="form-control w-[100%] mb-[10px]">
<label class="flex items-center mb-[5px] text-[14px]">
<b>Redirect tới URL (khi truy cập danh mục sẽ chuyển sang link này)</b>
</label>
<input type="text" size="60" name="redirect_url" id="redirect_url" value="0"
class="w-[100%] border-[1px] border-[#D8D8D8] py-[6px] px-[10px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)]">
</div>
</div>
<div class="bg-white p-[10px] border-t-[6px] border-[#FAFAFB]">
<b class="block text-[20px] mb-[15px]">Dùng cho SEO</b>
<div class="form-control w-[100%] mb-[10px]">
<label class="flex items-center mb-[5px] text-[14px]">
<b>Url canonical</b>
</label>
<input type="text" size="60" name="redirect_url" id="redirect_url" value="0"
class="w-[100%] border-[1px] border-[#D8D8D8] py-[6px] px-[10px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)]">
</div>
<div class="form-control w-[100%] mb-[10px]">
<label class="flex items-center mb-[5px] text-[14px]">
<b>Link truy cập tại website</b>
</label>
<input type="text" size="60" name="redirect_url" id="redirect_url" value="0"
class="w-[100%] border-[1px] border-[#D8D8D8] py-[6px] px-[10px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)]">
</div>
<div class="form-control w-[100%] mb-[10px]">
<label class="flex items-center mb-[5px] text-[14px]">
<b>Tên Index</b>
</label>
<input type="text" size="60" name="redirect_url" id="redirect_url" value="0"
class="w-[100%] border-[1px] border-[#D8D8D8] py-[6px] px-[10px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)]">
</div>
<div class="form-control w-[100%] mb-[10px]">
<label class="flex items-center mb-[5px] text-[14px]">
<b>Meta Title</b>
<span class="ml-[10px] italic text-[#6B7280] text-[13px]">51 ký tự , 10 từ</span>
</label>
<input type="text" size="60" name="redirect_url" id="redirect_url" value="0"
class="w-[100%] border-[1px] border-[#D8D8D8] py-[6px] px-[10px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)]">
</div>
<div class="form-control w-[100%] mb-[10px]">
<label class="flex items-center mb-[5px] text-[14px]">
<b>Meta Keywords</b>
<span class="ml-[10px] italic text-[#6B7280] text-[13px]">76 ký tự , 14 từ</span>
</label>
<input type="text" size="60" name="redirect_url" id="redirect_url" value="0"
class="w-[100%] border-[1px] border-[#D8D8D8] py-[6px] px-[10px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)]">
</div>
<div class="form-control w-[100%] mb-[10px]">
<label class="flex items-center mb-[5px] text-[14px]">
<b>Meta Description</b>
<span class="ml-[10px] italic text-[#6B7280] text-[13px]">142 ký tự , 28 từ (Khuyến
nghị: 160 ký tự) * nếu để trống sẽ dùng tóm tắt danh mục</span>
</label>
<textarea name="" id="" cols="30" rows="10"
class="w-[100%] h-[120px] border-[1px] border-[#D8D8D8] py-[6px] px-[10px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)]"
placeholder=""></textarea>
</div>
<div class="mb-[10px] flex items-center">
<b class="mr-[20px]">Thay đổi Link truy cập khi thay đổi Tên index?</b>
<input type="checkbox" name="change_url_on_update" value="1"
class="checkbox checked:bg-[#0041E8] w-[20px] h-[20px] [--chkbg:theme(#0041E8)] [--chkfg:white] rounded-[4px]">
<span class="ml-[10px] text-[#6B7280]">Tích chọn để hiển thị hoặc dừng hiển thị</span>
</div>
</div>
<div
class="bg-white p-[10px] border-t-[6px] border-[#FAFAFB] rounded-[0_0_10px_10px] shadow-[0_1px_1px_0px_#0000001A]">
<input class="w-[82px] h-[32px] bg-[#0041E8] rounded-[4px] text-white cursor-pointer"
id="submit-collection-btn" name="commit" type="submit" value="Cập nhật" />
</div>
</form>
</div>
</div>
</div>
</div>

View File

@@ -62,11 +62,11 @@
<td>
<img class="block mx-auto my-0 w-[70px] h-[50px]" src="{{item.image.thumb}}" alt="">
<span class="text-center block">{{item.image_count}} ảnh</span>
<i class="icons icon-edit"></i>
<i class="icons icon-edit text-center m-auto"></i>
</td>
<td>
<a href="/admin/product/form?id={{item.id}}"
class="text-[#0041E8] inline-block w-[140px]">{{item.title}}</a>
class="text-[#0041E8] inline-block">{{item.title}}</a>
{% if item.config_count > 0 %}<p class="text-[#FFC700]">[Có cấu hình]</p>{% endif %}
<div class="flex items-center">
<span>Danh mục:</span>
@@ -96,7 +96,7 @@
<p>- Mua : {{item.buy_count}}</p>
</td>
<td>
<div class="flex items-center mb-[1px]">
<div class="flex flex-wrap items-center mb-[1px]">
<span class="">- Giá bán:</span>
<b class="text-[#E00000] ml-[3px] whitespace-nowrap">
{% if item.price > 0 %}

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="vi">
<html lang="en">
<head>
<meta charset="utf-8" />
@@ -15,7 +15,7 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" />
<link rel="stylesheet" media="screen" href="{{ 'fancybox.css' | asset_url }}" />
<link rel="stylesheet" media="screen" href="{{ 'pc_style.css' | asset_url }}?v12" />
<link rel="stylesheet" media="screen" href="{{ 'pc_style.css' | asset_url }}?v12.1" />
<script src="{{ 'tailwindcss.js' | asset_url }}"></script>
<script src="{{ 'fancybox.js' | asset_url }}"></script>