-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilter.php
More file actions
51 lines (50 loc) · 1.63 KB
/
Copy pathfilter.php
File metadata and controls
51 lines (50 loc) · 1.63 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
<?php
include 'connection.php';
session_start();
//filter.php
if(isset($_POST["from_date"], $_POST["to_date"]))
{
$output = '';
$query = "
SELECT * FROM expensetable
WHERE ExpenseDate BETWEEN '".$_POST["from_date"]."' AND '".$_POST["to_date"]."' AND uid='".$_SESSION['uid']."' " ;
$result = mysqli_query($conn, $query);
$output .= '
<table class="table table-bordered">
<tr>
<th >S. NO</th>
<th >Expense Item </th>
<th >Expense Cost </th>
<th >Expense Date </th>
<th colspan="2">Action</th>
</tr>
';
$sq = 1;
if(mysqli_num_rows($result) >= 0){
while($row = mysqli_fetch_assoc($result))
{
$output .= '
<tr>
<td>'. $sq .'</td>
<td>'. $row["ExpenseItem"] .'</td>
<td>'. $row["ExpenseCost"] .'</td>
<td>'. $row["ExpenseDate"] .'</td>
<td><a href="edit.php">Edit</a></td>
<td><a href="delete.php">Delete</a></td>
</tr>
';
$sq = $sq + 1;
}
}
else
{
$output .= '
<tr>
<td colspan="5">No Order Found</td>
</tr>
';
}
$output .= '</table>';
echo $output;
}
?>