Skip to content

Commit

Permalink
Merge pull request #25 from tanhongit/upgrade
Browse files Browse the repository at this point in the history
Upgrade
  • Loading branch information
tanhongit authored Jan 2, 2024
2 parents fd49816 + 17a2db1 commit d3bc19f
Show file tree
Hide file tree
Showing 171 changed files with 1,072 additions and 10,974 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
.idea
.composer.lock
composer.lock
.vscode
vendor
.gitignore
.DS_Store
*.log
docker/certs
docker/logs
8 changes: 4 additions & 4 deletions 404.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="row">
<div class="col-md-12">
<ul class="breadcrumb">
<li><a href="<?php echo PATH_URL; ?>home">Home</a></li>
<li><a href="<?= PATH_URL; ?>home">Home</a></li>
<li class="active">404</li>
</ul>
</div>
Expand All @@ -32,14 +32,14 @@
<div class="col-md-4">
<h4>Dưới đây là một số liên kết hữu ích</h4>
<ul class="nav nav-list primary">
<li><a href="<?php echo PATH_URL; ?>home">Trang chủ</a></li>
<li><a href="<?= PATH_URL; ?>home">Trang chủ</a></li>
<li><a href="<?= $link_about ?>">Về chúng tôi</a></li>
<li><a href="<?= $link_contact ?>">Liên hệ</a></li>
</ul>
</div>
</div>
</section>
<form action="<?php echo PATH_URL; ?>search/" method="get">
<form action="<?= PATH_URL; ?>search/" method="get">
<div class="input-group input-group-lg">
<input class="form-control" placeholder="Search..." name="keyword" id="s" type="text">
<span class="input-group-btn">
Expand All @@ -49,4 +49,4 @@
</form>
</div>
</div>
<?php require('content/views/shared/footer.php'); ?>
<?php require('content/views/shared/footer.php'); ?>
4 changes: 2 additions & 2 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
require_once('lib/model.php');
require_once('lib/functions.php');

if (isset($_GET['controller'])) {
if (isset($_GET['controller']) && '' != $_GET['controller']) {
$controller = $_GET['controller'];
} else {
$controller = 'home';
}

if (isset($_GET['action'])) {
if (isset($_GET['action']) && '' != $_GET['action']) {
$action = $_GET['action'];
} else {
$action = 'index';
Expand Down
4 changes: 2 additions & 2 deletions admin/controllers/shared/statistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
$options_comments = array(
'order_by' => 'id DESC'
);
$total_rows_comment = get_total('comments', $options_comments);
$totalRows_comment = get_total('comments', $options_comments);

$options_comments_mine = array(
'order_by' => 'id DESC',
Expand Down Expand Up @@ -205,7 +205,7 @@
'where' => 'status=1'
);
$total_comment_accept = get_total('comments', $options_comment_accept);
if ($total_comment_accept != 0) $comment_ratio = $total_comment_accept / $total_rows_comment * 100;
if ($total_comment_accept != 0) $comment_ratio = $total_comment_accept / $totalRows_comment * 100;
else $comment_ratio = 0;

//posts
Expand Down
497 changes: 0 additions & 497 deletions admin/database/db-backup-tanhongit-2020-04-19-13-37-26.sql

This file was deleted.

4 changes: 2 additions & 2 deletions admin/views/backupdb/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
$link_connect_file = 'admin/database/' . $filename;
$stt++; ?>
<tr>
<td><?php echo $stt ?></td>
<td><?= $stt ?></td>
<td><?= $filename ?></td>
<td>
<form action="admin.php?controller=backupdb&action=delete" method="post">
Expand All @@ -85,4 +85,4 @@
</div>
</div>
</section>
<?php require('admin/views/shared/footer.php'); ?>
<?php require('admin/views/shared/footer.php'); ?>
14 changes: 7 additions & 7 deletions admin/views/category/formEdit.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ul class="breadcrumb">
<li class="breadcrumb-item"><a href="<?= PATH_URL . 'home' ?>"><i class="zmdi zmdi-home"></i> ChiKoi</a></li>
<li class="breadcrumb-item"><a href="admin.php?controller=category">Danh mục con</a></li>
<li class="breadcrumb-item active"><?php echo $subcategory ? 'Cập nhật danh mục con : ' . $subcategory['subcategory_name'] : 'Thêm danh mục con mới'; ?></li>
<li class="breadcrumb-item active"><?= $subcategory ? 'Cập nhật danh mục con : ' . $subcategory['subcategory_name'] : 'Thêm danh mục con mới'; ?></li>
</ul>
</div>
<div class="col-lg-5 col-md-6 col-sm-12">
Expand All @@ -21,20 +21,20 @@
<div class="row clearfix">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="alert alert-warning" role="alert">
<strong><?php echo $subcategory ? 'Cảnh Báo: </strong> Bạn đang trong trang chỉnh sửa của nhóm danh mục "' . $subcategory['subcategory_name'] . '", Hãy cẩn trọng!!! <a target="_blank" href="#"> Xem tài liệu hướng dẫn</a>' : 'Cảnh Báo: </strong> Bạn đang trong trang tạo một nhóm danh mục mới, Hãy cẩn trọng!!! <a target="_blank" href="#"> Xem tài liệu hướng dẫn</a>'; ?>
<strong><?= $subcategory ? 'Cảnh Báo: </strong> Bạn đang trong trang chỉnh sửa của nhóm danh mục "' . $subcategory['subcategory_name'] . '", Hãy cẩn trọng!!! <a target="_blank" href="#"> Xem tài liệu hướng dẫn</a>' : 'Cảnh Báo: </strong> Bạn đang trong trang tạo một nhóm danh mục mới, Hãy cẩn trọng!!! <a target="_blank" href="#"> Xem tài liệu hướng dẫn</a>'; ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true"><i class="zmdi zmdi-close"></i></span>
</button>
</div>
<div class="card">
<div class="body">
<form id="product-form" class="form-horizontal" method="post" enctype="multipart/form-data" role="form">
<input name="sub_cate_id" type="hidden" value="<?php echo $subcategory ? $subcategory['id'] : '0'; ?>" />
<input name="sub_cate_id" type="hidden" value="<?= $subcategory ? $subcategory['id'] : '0'; ?>" />
<h2 class="card-inside-title" style="font-weight:bold;">Tên danh mục con:</h2>
<div class="row clearfix">
<div class="col-sm-12">
<div class="form-group">
<input name="name" type="text" value="<?php echo $subcategory ? $subcategory['subcategory_name'] : ''; ?>" class="form-control" id="name" placeholder="Nhập tên sản nhóm danh mục..." required="" />
<input name="name" type="text" value="<?= $subcategory ? $subcategory['subcategory_name'] : ''; ?>" class="form-control" id="name" placeholder="Nhập tên sản nhóm danh mục..." required="" />
</div>
</div>
</div>
Expand All @@ -43,7 +43,7 @@
<div class="row clearfix">
<div class="col-sm-12">
<div class="form-group">
<input name="slug" type="text" value="<?php echo $subcategory ? $subcategory['slug'] : ''; ?>" class="form-control" id="slug" placeholder="Đường dẫn link sẽ tự động được tạo giống với tên danh mục..." required="" disabled />
<input name="slug" type="text" value="<?= $subcategory ? $subcategory['slug'] : ''; ?>" class="form-control" id="slug" placeholder="Đường dẫn link sẽ tự động được tạo giống với tên danh mục..." required="" disabled />
</div>
</div>
</div>
Expand All @@ -61,7 +61,7 @@
</div>
<br><br>
<div class="form-group" style="text-align: center;">
<button class="btn btn-primary waves-effect" type="submit"><?php echo $subcategory ? 'Cập nhật danh mục con trên' : 'Thêm danh mục con mới'; ?></button>
<button class="btn btn-primary waves-effect" type="submit"><?= $subcategory ? 'Cập nhật danh mục con trên' : 'Thêm danh mục con mới'; ?></button>
<a class="btn btn-warning waves-effect" href="admin.php?controller=category">Trở về</a>
</div>
</form>
Expand All @@ -71,4 +71,4 @@
</div>
</div>
</div>
</section>
</section>
12 changes: 6 additions & 6 deletions admin/views/category/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,16 @@
<tbody>
<?php foreach ($subcategories as $subcategory) : ?>
<tr>
<td><?php echo $subcategory['id'] ?></td>
<td><a href="admin.php?controller=category&amp;action=edit&amp;sub_cate_id=<?php echo $subcategory['id']; ?>"><?php echo $subcategory['subcategory_name']; ?></a></td>
<td><?php echo $subcategory['slug'] ?></td>
<td><?= $subcategory['id'] ?></td>
<td><a href="admin.php?controller=category&amp;action=edit&amp;sub_cate_id=<?= $subcategory['id']; ?>"><?= $subcategory['subcategory_name']; ?></a></td>
<td><?= $subcategory['slug'] ?></td>
<td><?php $category = get_a_record('categories', $subcategory['category_id']);
if ($category['id'] != 0) {
echo $category['category_name'];
}
?></td>
<td><a href="category/<?php echo $category['id']; ?>-<?php echo $category['slug'] ?>" target="_blank" class="btn btn-success waves-effect waves-float btn-sm waves-green"><i class="zmdi zmdi-eye"></i></a>
<a href="admin.php?controller=category&amp;action=edit&amp;sub_cate_id=<?php echo $subcategory['id']; ?>" class="btn btn-warning waves-effect waves-float btn-sm waves-green"><i class="zmdi zmdi-edit"></i></a>
<td><a href="category/<?= $category['id']; ?>-<?= $category['slug'] ?>" target="_blank" class="btn btn-success waves-effect waves-float btn-sm waves-green"><i class="zmdi zmdi-eye"></i></a>
<a href="admin.php?controller=category&amp;action=edit&amp;sub_cate_id=<?= $subcategory['id']; ?>" class="btn btn-warning waves-effect waves-float btn-sm waves-green"><i class="zmdi zmdi-edit"></i></a>
<a onclick="return confirm('Are you sure to delete?')" href="admin.php?controller=category&amp;action=delete&amp;sub_cate_id=<?= $subcategory['id'] ?>" class="btn btn-danger waves-effect waves-float btn-sm waves-red"><i class="zmdi zmdi-delete"></i></a></td>
</tr>
<?php endforeach; ?>
Expand All @@ -88,4 +88,4 @@
</div>
</div>
</section>
<?php require('admin/views/shared/footer.php'); ?>
<?php require('admin/views/shared/footer.php'); ?>
10 changes: 5 additions & 5 deletions admin/views/comment/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,28 @@
<a target="_blank" href="<?= PATH_URL . 'page/' . $page['id'] . '-' . $page['post_slug'] ?>"><?= PATH_URL . 'page/' . $page['id'] . '-' . $page['post_slug'] ?></a>
<?php } ?>
<form id="product-form" class="form-horizontal" method="post" action="admin.php?controller=comment&action=edit" enctype="multipart/form-data" role="form">
<input name="comment_id" type="hidden" value="<?php echo $comment ? $comment['id'] : '0'; ?>" />
<input name="comment_id" type="hidden" value="<?= $comment ? $comment['id'] : '0'; ?>" />
<h4 class="card-inside-title" style="font-weight:bold;">Họ và tên:</h4>
<div class="row clearfix">
<div class="col-sm-12">
<div class="form-group">
<input name="name" type="text" value="<?php echo $comment ? $comment['author'] : ''; ?>" class="form-control" id="name" placeholder="họ và tên thật..." required="" />
<input name="name" type="text" value="<?= $comment ? $comment['author'] : ''; ?>" class="form-control" id="name" placeholder="họ và tên thật..." required="" />
</div>
</div>
</div>
<h4 class="card-inside-title" style="font-weight:bold;">Email:</h4>
<div class="row clearfix">
<div class="col-sm-12">
<div class="form-group">
<input name="email" type="email" maxlength="100" value="<?php echo $comment ? $comment['email'] : ''; ?>" class="form-control" id="color" placeholder="Nhập email của bạn..." required="" />
<input name="email" type="email" maxlength="100" value="<?= $comment ? $comment['email'] : ''; ?>" class="form-control" id="color" placeholder="Nhập email của bạn..." required="" />
</div>
</div>
</div>
<h4 class="card-inside-title" style="font-weight:bold;">Nội dung:</h4>
<div class="row clearfix">
<div class="col-sm-12">
<div class="form-group">
<textarea name="subject" type="text" class="form-control" id="ckeditor" required placeholder="Nội dung phản hồi..."><?php echo $comment ? $comment['content'] : ''; ?></textarea>
<textarea name="subject" type="text" class="form-control" id="ckeditor" required placeholder="Nội dung phản hồi..."><?= $comment ? $comment['content'] : ''; ?></textarea>
</div>
</div>
</div>
Expand Down Expand Up @@ -99,4 +99,4 @@
height: '200px'
});
</script>
<?php require('admin/views/shared/footer.php'); ?>
<?php require('admin/views/shared/footer.php'); ?>
10 changes: 5 additions & 5 deletions admin/views/comment/tableIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
if ($comment['status'] == 1) : ?>
<tr>
<td>
<?php echo '<image src="public/upload/images/' . $comment['link_image'] . '?time=' . time() . '" style="max-width:20px;" />'; ?>
<strong><?php echo $comment['author'] ?></strong> | <strong><?= get_time($comment['createDate'], gmdate('Y:m:d H:i:s', time() + 7 * 3600)) ?></strong>
<?= '<image src="public/upload/images/' . $comment['link_image'] . '?time=' . time() . '" style="max-width:20px;" />'; ?>
<strong><?= $comment['author'] ?></strong> | <strong><?= get_time($comment['createDate'], gmdate('Y:m:d H:i:s', time() + 7 * 3600)) ?></strong>
<br><?php if ($comment['product_id'] <> 0) { ?>
<a target="_blank" href="<?= PATH_URL . 'product/' . $product['id'] . '-' . $product['slug'] ?>"><?= PATH_URL . 'product/' . $product['id'] . '-' . $product['slug'] ?></a>
<?php } elseif ($comment['post_id'] <> 0) { ?>
Expand All @@ -62,8 +62,8 @@
<?php else : ?>
<tr style="background-color: #FFD18E;">
<td>
<?php echo '<image src="public/upload/images/' . $comment['link_image'] . '?time=' . time() . '" style="max-width:20px;" />'; ?>
<strong><?php echo $comment['author'] ?></strong> | <strong><?= get_time($comment['createDate'], gmdate('Y:m:d H:i:s', time() + 7 * 3600)) ?></strong>
<?= '<image src="public/upload/images/' . $comment['link_image'] . '?time=' . time() . '" style="max-width:20px;" />'; ?>
<strong><?= $comment['author'] ?></strong> | <strong><?= get_time($comment['createDate'], gmdate('Y:m:d H:i:s', time() + 7 * 3600)) ?></strong>
<br><?php if ($comment['product_id'] <> 0) { ?>
<a target="_blank" href="<?= PATH_URL . 'product/' . $product['id'] . '-' . $product['slug'] ?>"><?= PATH_URL . 'product/' . $product['id'] . '-' . $product['slug'] ?></a>
<?php } elseif ($comment['post_id'] <> 0) { ?>
Expand All @@ -89,4 +89,4 @@
</div>
</div>
</div>
</div>
</div>
6 changes: 3 additions & 3 deletions admin/views/comment/tablePending.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
elseif ($comment['page_id'] <> 0) $page = get_a_record('posts', $comment['page_id']); ?>
<tr style="background-color: #FFD18E;">
<td>
<?php echo '<image src="public/upload/images/' . $comment['link_image'] . '?time=' . time() . '" style="max-width:20px;" />'; ?>
<strong><?php echo $comment['author'] ?></strong> | <strong><?= get_time($comment['createDate'], gmdate('Y:m:d H:i:s', time() + 7 * 3600)) ?></strong>
<?= '<image src="public/upload/images/' . $comment['link_image'] . '?time=' . time() . '" style="max-width:20px;" />'; ?>
<strong><?= $comment['author'] ?></strong> | <strong><?= get_time($comment['createDate'], gmdate('Y:m:d H:i:s', time() + 7 * 3600)) ?></strong>
<br><?php if ($comment['product_id'] <> 0) { ?>
<a target="_blank" href="<?= PATH_URL . 'product/' . $product['id'] . '-' . $product['slug'] ?>"><?= PATH_URL . 'product/' . $product['id'] . '-' . $product['slug'] ?></a>
<?php } elseif ($comment['post_id'] <> 0) { ?>
Expand All @@ -72,4 +72,4 @@
</div>
</div>
</div>
</div>
</div>
Loading

0 comments on commit d3bc19f

Please sign in to comment.