-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.php
207 lines (196 loc) · 9.68 KB
/
home.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
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
<?php
include '../config.php';
$admin=new Admin();
if(!isset($_SESSION['e_id'])){
header('Location:index.php');
}
$aid=$_SESSION['e_id'];
$stmt=$admin->ret("SELECT * FROM `employee` where `e_id`='$aid'");
$row=$stmt->fetch(PDO::FETCH_ASSOC);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>Drug Rial | Employee</title>
<link rel="stylesheet" href="assets/vendors/mdi/css/materialdesignicons.min.css" />
<link rel="stylesheet" href="assets/vendors/flag-icon-css/css/flag-icon.min.css" />
<link rel="stylesheet" href="assets/vendors/css/vendor.bundle.base.css" />
<link rel="stylesheet" href="assets/vendors/font-awesome/css/font-awesome.min.css" />
<link rel="stylesheet" href="assets/vendors/bootstrap-datepicker/bootstrap-datepicker.min.css" />
<link rel="stylesheet" href="assets/css/style.css" />
<link rel="shortcut icon" href="assets/images/favicon.png" />
</head>
<body>
<div class="container-scroller">
<?php include 'includes/sidebar.php';?>
<div class="container-fluid page-body-wrapper">
<div id="theme-settings" class="settings-panel">
<i class="settings-close mdi mdi-close"></i>
<p class="settings-heading">SIDEBAR SKINS</p>
<div class="sidebar-bg-options selected" id="sidebar-default-theme">
<div class="img-ss rounded-circle bg-light border mr-3"></div> Default
</div>
<div class="sidebar-bg-options" id="sidebar-dark-theme">
<div class="img-ss rounded-circle bg-dark border mr-3"></div> Dark
</div>
<p class="settings-heading mt-2">HEADER SKINS</p>
<div class="color-tiles mx-0 px-4">
<div class="tiles light"></div>
<div class="tiles dark"></div>
</div>
</div>
<?php include 'includes/topbar.php';?>
<div class="main-panel">
<div class="content-wrapper pb-0">
<div class="page-header flex-wrap">
<h3 class="mb-0"> Hi, welcome back! <span class="pl-0 h6 pl-sm-2 text-muted d-inline-block"><?php echo $row['e_name']; ?></span>
</h3>
</div>
<div class="row">
<div class="col-xl-4 col-md-6 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<?php
$stmt2=$admin->ret("SELECT * FROM `medicine` where `e_id`='$aid'");
$row2=$stmt2->fetch(PDO::FETCH_ASSOC);
$num2=$stmt2->rowCount();
?>
<h4 class="card-title text-black"><?php echo $num2; ?></h4>
<p class="text-muted badge badge-inverse-success">Medicines</p>
</div>
</div>
</div>
<div class="col-xl-4 col-md-6 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<?php
$stmt3=$admin->ret("SELECT * FROM `order` inner join `medicine` on medicine.m_id=order.m_id where `e_id`='$aid'");
$row3=$stmt3->fetch(PDO::FETCH_ASSOC);
$num3=$stmt3->rowCount();
?>
<h4 class="card-title text-black"><?php echo $num3; ?></h4>
<p class="text-muted badge badge-inverse-success ">Orders</p>
</div>
</div>
</div>
<div class="col-xl-4 col-md-6 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<?php
$stmt4=$admin->ret("SELECT SUM(`p_amount`) FROM `payment` ");
$row4=$stmt4->fetch(PDO::FETCH_ASSOC);
$num4=implode($row4);
?>
<h4 class="card-title text-black"><?php echo $num4; ?></h4>
<p class="text-muted pb-2 badge badge-inverse-success">Transactions</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xl-8 col-sm-6 grid-margin stretch-card">
<div class="card">
<div class="card-body px-0 overflow-auto">
<h4 class="card-title pl-4">Purchase History</h4>
<div class="table-responsive">
<table class="table">
<thead class="bg-light">
<tr>
<th>Customer</th>
<th>Madicine</th>
<th>Quantity</th>
<th>Amount</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<?php
$stmt5=$admin->ret("SELECT * FROM `order` inner join `medicine` on medicine.m_id=order.m_id inner join `customer` on customer.c_id=order.c_id order by `o_id` desc LIMIT 5");
while($row5=$stmt5->fetch(PDO::FETCH_ASSOC)){
$id=$row5['o_id'];
?>
<tr>
<td>
<div class="d-flex align-items-center">
<img src="../customer/controller/<?php echo $row5['c_dp']; ?>" alt="image">
<div class="table-user-name ml-3">
<p class="mb-0 font-weight-medium"> <?php echo $row5['c_name']; ?> </p>
<small> </small>
</div>
</div>
</td>
<td><?php echo $row5['m_title']; ?></td>
<td><?php echo $row5['o_qty']; ?></td>
<td><?php echo $row5['o_total_amount']; ?></td>
<td>
<div class="badge badge-inverse-success"> <?php echo $row5['o_status']; ?></div>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<a class="text-black mt-3 d-block pl-4" href="order.php">
<span class="font-weight-medium h6">View all order history</span>
<i class="mdi mdi-chevron-right"></i></a>
</div>
</div>
</div>
<div class="col-xl-4 col-sm-6 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<div class="card-title font-weight-medium"> Latest Transactions</div>
<!-- <p class="text-muted"> Lorem ipsum dolor sitadipiscing elit, sed amet do eiusmod tempor we find a new solution </p> -->
<?php
$stmt5=$admin->ret("SELECT * FROM `payment` inner join `order` on order.o_id=payment.o_id inner join `medicine` on medicine.m_id=order.m_id inner join `customer` on customer.c_id=order.c_id order by `p_id` desc LIMIT 5");
while($row5=$stmt5->fetch(PDO::FETCH_ASSOC)){
$id=$row5['o_id'];
?>
<div class="d-flex flex-wrap border-bottom py-2 border-top justify-content-between">
<img class="survey-img mb-lg-2" src="../customer/controller/<?php echo $row5['c_dp'] ?>" alt="">
<div class="pt-2">
<h5 class="mb-0"><?php echo $row5['c_name'] ?></h5>
<p class="mb-0 text-muted"><?php echo $row5['p_amount'] ?></p>
<h5 class="mb-0"><?php echo $row5['m_title'] ?></h5>
</div>
</div>
<?php } ?>
<a class="text-black mt-3 d-block font-weight-medium h6" href="view_payment.php">View all <i class="mdi mdi-chevron-right"></i></a>
</div>
</div>
</div>
</div>
</div>
<?php include 'includes/footer.php'?>
</div>
<!-- main-panel ends -->
</div>
<!-- page-body-wrapper ends -->
</div>
<!-- container-scroller -->
<!-- plugins:js -->
<script src="assets/vendors/js/vendor.bundle.base.js"></script>
<!-- endinject -->
<!-- Plugin js for this page -->
<script src="assets/vendors/chart.js/Chart.min.js"></script>
<script src="assets/vendors/bootstrap-datepicker/bootstrap-datepicker.min.js"></script>
<script src="assets/vendors/flot/jquery.flot.js"></script>
<script src="assets/vendors/flot/jquery.flot.resize.js"></script>
<script src="assets/vendors/flot/jquery.flot.categories.js"></script>
<script src="assets/vendors/flot/jquery.flot.fillbetween.js"></script>
<script src="assets/vendors/flot/jquery.flot.stack.js"></script>
<script src="assets/vendors/flot/jquery.flot.pie.js"></script>
<!-- End plugin js for this page -->
<!-- inject:js -->
<script src="assets/js/off-canvas.js"></script>
<script src="assets/js/hoverable-collapse.js"></script>
<script src="assets/js/misc.js"></script>
<!-- endinject -->
<!-- Custom js for this page -->
<script src="assets/js/dashboard.js"></script>
<!-- End custom js for this page -->
</body>
</html>