-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.php
102 lines (91 loc) · 2.69 KB
/
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.2">
<title>Admin Panel</title>
<style>
/* Add your CSS styles here */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
.sidebar {
background-color: #333;
color: #fff;
padding: 20px;
width: 200px;
height: 100%;
position: fixed;
}
.sidebar h1 {
margin-bottom: 20px;
}
.sidebar ul {
list-style: none;
padding: 0;
margin: 0;
}
.sidebar li {
margin-bottom: 10px;
}
.sidebar a {
color: #fff;
text-decoration: none;
display: block;
padding: 5px;
transition: background-color 0.2s;
}
.sidebar a:hover {
background-color: #555;
}
.content {
margin-left: 220px;
padding: 20px;
}
.content h2 {
margin-bottom: 20px;
}
</style>
<script>
function loadProductPanel() {
var xhr = new XMLHttpRequest();
xhr.open('GET', 'add_product_panel.php', true);
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
document.getElementById('productPanel').innerHTML = xhr.responseText;
}
};
xhr.send();
}
</script>
<link rel="stylesheet" type="text/css" href="addpoductstyles.css">
</head>
<body>
<!-- Sidebar -->
<div class="sidebar">
<h1>Admin Panel</h1>
<ul>
<li><a href="#dashboard">Dashboard</a></li>
<li><a href="#" onclick="loadProductPanel()">Products</a></li>
<li><a href="#orders">Orders</a></li>
<!-- Add more navigation links here -->
</ul>
</div>
<!-- Content -->
<div class="content">
<h2>Welcome, Admin!</h2>
<!-- Add your admin panel content here -->
<form action="add_product.php" method="post" style="margin-bottom: 10px;">
<!-- Форма для добавления продукта -->
</form>
</div>
<!-- Вставляем содержимое add_product_panel.php -->
<div id="productPanel"></div>
<!-- Add your JavaScript code here (if needed) -->
<script>
// Example JavaScript code (if needed)
</script>
</body>
</html>