-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfilter.php
More file actions
63 lines (56 loc) · 1.99 KB
/
filter.php
File metadata and controls
63 lines (56 loc) · 1.99 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
<?php include ("dbconnect.php"); ?>
<?php
if(isset($_POST["from_date"], $_POST["to_date"]))
{
$output .= '
<table class="table table-bordered">
<tr>
<th width="5%">ID</th>
<th width="30%">Customer Name</th>
<th width="15%">Sprinkles</th>
<th width="15%">Chocolate</th>
<th width="15%">Caramel</th>
<th width="15%">Raspberry</th>
<th width="15%">Strawberry</th>
<th width="15%">Blueberry</th>
<th width="15%">Total Cost</th>
<th width="15%">Order Date</th>
</tr>';
$date1 = $_POST["from_date"];
$date2 = $_POST["to_date"];
$sql = $conn ->prepare("SELECT * FROM donut WHERE Order_Date LIKE ? AND ?");
$sql -> bindValue(1, "$date1");
$sql -> bindValue(2, "$date2");
$sql -> execute();
if($sql -> rowCount())
{
while($row = $sql->fetch())
{
$output .= '
<tr>
<td>'. $row["Order_ID"] .'</td>
<td>'. $row["Order_Name"] .'</td>
<td>'. $row["field1"] .'</td>
<td>'. $row["field2"] .'</td>
<td>'. $row["field3"] .'</td>
<td>'. $row["field4"] .'</td>
<td>'. $row["field5"] .'</td>
<td>'. $row["field6"] .'</td>
<td>'. $row["Total_Price"] .'</td>
<td>'. $row["Order_Date"] .'</td>
</tr>
';
}
}
else
{
$output .= '
<tr>
<td colspan="10">No Order Found</td>
</tr>
';
}
$output .= '</table>';
echo $output;
}
?>