-
Notifications
You must be signed in to change notification settings - Fork 0
/
invoice.php
352 lines (315 loc) · 11.5 KB
/
invoice.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
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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- This file has been downloaded from bootdey.com @bootdey on twitter -->
<!-- All snippets are MIT license http://bootdey.com/license -->
<title>invoice page - Bootdey.com</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.0/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.0/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<div class="container">
<div class="card">
<div class="card-body">
<div id="invoice">
<hr>
</div>
<div class="invoice overflow-auto">
<div style="min-width: 600px">
<header>
<div class="row">
<div class="col">
<a href="javascript:;">
<img src="assets/images/logo-icon.png" width="80" alt="">
</a>
</div>
<div class="col company-details">
<h2 class="name">
<a target="_blank" href="javascript:;">
MediSearch
</a>
</h2>
<div>Mohakhali</div>
<div>(123) 456-789</div>
<div>medisearch@example.com</div>
</div>
</div>
</header>
<main>
<div class="row contacts">
<div class="col invoice-to">
<div class="text-gray-light">INVOICE TO:</div>
<table>
<tr>
<th>Name</th>
<th>Email</th>
<th>Address</th>
<th>Payment Method</th>
</tr>
<hr>
<tbody>
</div>
</div>
<?php
$conn = mysqli_connect("localhost", "root", "", "cse370_project");
if ($conn-> connect_error) {
die("Connection falied:". $conn-> connect_error);
}
$sql = "SELECT customer_name, email, customer_address, payment_method from order_payment WHERE order_no=7";
$result = $conn-> query($sql);
if ($result-> num_rows > 0) {
while ($row = $result-> fetch_assoc()) {
echo "<tr><td>". $row["customer_name"]. "</td><td>". $row["email"]."</td><td>". $row["customer_address"]."</td><td>". $row["payment_method"]."</td></tr>";
}
echo "</table>";
}
else{
echo "o result";
}
$conn-> close();
?>
<!-- <h2 class="to">John Doe</h2>
<div class="address">796 Silver Harbour, TX 79273, US</div>
<div class="email"><a href="mailto:john@example.com">john@example.com</a>
</div>
</div> -->
<div class="col invoice-details">
<h1 class="invoice-id">INVOICE</h1>
</div>
</div>
<table>
<tr>
<th>Cart</th>
<th>Quantity</th>
<th>Price</th>
</tr>
<hr>
<!-- <td>Discount</td>
<p>Total <span class="price" style="color:black"><b>30 TK</b></span></p> -->
<tbody>
<?php
$conn = mysqli_connect("localhost", "root", "", "cse370_project");
if ($conn-> connect_error) {
die("Connection falied:". $conn-> connect_error);
}
$sql = "SELECT med_name, med_quantity, price_per_pack from medicine_order_list WHERE order_no=0";
$result = $conn-> query($sql);
if ($result-> num_rows > 0) {
while ($row = $result-> fetch_assoc()) {
echo "<tr><td>". $row["med_name"]. "</td><td>". $row["med_quantity"]."</td><td>". $row["price_per_pack"]. "</td></tr>";
}
echo "</table>";
}
else{
echo "o result";
}
$conn-> close();
?>
<table>
<tr>
<td>Discount</td>
<td>Total</td>
</tr>
<?php
$conn = mysqli_connect("localhost", "root", "", "cse370_project");
if ($conn-> connect_error) {
die("Connection falied:". $conn-> connect_error);
}
$sql = "SELECT discount, grand_total from payment_table WHERE order_no=0";
$result = $conn-> query($sql);
if ($result-> num_rows > 0) {
while ($row = $result-> fetch_assoc()) {
echo "<tr><td>". $row["discount"]. "</td><td>". $row["grand_total"]. "</td></tr>";
}
echo "</table>";
}
else{
echo "o result";
}
$conn-> close();
?>
</table>
</table>
<div class="thanks">Thank you!</div>
<p><a href="Hemlo.php">Proceed to Delivery</a></p>
</main>
<footer>Invoice was created on a computer and is valid without the signature and seal.</footer>
</div>
<!--DO NOT DELETE THIS div. IT is responsible for showing footer always at the bottom-->
<div></div>
</div>
</div>
</div>
</div>
</div>
<style type="text/css">
body{margin-top:20px;
background-color: #f7f7ff;
}
#invoice {
padding: 0px;
}
.invoice {
position: relative;
background-color: #FFF;
min-height: 680px;
padding: 15px
}
.invoice header {
padding: 10px 0;
margin-bottom: 20px;
border-bottom: 1px solid #0d6efd
}
.invoice .company-details {
text-align: right
}
.invoice .company-details .name {
margin-top: 0;
margin-bottom: 0
}
.invoice .contacts {
margin-bottom: 20px
}
.invoice .invoice-to {
text-align: left
}
.invoice .invoice-to .to {
margin-top: 0;
margin-bottom: 0
}
.invoice .invoice-details {
text-align: right
}
.invoice .invoice-details .invoice-id {
margin-top: 0;
color: #0d6efd
}
.invoice main {
padding-bottom: 50px
}
.invoice main .thanks {
margin-top: 100px;
font-size: 2em;
margin-bottom: 50px
}
.invoice main .notices {
padding-left: 6px;
border-left: 6px solid #0d6efd;
background: #e7f2ff;
padding: 10px;
}
.invoice main .notices .notice {
font-size: 1.2em
}
.invoice table {
width: 100%;
border-collapse: collapse;
border-spacing: 0;
margin-bottom: 20px
}
.invoice table td,
.invoice table th {
padding: 15px;
background: #eee;
border-bottom: 1px solid #fff
}
.invoice table th {
white-space: nowrap;
font-weight: 400;
font-size: 16px
}
.invoice table td h3 {
margin: 0;
font-weight: 400;
color: #0d6efd;
font-size: 1.2em
}
.invoice table .qty,
.invoice table .total,
.invoice table .unit {
text-align: right;
font-size: 1.2em
}
.invoice table .no {
color: #fff;
font-size: 1.6em;
background: #0d6efd
}
.invoice table .unit {
background: #ddd
}
.invoice table .total {
background: #0d6efd;
color: #fff
}
.invoice table tbody tr:last-child td {
border: none
}
.invoice table tfoot td {
background: 0 0;
border-bottom: none;
white-space: nowrap;
text-align: right;
padding: 10px 20px;
font-size: 1.2em;
border-top: 1px solid #aaa
}
.invoice table tfoot tr:first-child td {
border-top: none
}
.card {
position: relative;
display: flex;
flex-direction: column;
min-width: 0;
word-wrap: break-word;
background-color: #fff;
background-clip: border-box;
border: 0px solid rgba(0, 0, 0, 0);
border-radius: .25rem;
margin-bottom: 1.5rem;
box-shadow: 0 2px 6px 0 rgb(218 218 253 / 65%), 0 2px 6px 0 rgb(206 206 238 / 54%);
}
.invoice table tfoot tr:last-child td {
color: #0d6efd;
font-size: 1.4em;
border-top: 1px solid #0d6efd
}
.invoice table tfoot tr td:first-child {
border: none
}
.invoice footer {
width: 100%;
text-align: center;
color: #777;
border-top: 1px solid #aaa;
padding: 8px 0
}
@media print {
.invoice {
font-size: 11px !important;
overflow: hidden !important
}
.invoice footer {
position: absolute;
bottom: 10px;
page-break-after: always
}
.invoice>div:last-child {
page-break-before: always
}
}
.invoice main .notices {
padding-left: 6px;
border-left: 6px solid #0d6efd;
background: #e7f2ff;
padding: 10px;
}
</style>
<script type="text/javascript">
</script>
</body>
</html>