-
Notifications
You must be signed in to change notification settings - Fork 38
/
admin.html
286 lines (255 loc) · 12.6 KB
/
admin.html
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
<!DOCTYPE html>
<html lang="vi">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Admin - Thế giới điện thoại</title>
<link rel="shortcut icon" href="img/favicon.ico" />
<!-- Load font awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
crossorigin="anonymous">
<!-- Chart JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.min.js"></script>
<!-- Our files -->
<link rel="stylesheet" href="css/admin/style.css">
<link rel="stylesheet" href="css/admin/progress.css">
<script src="data/products.js"></script>
<script src="js/classes.js"></script>
<script src="js/dungchung.js"></script>
<script src="js/admin.js"></script>
</head>
<body>
<header>
<h2>SmartPhone Store - Admin</h2>
</header>
<!-- Menu -->
<aside class="sidebar">
<ul class="nav">
<li class="nav-title">MENU</li>
<li class="nav-item"><a class="nav-link active"><i class="fa fa-home"></i> Trang Chủ</a></li>
<li class="nav-item"><a class="nav-link"><i class="fa fa-th-large"></i> Sản Phẩm</a></li>
<li class="nav-item"><a class="nav-link"><i class="fa fa-file-text-o"></i> Đơn Hàng</a></li>
<li class="nav-item"><a class="nav-link"><i class="fa fa-address-book-o"></i> Khách Hàng</a></li>
<li class="nav-item">
<hr>
</li>
<li class="nav-item">
<a href="index.html" class="nav-link" onclick="logOutAdmin(); return true;">
<i class="fa fa-arrow-left"></i>
Đăng xuất (về Trang chủ)
</a>
</li>
</ul>
</aside>
<!-- Khung hiển thị chính -->
<div class="main">
<div class="home">
<div class="canvasContainer">
<canvas id="myChart1"></canvas>
</div>
<div class="canvasContainer">
<canvas id="myChart2"></canvas>
</div>
<div class="canvasContainer">
<canvas id="myChart3"></canvas>
</div>
<div class="canvasContainer">
<canvas id="myChart4"></canvas>
</div>
</div>
<!-- Sản Phẩm -->
<div class="sanpham">
<table class="table-header">
<tr>
<!-- Theo độ rộng của table content -->
<th title="Sắp xếp" style="width: 5%" onclick="sortProductsTable('stt')">Stt <i class="fa fa-sort"></i></th>
<th title="Sắp xếp" style="width: 10%" onclick="sortProductsTable('masp')">Mã <i class="fa fa-sort"></i></th>
<th title="Sắp xếp" style="width: 40%" onclick="sortProductsTable('ten')">Tên <i class="fa fa-sort"></i></th>
<th title="Sắp xếp" style="width: 15%" onclick="sortProductsTable('gia')">Giá <i class="fa fa-sort"></i></th>
<th title="Sắp xếp" style="width: 15%" onclick="sortProductsTable('khuyenmai')">Khuyến mãi <i class="fa fa-sort"></i></th>
<th style="width: 15%">Hành động</th>
</tr>
</table>
<div class="table-content">
</div>
<div class="table-footer">
<select name="kieuTimSanPham">
<option value="ma">Tìm theo mã</option>
<option value="ten">Tìm theo tên</option>
</select>
<input type="text" placeholder="Tìm kiếm..." onkeyup="timKiemSanPham(this)">
<button onclick="document.getElementById('khungThemSanPham').style.transform = 'scale(1)'; autoMaSanPham()">
<i class="fa fa-plus-square"></i>
Thêm sản phẩm
</button>
</div>
<div id="khungThemSanPham" class="overlay">
<span class="close" onclick="this.parentElement.style.transform = 'scale(0)';">×</span>
<table class="overlayTable table-outline table-content table-header">
<tr>
<th colspan="2">Thêm Sản Phẩm</th>
</tr>
<tr>
<td>Mã sản phẩm:</td>
<td><input type="text" id="maspThem"></td>
</tr>
<tr>
<td>Tên sản phẩm:</td>
<td><input type="text"></td>
</tr>
<tr>
<td>Hãng:</td>
<td>
<select name="chonCompany" onchange="autoMaSanPham(this.value)">
<script>
var company = ["Apple", "Samsung", "Oppo", "Nokia", "Huawei", "Xiaomi","Realme", "Vivo", "Philips", "Mobell", "Mobiistar", "Itel","Coolpad", "HTC", "Motorola"];
for(var c of company) {
document.writeln(`<option value="`+c+`">`+c+`</option>`);
}
</script>
</select>
</td>
</tr>
<tr>
<td>Hình:</td>
<td>
<img class="hinhDaiDien" id="anhDaiDienSanPhamThem" src="">
<input type="file" accept="image/*" onchange="capNhatAnhSanPham(this.files, 'anhDaiDienSanPhamThem')">
</td>
</tr>
<tr>
<td>Giá tiền:</td>
<td><input type="text"></td>
</tr>
<tr>
<td>Số sao (số nguyên 0->5):</td>
<td><input type="text"></td>
</tr>
<tr>
<td>Đánh giá (số nguyên):</td>
<td><input type="text"></td>
</tr>
<tr>
<td>Khuyến mãi:</td>
<td>
<select>
<option value="">Không</option>
<option value="tragop">Trả góp</option>
<option value="giamgia">Giảm giá</option>
<option value="giareonline">Giá rẻ online</option>
<option value="moiramat">Mới ra mắt</option>
</select>
</td>
</tr>
<tr>
<td>Giá trị khuyến mãi:</td>
<td><input type="text" placeholder=""></td>
</tr>
<tr>
<th colspan="2">Thông số kĩ thuật</th>
</tr>
<tr>
<td>Màn hình:</td>
<td><input type="text"></td>
</tr>
<tr>
<td>Hệ điều hành:</td>
<td><input type="text"></td>
</tr>
<tr>
<td>Camara sau:</td>
<td><input type="text"></td>
</tr>
<tr>
<td>Camara trước:</td>
<td><input type="text"></td>
</tr>
<tr>
<td>CPU:</td>
<td><input type="text"></td>
</tr>
<tr>
<td>RAM:</td>
<td><input type="text"></td>
</tr>
<tr>
<td>Bộ nhớ trong:</td>
<td><input type="text"></td>
</tr>
<tr>
<td>Thẻ nhớ:</td>
<td><input type="text"></td>
</tr>
<tr>
<td>Dung lượng Pin:</td>
<td><input type="text"></td>
</tr>
<tr>
<td colspan="2" class="table-footer"> <button onclick="themSanPham()">THÊM</button> </td>
</tr>
</table>
</div>
<div id="khungSuaSanPham" class="overlay"></div>
</div> <!-- // sanpham -->
<!-- Đơn Hàng -->
<div class="donhang">
<table class="table-header">
<tr>
<!-- Theo độ rộng của table content -->
<th title="Sắp xếp" style="width: 5%" onclick="sortDonHangTable('stt')">Stt <i class="fa fa-sort"></i></th>
<th title="Sắp xếp" style="width: 13%" onclick="sortDonHangTable('madon')">Mã đơn <i class="fa fa-sort"></i></th>
<th title="Sắp xếp" style="width: 7%" onclick="sortDonHangTable('khach')">Khách <i class="fa fa-sort"></i></th>
<th title="Sắp xếp" style="width: 20%" onclick="sortDonHangTable('sanpham')">Sản phẩm <i class="fa fa-sort"></i></th>
<th title="Sắp xếp" style="width: 15%" onclick="sortDonHangTable('tongtien')">Tổng tiền <i class="fa fa-sort"></i></th>
<th title="Sắp xếp" style="width: 10%" onclick="sortDonHangTable('ngaygio')">Ngày giờ <i class="fa fa-sort"></i></th>
<th title="Sắp xếp" style="width: 10%" onclick="sortDonHangTable('trangthai')">Trạng thái <i class="fa fa-sort"></i></th>
<th style="width: 10%">Hành động</th>
</tr>
</table>
<div class="table-content">
</div>
<div class="table-footer">
<div class="timTheoNgay">
Từ ngày: <input type="date" id="fromDate">
Đến ngày: <input type="date" id="toDate">
<button onclick="locDonHangTheoKhoangNgay()"><i class="fa fa-search"></i> Tìm</button>
</div>
<select name="kieuTimDonHang">
<option value="ma">Tìm theo mã đơn</option>
<option value="khachhang">Tìm theo tên khách hàng</option>
<option value="trangThai">Tìm theo trạng thái</option>
</select>
<input type="text" placeholder="Tìm kiếm..." onkeyup="timKiemDonHang(this)">
</div>
</div> <!-- // don hang -->
<!-- Khách hàng -->
<div class="khachhang">
<table class="table-header">
<tr>
<!-- Theo độ rộng của table content -->
<th title="Sắp xếp" style="width: 5%" onclick="sortKhachHangTable('stt')">Stt <i class="fa fa-sort"></i></th>
<th title="Sắp xếp" style="width: 15%" onclick="sortKhachHangTable('hoten')">Họ tên <i class="fa fa-sort"></i></th>
<th title="Sắp xếp" style="width: 20%" onclick="sortKhachHangTable('email')">Email <i class="fa fa-sort"></i></th>
<th title="Sắp xếp" style="width: 20%" onclick="sortKhachHangTable('taikhoan')">Tài khoản <i class="fa fa-sort"></i></th>
<th title="Sắp xếp" style="width: 10%" onclick="sortKhachHangTable('matkhau')">Mật khẩu <i class="fa fa-sort"></i></th>
<th style="width: 10%">Hành động</th>
</tr>
</table>
<div class="table-content">
</div>
<div class="table-footer">
<select name="kieuTimKhachHang">
<option value="ten">Tìm theo họ tên</option>
<option value="email">Tìm theo email</option>
<option value="taikhoan">Tìm theo tài khoản</option>
</select>
<input type="text" placeholder="Tìm kiếm..." onkeyup="timKiemNguoiDung(this)">
<button onclick="openThemNguoiDung()"><i class="fa fa-plus-square"></i> Thêm người dùng</button>
</div>
</div> <!-- // khach hang -->
</div> <!-- // main -->
<footer>
</footer>
</body>
</html>