-
Notifications
You must be signed in to change notification settings - Fork 0
/
pendingPayments.php
executable file
·189 lines (158 loc) · 5.08 KB
/
pendingPayments.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
<?php
session_start();
error_reporting(E_ERROR);
require 'dbconfig.php';
include 'functions2.php';
if (empty($_SESSION['username'])){
header('location:customerlogin.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<link rel="stylesheet" href="css/bootstrap.min.css" />
<!-- sweet alert -->
<link rel="stylesheet" href="css/sweetalert.css">
<script src="js/sweetalert.js"></script>
<script src="js/jquery.js"></script>
<!-- FontAwesome -->
<link rel="stylesheet" href="css/all.min.css" />
<link rel="stylesheet" href="css/fontawesome.min.css" />
<!--Animate Css-->
<link rel="stylesheet" href="css/animate.min.css" />
<!-- Css -->
<link rel="stylesheet" href="css/pendingpayments.css" />
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Pending Payments for Approval.</title>
</head>
<body>
<main>
<section class="mainbody">
<header id="heady">
<nav class="navbar navbar-expand-md navbar-light bg-transparent mb-4">
<a id="logo" href="customerDashBoard.php" class="navbar-brand"
><img src="img/logo.png" alt="" ALIGN="CENTER"
/></a>
<button
type="button"
class="navbar-toggler"
data-toggle="collapse"
data-target="#navbarCollapse"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<div class="navbar-nav">
<li class="nav-item active">
<a class="nav-link active" id="hmu" href="customerDashBoard.php">DashBoard</a>
</li>
<li class="nav-item">
<a class="nav-link " id="hmu" href="bookingHistory.php">Booking History</a>
</li>
<li class="nav-item">
<a class="nav-link " id="hmu" href="customerEdit.php">Edit Profile</a>
</li>
<li class="nav-item">
<a class="nav-link " id="hmu" href="messages.php" class="">Messages.</a>
</li>
</div>
<a href="customerlogout.php" class="btn bttn btn-outline-danger ml-auto">Sign Out </a>
</div>
</nav>
</header>
<h1 class="title">Pending Approval Requests.</h1>
</section>
<section id="jumbo" class="jumbotron text-center">
<div class="container">
<h3 class="text-warning" style="text-decoration: underline;">Please Customer Take part in approving your payments to Mafundi Sacco to ensure we serve you better</h3>
<?php
$query="SELECT * FROM bookings AS b INNER JOIN partialpayments AS p ON b.phone=p.phone WHERE b.username='".$_SESSION['username']."' ORDER BY p.phone DESC ";
// $query = "SELECT * FROM `partialpayments`;";
if(count(fetchAll($query)) > 0){
foreach(fetchAll($query) as $row){
?>
<p class="lead text-light"><?php echo 'Hello, I am a technician with Mafundi Service, Hope Your Would not Mind To Approve The payment.'; ?></p>
<h1 class="jumbotron-heading text-success"><?php echo $row['service']; ?></h1>
<h3 class="jumbotron-heading text-success">Ksh <?php echo $row['amount']; ?></h3>
<small> <?php echo $row['date']; ?></small>
<br><br>
<a href="acceptpayments.php?id=<?php echo $row['id'];?>" class="btn pay btn-success my-2">Approve Payment</a>
<a href="rejectpayments.php?id=<?php echo $row['id'];?>" class="btn pay btn-danger my-2">Reject Payment</a>
<br>
<?php
}
}else{
echo 'No pending requests';
}
?>
</div>
</section>
<div id="printableArea" class="col-lg-12 col-md-12">
<h4 style="text-align: center; text-decoration: underline;"><img src="img/logo.png" alt="" ALIGN="CENTER"
/>My Payments.</h4>
<hr/>
<?php
require_once "dbconfig.php";
$cart="SELECT * FROM approvedpayments AS a INNER JOIN bookings AS b ON a.service=b.service WHERE b.username='".$_SESSION['username']."' ORDER BY a.phone DESC ";
$query=mysqli_query($conn,$cart);
?>
<table class="table table-bordered" id="mytable2">
<thead>
<tr>
<th>Id</th>
<th>Phone Number</th>
<th>Service Ordered</th>
<th>Mpesa Code</th>
<th>Amount</th>
<th>Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
</tbody>
<?php
if(mysqli_num_rows($query) > 0)
{
while ($row = mysqli_fetch_assoc($query)){
?>
<tr>
<td><?php echo $row['pend_id']; ?></td>
<td><?php echo $row['phone']; ?></td>
<td> <?php echo $row['service']; ?></td>
<td> <?php echo $row['mpesa']; ?></td>
<td><?php echo $row['amount']; ?></td>
<td><?php echo $row['date']; ?></td>
<td>
<a href="individualPayment.php" class="text-light lead"> More... </a>
</td>
</tr>
<?php
}}else{
echo "No record was found";
}
?>
</tbody>
</table>
</div>
<div style="text-align: right; padding-top: 10px;">
<a href="#"><h4><span class="printer" style="color: #fff;" onclick="printDiv('printableArea')"><i class="fas fa-print"></i> Print Report.</h4></span></a>
</div>
</main>
<!-- PRINTING SCRIPT -->
<script>
function printDiv(divName) {
var printContents = document.getElementById(divName).innerHTML;
var originalContents = document.body.innerHTML;
document.body.innerHTML = printContents;
window.print();
document.body.innerHTML = originalContents;
}
</script>
<!-- END OF PRINTING SCRIPT -->
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/jquery-3.4.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>