forked from khanhdnk/akathon01-23
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeviceinfo.php
134 lines (114 loc) · 4.33 KB
/
deviceinfo.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
126
127
128
129
130
131
132
133
134
<?php
//if logged in, go to manager page
session_start();
if ((isset($_SESSION['authenticated']) && $_SESSION['authenticated']) || (isset($_SESSION['admin']) && $_SESSION['admin'])) {
}else{
header('Location: ./login.php');
}
include('./conn/func.php');
$data = getData("users");
$d_data = getData("devices");
if (isset($_GET['order_id'])) {
$del_id = $_GET['order_id'];
$delete = deleteData("users", $del_id);
echo $delete;
header('Location: ./admin.php');
}
?>
<!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">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat">
<link rel="stylesheet" href="style/animation.css">
<link rel="stylesheet" href="style/form.css">
<link rel="icon" href="images/tabicon.png">
<title>Device Information</title>
</head>
<body>
<div class="fixbug">
<header>
<nav>
<h1>TNE:GO</h1>
<div class="nav_links">
<input type="checkbox" id="button">
<label for="button" id="nav_icon"><i class="fa-solid fa-bars"></i></label>
<ul>
<li><a href="index.php">Homepage</a></li>
<li><a href="dashboard.php">Dashboard</a></li>
<li><a href="ourteam.php">Our Team</a></li>
<?php
if (isset($_SESSION['admin']) && $_SESSION['admin']) {
echo "<li><a href='admin.php'>Admin</a></li>";
}
if ((isset($_SESSION['authenticated']) && $_SESSION['authenticated']) || (isset($_SESSION['admin']) && $_SESSION['admin'])) {
echo "<li><a href='logout.php'>Logout</a></li>";
} else {
echo "<li><a href='login.php'>Login</a></li>";
}
?>
</ul>
</div>
</nav>
</header>
<main>
<div class="devicepage">
<h1>Device Information</h1>
<div class="device_info">
<?php foreach ($d_data->data as $d_row): ?>
<div class="item-box product-box">
<img src="<?= $d_row->image ?>" alt="Item image 1">
<h2>
<?= $d_row->name ?>
</h2>
<div class="extra-content">
<table>
<tr>
<th>Size</th>
<td>
<?= $d_row->size ?>
</td>
</tr>
<tr>
<th>Weight</th>
<td>
<?= $d_row->weight ?>
</td>
</tr>
<tr>
<th>Price</th>
<td>
<?= $d_row->price ?>
</td>
</tr>
<tr>
<th>Port</th>
<td>
<?= $d_row->port ?>
</td>
</tr>
<tr>
<th>Bandwidth</th>
<td>
<?= $d_row->bandwidth ?>
</td>
</tr>
</table>
<br>
<a href="<?= $d_row->link ?>" target="_blank">More info</a>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</main>
</div>
<footer>
<p>Dang Nam Khanh, Le Xuan Nhat, Duong Quang Thanh</p>
<p>Copyright © 2023 TNE:GO. All rights Reserved</p>
</footer>
</body>
</html>