-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from tanhongit/maintain
update style and clean code v3
- Loading branch information
Showing
13 changed files
with
58 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
<?php | ||
|
||
permission_user(); | ||
|
||
require_once('admin/models/users.php'); | ||
|
||
$options = array( | ||
'order_by' => 'id ASC' | ||
); | ||
$title = 'Danh sách Admin'; | ||
$adminNav = 'class="active open"'; | ||
$adminNav = 'class="active open"'; | ||
$list_user = get_all('users', $options); | ||
|
||
require('admin/views/role/admin.php'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
<?php | ||
|
||
permission_user(); | ||
permission_moderator(); | ||
|
||
require_once('admin/models/roles.php'); | ||
|
||
$roleId = intval($_GET['role_id']); | ||
role_delete($roleId); | ||
roleDestroy($roleId); | ||
|
||
header('location:admin.php?controller=role'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
<?php | ||
|
||
permission_user(); | ||
permission_moderator(); | ||
|
||
require_once('admin/models/users.php'); | ||
|
||
$roleId = intval($_GET['user_id']); | ||
user_delete($roleId); | ||
userDestroy($roleId); | ||
|
||
header('location:admin.php?controller=role&action=admin'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
<?php | ||
|
||
permission_user(); | ||
permission_moderator(); | ||
|
||
require_once('admin/models/roles.php'); | ||
|
||
if (!empty($_POST)) { | ||
role_update(); | ||
} | ||
if (isset($_GET['role_id'])) $roleId = intval($_GET['role_id']); else $roleId=0; | ||
$title = ($roleId==0) ? 'Thêm quyền truy cập' : 'Sửa quyền truy cập'; | ||
$adminNav = 'class="active open"'; | ||
|
||
if (isset($_GET['role_id'])) | ||
$roleId = intval($_GET['role_id']); | ||
else $roleId = 0; | ||
|
||
$title = ($roleId == 0) ? 'Thêm quyền truy cập' : 'Sửa quyền truy cập'; | ||
$adminNav = 'class="active open"'; | ||
$role = get_a_record('roles', $roleId); | ||
|
||
require('admin/views/role/edit.php'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
<?php | ||
|
||
permission_user(); | ||
permission_moderator(); | ||
|
||
require_once('admin/models/roles.php'); | ||
|
||
if (isset($_POST['role_id'])) { | ||
foreach ($_POST['role_id'] as $roleId) { | ||
$roleId = intval($roleId); | ||
role_delete($roleId); | ||
roleDestroy($roleId); | ||
} | ||
} | ||
|
||
$url = 'admin.php?controller=role'; | ||
$options = array( | ||
'order_by' => 'id ASC' | ||
); | ||
$title = 'Danh sách quyền truy cập website'; | ||
$adminNav = 'class="active open"'; | ||
$adminNav = 'class="active open"'; | ||
$roles = get_all('roles', $options); | ||
|
||
require('admin/views/role/index.php'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
<?php | ||
|
||
permission_user(); | ||
permission_moderator(); | ||
|
||
require_once('admin/models/shop.php'); | ||
|
||
$categoryId = intval($_GET['cate_id']); | ||
categories_delete($categoryId); | ||
categoryDestroy($categoryId); | ||
|
||
header('location:admin.php?controller=shop'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
<?php | ||
|
||
permission_user(); | ||
permission_moderator(); | ||
|
||
require_once('admin/models/shop.php'); | ||
|
||
if (!empty($_POST)) { | ||
category_uodate(); | ||
categoryUpdate(); | ||
} | ||
if (isset($_GET['cate_id'])) $categoryId = intval($_GET['cate_id']); | ||
|
||
if (isset($_GET['cate_id'])) | ||
$categoryId = intval($_GET['cate_id']); | ||
else $categoryId = 0; | ||
|
||
$title = ($categoryId == 0) ? 'Thêm danh mục' : 'Sửa danh mục'; | ||
$category = get_a_record('categories', $categoryId); | ||
$navCategory = 'class="active open"'; | ||
|
||
require('admin/views/shop/edit.php'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
<?php | ||
|
||
permission_user(); | ||
permission_moderator(); | ||
|
||
require_once('admin/models/shop.php'); | ||
|
||
$options = array( | ||
'order_by' => 'id' | ||
); | ||
$title = 'Nhóm Danh mục sản phẩm'; | ||
$categories = get_all('categories', $options); | ||
$navCategory = 'class="active open"'; | ||
|
||
//load view | ||
require('admin/views/shop/index.php'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?php | ||
function role_delete($id) | ||
function roleDestroy($id) | ||
{ | ||
$id = intval($id); | ||
global $linkConnectDB; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters