This commit is contained in:
2024-01-30 08:45:44 +07:00
16 changed files with 199 additions and 69 deletions

View File

@@ -2,17 +2,22 @@
<p>Link thiết kế: <a href="https://www.figma.com/file/5Km584w3tlnwxOltV5KAjh/281123_HURA8?node-id=328%3A1204&mode=dev" target="_blank"> <strong>Giao diện Admin</strong> </a></p>
<p>Repo: <a href="https://repo.hurasoft.com/tieptk/admin_hura_8" target="_blank">https://repo.hurasoft.com/tieptk/admin_hura_8</a></p>
<h2>Cài đặt hệ thống</h2>
<p>Test và làm việc chính tại web: <a href="http://local.hura8_admin/"> http://local.hura8_admin/</a> </p>
<ul>
<li>Tải phần mềm XAMPP tại https://www.apachefriends.org/download.html để chạy PHP</li>
<li>Chỉnh file hosts trong máy tính: 127.0.0.1 local.hura8_admin</li>
<li>Cài đặt httpd-vhosts.conf của XAMPP</li>
</ul>
<li>Tải phần mềm XAMPP tại <a href="https://www.apachefriends.org/download.html" target="_blank">https://www.apachefriends.org/download.html</a> để chạy PHP</li>
<li>Chỉnh file hosts trong máy tính C:\Windows\System32\drivers\etc\hosts:
<pre><code>
127.0.0.1 local.hura8_admin
</code></pre>
</li>
<li>
Cài đặt ../xampp/apache/conf/extra/httpd-vhosts.conf của apache trong XAMPP
<pre><code>
&lt;VirtualHost *:80&gt;
DocumentRoot "/thuc-muc-check-out/admin_hura_8"
ServerName local.hura8_admin
@@ -20,7 +25,20 @@
Require all granted
&lt;/Directory&gt;
&lt;/VirtualHost&gt;
</code></pre>
</code></pre>
</li>
<li>
Cài đặt ../xampp/apache/conf/httpd.conf của apache trong XAMPP
<pre><code>
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
AllowOverride All
</code></pre>
</li>
</ul>
<h2>Cấu trúc thư mục</h2>

View File

@@ -57,6 +57,10 @@ img {
height: auto;
}
table {
width: 100%;
}
a {
text-decoration: none;
}
@@ -728,22 +732,6 @@ input[type=radio]:focus:before {
.order-page .order-page-table td:nth-child(4), .order-page .order-page-table td:nth-child(10) {
text-align: left;
}
.order-page .order-page-table .icons {
width: 30px;
height: 30px;
border: 1px solid #ECECEC;
background-color: #F9F9F9;
border-radius: 5px;
}
.order-page .order-page-table .icon-edit {
border: 1px solid #0041E8;
background-color: #F5F7FF;
background-position: -108px -82px;
margin-right: 6px;
}
.order-page .order-page-table .icon-delete {
background-position: -145px -82px;
}
.order-page-table {
line-height: 20px;
@@ -782,6 +770,22 @@ input[type=radio]:focus:before {
width: 100%;
padding: 0 0 0 5px;
}
.order-page-table .icons {
width: 30px;
height: 30px;
border: 1px solid #ECECEC;
background-color: #F9F9F9;
border-radius: 5px;
}
.order-page-table .icon-edit {
border: 1px solid #0041E8;
background-color: #F5F7FF;
background-position: -108px -82px;
margin-right: 6px;
}
.order-page-table .icon-delete {
background-position: -145px -82px;
}
.is-close-btn {
background: #ECECEC !important;

File diff suppressed because one or more lines are too long

View File

@@ -48,6 +48,9 @@ img {
max-width: 100%;
height: auto;
}
table{
width: 100%;
}
a {
text-decoration: none;
}
@@ -744,22 +747,6 @@ input[type="radio"] {
text-align: left;
}
}
.icons {
width: 30px;
height: 30px;
border: 1px solid #ECECEC;
background-color: #F9F9F9;
border-radius: 5px;
}
.icon-edit {
border: 1px solid #0041E8;
background-color: #F5F7FF;
background-position: -108px -82px;
margin-right: 6px;
}
.icon-delete {
background-position: -145px -82px;
}
}
}
.order-page-table {
@@ -798,7 +785,22 @@ input[type="radio"] {
width: 100%;
padding: 0 0 0 5px;
}
.icons {
width: 30px;
height: 30px;
border: 1px solid #ECECEC;
background-color: #F9F9F9;
border-radius: 5px;
}
.icon-edit {
border: 1px solid #0041E8;
background-color: #F5F7FF;
background-position: -108px -82px;
margin-right: 6px;
}
.icon-delete {
background-position: -145px -82px;
}
}
.is-close-btn {
background: #ECECEC !important;

View File

@@ -73,6 +73,10 @@ class AppAdmin
protected function renderModule() {
if(!$this->current_route_info['module'] || !$this->current_route_info['view']) {
die("Module not exist");
}
$template_file_path = $this->tpl_path ."/". $this->current_route_info['module'];
$template_file_name = $this->current_route_info['view'].".html";
$template_file_full_path = $template_file_path."/".$template_file_name;

View File

@@ -29,7 +29,7 @@ class Router {
}
// check match pattern in $this->path_config
foreach ($this->path_config as $_config => $_route ) {
/*foreach ($this->path_config as $_config => $_route ) {
if(preg_match("{^".$_config."$}", $parsed['path'], $match )) {
if(isset($_route['query']) && is_array($_route['query'])) {
@@ -43,16 +43,20 @@ class Router {
'match' => $match,
], $_route);
}
}
}*/
// auto parse path base on convention: admin/module/view/view_id
$ele = explode("/", $parsed['path']);
$module = $ele[2] ?? 'home';
$view = isset($ele[3]) ? $ele[3] : getRequest('view', 'home');
$view_id = isset($ele[4]) ? $ele[4] : getRequest('id', 'view_id');
// else error
return [
'module' => $ele[2] ?? 'home',
'view' => isset($ele[3]) ? preg_replace("/[^a-z0-9_\-]/i","", $ele[3] ) : 'home',
'view_id' => isset($ele[4]) ? preg_replace("/[^a-z0-9_]/i","", $ele[4] ) : '',
'module' => preg_replace("/[^a-z0-9_\-]/i","", $module ) ,
'view' => preg_replace("/[^a-z0-9_\-]/i","", $view ) ,
'view_id' => preg_replace("/[^a-z0-9_]/i","", $view_id ),
'query' => $parsed['query'],
];
}

View File

@@ -0,0 +1 @@
template/marketing/coupon-add.html

View File

@@ -0,0 +1,92 @@
<div class="bg-white m-[16px_0_16px_16px] p-[20px_16px] rounded-[15px] shadow-[0px_1px_1px_0px_rgba(0,0,0,0.10)] leading-[20px]">
<p class="leading-[30px] mb-[13px] font-[600] text-[24px]"> Coupon khuyến mại </p>
<div class="flex justify-between items-start m-[13px_0]">
<p class="max-w-[1024px]">Danh sách phiếu giảm giá/ quà tặng dùng cho khách hàng khi đặt mua hàng từ website. Trước khi gửi đơn hàng, nếu khách hàng có mã số phiếu còn hiệu lực thì sẽ nhập vào đơn hàng để nhận được ưu đãi ghi trên phiếu</p>
<a href="/admin/marketing/coupon-add" class="flex items-center whitespace-nowrap border border-[#0041E8] rounded-[4px] bg-[#F5F7FF] text-[#0041E8] font-[500] leading-[35px] p-[0_12px]" >
<span class="border-[1px] border-[#0041E8] h-[13px] w-[13px] leading-[10px] text-center rounded-[50%] mr-1">+</span>
<span>Thêm phiếu mới</span>
</a>
</div>
<div class="order-page-table">
<table>
<thead>
<tr>
<td width="50"> STT </td>
<td> Mã số </td>
<td> Khuyến mại </td>
<td> Phân loại </td>
<td> Thời gian </td>
<td> Trạng thái </td>
<td> Thông tin khác </td>
<td> Lựa chọn </td>
</tr>
</thead>
<tbody>
<tr>
<td> 1 </td>
<td class="whitespace-nowrap"> CP231020233 </td>
<td>
<p class="font-bold"> Test phiếu giảm giá </p>
<div> Test phiếu giảm giá </div>
</td>
<td>
<p class="font-bold"> Tặng sản phẩm </p>
<p> Balo thời trang </p>
</td>
<td>
<div style="display: block;">
<p class="inline-block m-[0_6px_6px_0]"> - Bắt đầu: 23-10-2023, 12:00 am </p>
<span class="inline-block m-[0_0_6px_0] bg-[#F7F5FF] font-[500] p-[0_7px] leading-[20px] rounded-[50px] text-[12px] text-[#0041E8] shadow-[0_0_0_1px_#0041E8]">
Đã chạy
</span>
</div>
<div>
<p class="inline-block m-[0_6px_6px_0]"> - Kết thúc: 28-10-2023, 12:00 am </p>
<span class="inline-block m-[0_0_6px_0] bg-[#F9F2F2] font-[500] p-[0_7px] leading-[20px] rounded-[50px] text-[12px] text-[#E00000] shadow-[0_0_0_1px_#E00000]">
Đã dừng
</span>
</div>
<p>- Giá trị đơn hàng tối thiểu: <b class="text-[#E00000] font-bold">2.000.000 đ</b> </p>
</td>
<td>
<p> 0 đã dùng </p>
<p> Tổng số: 20 </p>
</td>
<td>
<p> - Tạo bởi: Đức (05-09-2022, 9:48 am) </p>
<p> - Cập nhật cuối: hongvt@hurasoft.com<br>(03-10-2023, 8:31 am) </p>
</td>
<td>
<div class="items-center" style="display: flex;">
<a href="/admin/marketing/detail/id=8" class="icons icon-edit" title="Sửa lại"></a>
<!-- <a href="javascript:setStatus('8','off')" title="Hạ xuống" class="far fa-eye-slash bg-[#F9F9F9] leading-[30px] rounded-[5px] text-[#9E9E9E_!important] text-center w-[30px] border border-[#ECECEC] mr-[6px]"></a> -->
<a href="javascript:setStatus('8','on')" 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-[6px]"> </a>
<a href="javascript:delete_coupon('8')" class="icons icon-delete" title="Xóa"></a>
</div>
</td>
</tr>
<tr> <td> 2 </td><td class="whitespace-nowrap"> CP231020233 </td><td> <p class="font-bold"> Test phiếu giảm giá </p><div> Test phiếu giảm giá </div></td><td> <p class="font-bold"> Tặng sản phẩm </p><p> Balo thời trang </p></td><td> <div style="display: block;"> <p class="inline-block m-[0_6px_6px_0]"> - Bắt đầu: 23-10-2023, 12:00 am </p><span class="inline-block m-[0_0_6px_0] bg-[#F7F5FF] font-[500] p-[0_7px] leading-[20px] rounded-[50px] text-[12px] text-[#0041E8] shadow-[0_0_0_1px_#0041E8]"> Đã chạy </span> </div><div> <p class="inline-block m-[0_6px_6px_0]"> - Kết thúc: 28-10-2023, 12:00 am </p><span class="inline-block m-[0_0_6px_0] bg-[#F9F2F2] font-[500] p-[0_7px] leading-[20px] rounded-[50px] text-[12px] text-[#E00000] shadow-[0_0_0_1px_#E00000]"> Đã dừng </span> </div><p>- Giá trị đơn hàng tối thiểu: <b class="text-[#E00000] font-bold">2.000.000 đ</b> </p></td><td> <p> 0 đã dùng </p><p> Tổng số: 20 </p></td><td> <p> - Tạo bởi: Đức (05-09-2022, 9:48 am) </p><p> - Cập nhật cuối: hongvt@hurasoft.com<br>(03-10-2023, 8:31 am) </p></td><td> <div class="items-center" style="display: flex;"> <a href="/admin/marketing/detail/id=8" class="icons icon-edit" title="Sửa lại"></a> <a href="javascript:setStatus('8','off')" title="Hạ xuống" class="far fa-eye-slash bg-[#F9F9F9] leading-[30px] rounded-[5px] text-[#9E9E9E_!important] text-center w-[30px] border border-[#ECECEC] mr-[6px]"></a> <a href="javascript:delete_coupon('8')" class="icons icon-delete" title="Xóa"></a> </div></td></tr>
</tbody>
</table>
</div>
</div>

View File

@@ -0,0 +1 @@
template/marketing/detail.html

View File

@@ -0,0 +1 @@
template/marketing/detail8.html

View File

@@ -0,0 +1 @@
template/marketing/home.html

View File

@@ -0,0 +1 @@
template/marketing/promotion.html

View File

@@ -1,5 +1,5 @@
<div class="global-breadcrumb-container">
<a href="?module=order&view=home">Danh sách đơn hàng</a>
<a href="/admin/order/home">Danh sách đơn hàng</a>
<a href="">Chi tiết đơn hàng</a>
</div>

View File

@@ -123,7 +123,7 @@
<tr>
<td> 1 </td>
<td>
<a href="?module=order&view=detail-new&o=369&b=1584&popup=1"> 000-369 </a>
<a href="/admin/order/detail?id=369"> 000-369 </a>
</td>
<td> 16-11-2023, 9:59 am </td>
<td>
@@ -138,7 +138,7 @@
<a href=""> Nguyen Duc Quan </a>
</td>
<td>
<a href="?module=order&view=detail-new&o=369&b=1584&popup=1" class="icons icon-edit" title="Chi tiết"></a>
<a href="/admin/order/detail?id=369" class="icons icon-edit" title="Chi tiết"></a>
<a href="" class="icons icon-delete" title="Xóa"></a>
</td>
</tr>
@@ -146,7 +146,7 @@
<tr>
<td> 2 </td>
<td>
<a href="?module=order&view=detail-new&o=369&b=1584&popup=1"> 000-369 </a>
<a href="/admin/order/detail?id=369"> 000-369 </a>
</td>
<td> 16-11-2023, 9:59 am </td>
<td>
@@ -161,7 +161,7 @@
<a href=""> test hura </a>
</td>
<td>
<a href="?module=order&view=detail-new&o=369&b=1584&popup=1" class="icons icon-edit" title="Chi tiết"></a>
<a href="/admin/order/detail?id=369" class="icons icon-edit" title="Chi tiết"></a>
<a href="" class="icons icon-delete" title="Xóa"></a>
</td>
</tr>

View File

@@ -0,0 +1 @@
template/order/wait-order.html

View File

@@ -76,7 +76,7 @@
<div class="sub-menu">
{% for _item in _menuArray %}
<a href="?module={{ _item.module }}&view={{ _item.view }}" {% if _item.view == global.view and
<a href="{{ _item.url }}" {% if _item.view == global.view and
_type == global.module %} class="current" {% endif %}> {{ _item.name }} </a>
{% endfor %}
</div>
@@ -136,16 +136,16 @@
{% if _category[1].enable == 1 %}
<div class="item {% if _type == 'system' %} border-[rgba(255,255,255,0.15)] border-b{% endif %} {% if _type == global.module %}current{% endif %}">
{% if _type == 'order' %} <a href="" class="icons icon-sell"> </a>
{% elsif _type == 'product' %} <a href="" class="icons icon-product"> </a>
{% elsif _type == 'customer' %}<a href="" class="icons icon-user"> </a>
{% elsif _type == 'marketing' %} <a href="" class="icons icon-marketing"> </a>
{% elsif _type == 'investor_relation' %} <a href="" class="icons icon-investor_relation"> </a>
{% elsif _type == 'article' %} <a href="" class="icons icon-content"> </a>
{% elsif _type == 'job' %} <a href="" class="icons icon-job"> </a>
{% elsif _type == 'pcbuilder' %} <a href="" class="icons icon-pcbuilder"> </a>
{% elsif _type == 'payinstall' %} <a href="" class="icons icon-payinstall"> </a>
{% elsif _type == 'distributor' %} <a href="" class="icons icon-distributor"> </a>
{% if _type == 'order' %} <i class="icons icon-sell"> </i>
{% elsif _type == 'product' %} <i class="icons icon-product"> </i>
{% elsif _type == 'customer' %}<i class="icons icon-user"> </i>
{% elsif _type == 'marketing' %} <i class="icons icon-marketing"> </i>
{% elsif _type == 'investor_relation' %} <i class="icons icon-investor_relation"> </i>
{% elsif _type == 'article' %} <i class="icons icon-content"> </i>
{% elsif _type == 'job' %} <i class="icons icon-job"> </i>
{% elsif _type == 'pcbuilder' %} <i class="icons icon-pcbuilder"> </i>
{% elsif _type == 'payinstall' %} <i class="icons icon-payinstall"> </i>
{% elsif _type == 'distributor' %} <i class="icons icon-distributor"> </i>
{% elsif _type == 'report' %}<i class="icons icon-stats"></i>
{% elsif _type == 'system' %}<i class="icons icon-system"></i>
{% endif %}
@@ -155,7 +155,7 @@
<div class="menu-list">
{% for _item in _menuArray %}
<a href="?module={{ _item.module }}&view={{ _item.view }}" {% if _item.view == global.view and
<a href="{{ _item.url }}" {% if _item.view == global.view and
_type == global.module %} class="current" {% endif %}> {{ _item.name }} </a>
{% endfor %}
</div>