-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex_admin.php
125 lines (123 loc) · 4.87 KB
/
index_admin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?php
if(isset($_POST)){
$var=$_POST;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bookstore</title>
<link href="https://cdn.lineicons.com/4.0/lineicons.css" rel="stylesheet" />
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
<link rel="stylesheet" href="view/sidebar/style.css">
</head>
<body>
<div class="wrapper">
<aside id="sidebar">
<div class="d-flex">
<button class="toggle-btn" type="button">
<i class="lni lni-home"></i>
</button>
<div class="sidebar-logo">
<a href="index.php">BookStore</a>
</div>
</div>
<ul class="sidebar-nav">
<li class="sidebar-item">
<a href="index_admin.php?controller=admin&action=list" class="sidebar-link">
<i class="lni lni-user"></i>
<span>Admin</span>
</a>
</li>
<li class="sidebar-item">
<a href="index_admin.php?controller=user&action=list" class="sidebar-link">
<i class="lni lni-users"></i>
<span>Users</span>
</a>
</li>
<li class="sidebar-item">
<a href="index_admin.php?controller=book&action=list" class="sidebar-link">
<i class="lni lni-book"></i>
<span>Books</span>
</a>
</li>
<li class="sidebar-item">
<a href="index_admin.php?controller=genre&action=list" class="sidebar-link">
<i class="lni lni-layers"></i>
<span>Genre</span>
</a>
</li>
<li class="sidebar-item">
<a href="index_admin.php?controller=author&action=list" class="sidebar-link">
<i class="lni lni-users"></i>
<span>Authors</span>
</a>
</li>
<li class="sidebar-item">
<a href="index_admin.php?controller=comment&action=list" class="sidebar-link">
<i class="lni lni-bubble"></i>
<span>Comments</span>
</a>
</li>
<li>
<a href="#" class="sidebar-link">
<i class="lni lni-exit"></i>
<span>Logout</span>
</a>
</li>
</ul>
</aside>
<div class="main p-3">
<div class="text-center">
<?php
if(isset($_GET['controller'])){
require_once 'controller/'.$_GET['controller'].'Controller.php';
$controller = $_GET['controller'].'Controller';
}
?>
<?php
if (isset($_GET['action'])) {
$action = $_GET['action'];
switch ($action) {
case 'create':
$controller::createAction();
break;
case 'list':
$controller::indexAction();
break;
case 'destroy':
$controller::destroyAction();
break;
case 'edit':
$controller::editAction();
break;
case 'store':
$controller::storeAction($var);
break;
case 'update':
$controller::updateAction();
break;
case 'delete':
$controller::deleteAction();
break;
}
}
else{
?>
<h1>Welcome to the bookStore</h1>
<?php
}
?>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe"
crossorigin="anonymous"></script>
<script src="view/sidebar/script.js"></script>
</body>
</html>