-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathseller_dashboard.php
More file actions
71 lines (61 loc) · 2.09 KB
/
Copy pathseller_dashboard.php
File metadata and controls
71 lines (61 loc) · 2.09 KB
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
<?php
require_once 'conn.php';
session_start();
if (!isset($_SESSION['seller_id'])) {
echo "<script> alert('Login to use our services');";
echo "window.location.href='selleronastra.html';</script>";
} else {
require_once "seller_dashboard.html";
require_once "seller_sidebar.html";
$seller_id = $_SESSION['seller_id'];
$stmt1 = $conn->prepare("SELECT SID FROM seller_profile WHERE UID = $seller_id");
$stmt1->execute();
$get_SID = $stmt1->get_result();
if ($get_SID->num_rows > 0) {
while ($SIDrow = $get_SID->fetch_assoc()) {
$SID = $SIDrow['SID'];
}
}
$stmt = $conn->prepare("SELECT COUNT(*) AS order_count FROM orders WHERE SID = $SID");
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$row = $result->fetch_assoc();
$order_count = $row['order_count'];
}
$stmt2 = $conn->prepare("SELECT COUNT(*) AS product_count FROM product WHERE SID = $SID");
$stmt2->execute();
$result2 = $stmt2->get_result();
if ($result2->num_rows > 0) {
$row = $result2->fetch_assoc();
$product_count = $row['product_count'];
}
}
?>
<body>
<section class="home-section" style="height:100dvh">
<div class="home-content">
<i class='bx bx-menu position-fixed'></i>
</div>
<div class="container orders">
<div class="row">
<div class="col-sm-1">
</div>
<div class="col-3 div1">
<h4>Total Orders <br>
<?php echo $order_count; ?>
</h4>
</div>
<div class="col-3 bg-warning">
<h4>Total Sales Amount</h4>
</div>
<div class="col-3 bg-secondary">
<h4>Total Products<br>
<?php echo $product_count; ?>
</h4>
</div>
</div>
</div>
</section>
</body>
<script src="slide.js"></script>