-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewpayment.php
91 lines (90 loc) · 2.78 KB
/
viewpayment.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
<?php
include("header.php");
if (isset($_GET['delid'])) {
$sql = "DELETE FROM payment WHERE payment_id='$_GET[delid]'";
$qsql = mysqli_query($con, $sql);
echo mysqli_error($con);
if (mysqli_affected_rows($con) == 1) {
echo "<script>alert('Payment record deleted successfully...');</script>";
}
}
?>
<!-- Sub Banner Start -->
<div class="mg_sub_banner">
<div class="container">
<h2>Transaction Report</h2>
</div>
</div>
<!-- Sub Banner Start -->
<!--start main -->
<div class="iqoniq_contant_wrapper">
<section class="gray-bg aboutus-wrapper">
<div class="container">
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="about-us">
<div class="text">
<table id="datatable" class="table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>Bill No.</th>
<th>Customer</th>
<th>Transaction type</th>
<th>Payment Date</th>
<th>Payment Type</th>
<th>Total Amount</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT * FROM payment LEFT JOIN customer ON payment.customer_id=customer.customer_id LEFT JOIN room_booking ON payment.room_booking_id=room_booking.room_booking_id where payment.status!='' ";
if (isset($_SESSION['customer_id'])) {
$sql = $sql . " AND payment.customer_id='$_SESSION[customer_id]' ";
}
$sql = $sql . " ORDER BY payment.payment_id DESC";
$qsql = mysqli_query($con, $sql);
echo mysqli_error($con);
while ($rs = mysqli_fetch_array($qsql)) {
echo "<tr>
<td>$rs[0]</td>
<td>$rs[customer_name]</td>";
if ($rs['transaction_type'] == "Hotel Booking") {
echo "<td><b style='color:blue;'>" . $rs['transaction_type'] . "</b></td>";
}
if ($rs['transaction_type'] == "Food Order") {
echo "<td><b style='color:green;'>" . $rs['transaction_type'] . "</b></td>";
}
if ($rs['transaction_type'] == "Cab Booking") {
echo "<td><b style='color: orange;'>" . $rs['transaction_type'] . "</b></td>";
}
if ($rs['transaction_type'] == "Cancellation") {
echo "<td><b style='color:red;'>" . $rs['transaction_type'] . "</b></td>";
}
echo "<td>" . date("d-M-Y", strtotime($rs['payment_date'])) . "</td>
<td>$rs[payment_type]</td>
<th style='color:green;'>Rs. $rs[total_amt]</th>
</tr>";
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
<!--start main -->
<?php
include("footer.php");
?>
<script>
function confirmdelete() {
if (confirm("Are you sure you want to delete this record??") == true) {
return true;
} else {
return false;
}
}
</script>