Skip to content

Commit

Permalink
fix: update database
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhongit committed Jan 8, 2024
1 parent be1559b commit 2f5cc18
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion admin/controllers/shared/statistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@

$options_posts_status = [
'order_by' => 'id DESC',
'where' => 'post_status="Publiced"',
'where' => 'post_status="Published"',
];
$total_posts_status = getTotal('posts', $options_posts_status);

Expand Down
1 change: 0 additions & 1 deletion admin/controllers/slide/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
require_once('admin/models/slides.php');
if (!empty($_POST)) {
slide_update();
} else {
}
if (isset($_GET['slide_id'])) {
$slideId = intval($_GET['slide_id']);
Expand Down
10 changes: 5 additions & 5 deletions admin/database/db-backup-tanhongit-2022-07-10-12-37-26.sql
Original file line number Diff line number Diff line change
Expand Up @@ -280,20 +280,20 @@ CREATE TABLE `posts` (
KEY `fk_id_author` (`post_author`)
) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO posts VALUES("1","2","2020-04-08 05:57:42","","About","Publiced","2020-04-08 06:31:51","2","Tân Hồng ","48","about","about-1page.png");
INSERT INTO posts VALUES("9","3","2020-04-12 13:20:20","","Web developmwnt","Publiced","0000-00-00 00:00:00","2","","0","fewrfewrew","");
INSERT INTO posts VALUES("8","2","2020-04-08 23:13:53","","Điều khoản sử dụng","Publiced","0000-00-00 00:00:00","2","","1","terms-of-use-page","");
INSERT INTO posts VALUES("1","2","2020-04-08 05:57:42","","About","Published","2020-04-08 06:31:51","2","Tân Hồng ","48","about","about-1page.png");
INSERT INTO posts VALUES("9","3","2020-04-12 13:20:20","","Web developmwnt","Published","0000-00-00 00:00:00","2","","0","fewrfewrew","");
INSERT INTO posts VALUES("8","2","2020-04-08 23:13:53","","Điều khoản sử dụng","Published","0000-00-00 00:00:00","2","","1","terms-of-use-page","");
INSERT INTO posts VALUES("6","2","2020-04-08 11:47:48","","Dmca Luật bản quyền","Trash","2020-04-08 10:25:58","1","Tân Hồng ","5","dmca-luat-ban","");
INSERT INTO posts VALUES("5","2","2020-04-09 14:03:15","Phim việt chất lượng cao<br />
\n<img alt=\"\" src=\"/php-mvc-shop/public/upload/ckeditorimages/about-1page.png\" style=\"height:271px; width:482px\" />","Phim việt","Publiced","2020-04-08 10:13:10","1","Tân Hồng ","4","phim-viet","phim-viet-5post.png");
\n<img alt=\"\" src=\"/php-mvc-shop/public/upload/ckeditorimages/about-1page.png\" style=\"height:271px; width:482px\" />","Phim việt","Published","2020-04-08 10:13:10","1","Tân Hồng ","4","phim-viet","phim-viet-5post.png");
INSERT INTO posts VALUES("4","2","2020-04-12 12:54:02","ouhiuh<br />
\naad<br />
\n<img alt=\"\" src=\"/php-mvc-shop/public/upload/ckeditorimages/tenor.gif\" style=\"height:498px; width:498px\" /><br />
\n<br />
\nfhgtfrdhtrd<br />
\nỵytrj","Privacy Policy","Draft","2020-04-08 06:05:46","2","Tân Hồng ","7","privacy-policy","privacy-policy-4page.jpg");
INSERT INTO posts VALUES("3","2","2020-04-08 06:17:37","Luật bản quyền dựa tr&ecirc;n luật to&agrave;n cầu<br />
\n<img alt=\"\" src=\"/php-mvc-shop/public/upload/ckeditorimages/dmca-luat-ban-quyen-2page.jpg\" style=\"height:304px; width:650px\" />","Dmca Luật bản quyền","Publiced","2020-04-07 23:52:43","2","","1","dmca-luat-ban-quyen","");
\n<img alt=\"\" src=\"/php-mvc-shop/public/upload/ckeditorimages/dmca-luat-ban-quyen-2page.jpg\" style=\"height:304px; width:650px\" />","Dmca Luật bản quyền","Published","2020-04-07 23:52:43","2","","1","dmca-luat-ban-quyen","");


DROP TABLE IF EXISTS products;
Expand Down
2 changes: 1 addition & 1 deletion admin/models/posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function publicPost($id)
show404NotFound();
}
global $linkConnectDB;
$sql = 'UPDATE posts SET post_status="Publiced", post_date="' . gmdate('Y-m-d H:i:s', time() + 7 * 3600) . '" where id=' . $id;
$sql = 'UPDATE posts SET post_status="Published", post_date="' . gmdate('Y-m-d H:i:s', time() + 7 * 3600) . '" where id=' . $id;
mysqli_query($linkConnectDB, $sql) or die(mysqli_error($linkConnectDB));
}
function postDelete($id)
Expand Down
2 changes: 1 addition & 1 deletion content/controllers/page/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
$postId = intval($_GET['id']);
$page = getRecord('posts', $postId);
$user = getRecord('users', $page['post_author']);
if (!$page || $page['post_status'] <> 'Publiced') {
if (!$page || $page['post_status'] <> 'Published') {
show404NotFound();
} else {
updateCountView($postId);
Expand Down
2 changes: 1 addition & 1 deletion content/controllers/post/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
$postId = intval($_GET['id']);
$post = getRecord('posts', $postId);
$user = getRecord('users', $post['post_author']);
if (!$post || $post['post_status'] <> 'Publiced') {
if (!$post || $post['post_status'] <> 'Published') {
show404NotFound();
} else {
updateCountView($postId);
Expand Down

0 comments on commit 2f5cc18

Please sign in to comment.