-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdashboard.php
128 lines (102 loc) · 3.5 KB
/
dashboard.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
<?php
$hostname = 'localhost';
$username = 'root';
$password = '';
$dbname = 'users';
$conn = mysqli_connect($hostname, $username, $password, $dbname);
?>
<?php
session_start();
$userID = $_SESSION['$userID'];
if(!empty($userID)){
?>
<!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>Dashboard</title>
<link rel="stylesheet" href="design/dashboard.css">
<link rel="icon" href="icons/dashboard.png" type="image/icon type">
<link href='https://unpkg.com/[email protected]/css/boxicons.min.css' rel='stylesheet'>
</head>
<body>
<div class="navbar">
<div class="navbar-shop-logo">
<a href="dashboard.php"><img src="icons/shop.png" style="width: 90px; height: 90px;">
</div>
<div class="navbar-add-product-button">
<a href='add.php'><button>Add</button></a>
</div>
<!-- <div class="navbar-update-product-button">
<a href='update.php'><button>Update</button></a>
</div> -->
<div class="navbar-product-button">
<a href='product.php'><button>Products</button></a>
</div>
<div class="navbar-sell-product-button">
<a href='sell.php'><button>Sell</button></a>
</div>
<div class="navbar-return-product-button">
<a href='return.php'><button>Return</button></a>
</div>
<div class="navbar-logout-button">
<a href='logout.php'><button>Logout</button></a>
</div>
</div>
<section class="home-section">
<div class="home-content">
<div class="overview-boxes">
<div class="box">
<div class="right-side">
<div class="box-topic">Total Order</div>
<div class="number"><?php $query="SELECT COUNT(order_id) FROM orders";
$result = $conn->query($query);
$output = mysqli_fetch_array($result);
echo $output['COUNT(order_id)']; ?></div>
<div class="indicator">
<i class='bx bx-up-arrow-alt'></i>
<span class="text">Up from yesterday</span>
</div>
</div>
<i class='bx bx-cart-alt cart'></i>
</div>
<div class="box">
<div class="right-side">
<div class="box-topic">Total Revenue</div>
<div class="number"><?php $query="SELECT SUM(total_price) FROM orders";
$result = $conn->query($query);
$output = mysqli_fetch_array($result);
echo $output['SUM(total_price)']; ?></div>
<div class="indicator">
<i class='bx bx-up-arrow-alt'></i>
<span class="text">Up from yesterday</span>
</div>
</div>
<i class='bx bxs-cart-add cart two' ></i>
</div>
</div>
<!-- eliminated form here -->
<div class="date-time-label">
<label>Current Date & Time</label>
</div>
<div class="time">
<span id="time"> </span>
<script src="time.js"></script>
</div>
</div>
</section>
<div class="footer">
<label>©</label>
<a href = https://github.com/rr-uchchash360>Md. Rafiur Rahman</a>
<a href = https://github.com/zubayertahmid>Zubayer Tahmid</a>
</div>
</body>
</html>
<?php
}
else{
header('location:login.php');
}
?>