-
Notifications
You must be signed in to change notification settings - Fork 4
/
user-payment.php
224 lines (178 loc) · 7.02 KB
/
user-payment.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
<head>
<title>User Dashboard | Healing Infirmary</title>
<link rel="icon" href="assets/img/mlogo.png">
</head>
<?php
session_start();
include('include/conn.php');
include_once('sql.php');
if(strlen($_SESSION['email'])==0)
{
header('location:login.php');
}
else{
$_SESSION['email'];
$eamil=$_SESSION['email'];
$result = mysqli_query($conn,"SELECT * FROM users Where email='$eamil'");
if (mysqli_num_rows($result) > 0) {
$i=0;
$row = mysqli_fetch_array($result);
}
else{
echo "No result found";
}
include_once('include/header.php');
include_once('include/user-sidebar.php');
?>
<?php
//session_start();
include('include/conn.php');
include_once('sql.php');
//Flash Message
$message="";
if(isset($dbh)){
//connection check
if(isset($_POST['submit'])){
$stmt = $dbh->prepare("INSERT INTO `user_payment`(`name`,`feename`,`tranxid`,`additionalinfo`,`lastthreedigit`,`date`) VALUES (:name,:feename,:tranxid,:additionalinfo,:lastthreedigit,:date)");
//bindParam
//$stmt->bindParam(':date', $date);
$stmt->bindParam(':name', $name);
$stmt->bindParam(':feename', $feename);
$stmt->bindParam(':tranxid', $tranxid);
$stmt->bindParam(':additionalinfo', $additionalinfo);
$stmt->bindParam(':lastthreedigit', $lastthreedigit);
$stmt->bindParam(':date', $date);
//$doc_type= $_POST['date'];
$name = $_POST['name'];
$feename = $_POST['feename'];
$tranxid = $_POST['tranxid'];
$additionalinfo = $_POST['additionalinfo'];
$lastthreedigit = $_POST['lastthreedigit'];
$date= $_POST['date'];
//This variable data has been assigned by us
if($stmt->execute()){
$message="Insert Row Success";
header("Location:user-payment.php");
}
else{
$message="Insert Row Failed!";
}
}
}
?>
<main class="app-content">
<div class="app-title">
<div>
<h1><i class="fa fa-dashboard"></i> User Dashboard</h1>
<p></p>
</div>
<ul class="app-breadcrumb breadcrumb">
<li class="breadcrumb-item"><i class="fa fa-home fa-lg"></i></li>
<li class="breadcrumb-item"><a href="#">Dashboard</a></li>
</ul>
</div>
<div class="row">
<div class="col-md-6 m-auto">
<div class="tile">
<h3 class="tile-title">Payment</h3>
<div class="row">
<div class="col-md-12">
<div class="tile">
<div class="tile-body">
<div class="table-responsive">
<table class="table table-hover table-bordered" id="sampleTable">
<thead>
<tr>
<td>Doctor Appointment Fee</td>
<td>Ambulance Fee</td>
<td>Bkash Merchant Number</td>
<td>Nagad Merchant Number</td>
</tr>
</thead>
<tbody>
<tr>
<td><h5>500 Taka</h5></td>
<td><h5>400 Taka</h5></td>
<td><h5>01848694959</h5></td>
<td><h5>01749594757</h5></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="tile-body">
<form action="user-payment.php" method="post" class="form-horizontal" enctype="multipart/form-data">
<label class="control-label">Name:<span class="text-danger">*</span></label>
<input type="text" name="name" id="name" class="form-control" placeholder="Name" autocomplete="off">
</div>
<div class="form-group">
<label class="control-label text-dark" > Fee Name: <span class="text-danger">*</span></label>
<select id="feename" name="feename" class="form-control">
<option value="Doctor Appointment Fee">Doctor Appointment Fee</option>
<option value="Ambulance Fee">Ambulance Fee</option>
<option value="Doctor Appointment and Ambulance Fee">Doctor Appointment and Ambulance Fee</option>
</select>
</div>
<div class="form-group">
<label class="control-label">Transaction ID:<span class="text-danger">*</span></label>
<input type="text" name="tranxid" id="tranxid" class="form-control" placeholder="Transaction ID" autocomplete="off">
<span id='message'></span>
</div>
<div class="form-group">
<label class="control-label">Additional Info: <span class="text-danger">*</span></label>
<input type="text" name="additionalinfo" rows="10" cols="50" class="form-control" placeholder="Write your addtional info here (If needed)">
</div>
<div class="form-group">
<label class="control-label">Last Three Digit: <span class="text-danger">*</span></label>
<input type="text" name="lastthreedigit" id="threedigit" rows="10" cols="50" class="form-control" placeholder="Last the three digit of your phone number!">
</div>
<div class="form-group">
<label class="control-label">Date: <span class="text-danger">*</span></label>
<input type="date" name="date" rows="10" cols="50" class="form-control" placeholder="">
</div>
<div class="form-group btn-container">
<button class="btn btn-primary btn-block" type="submit" name="submit" value="submit"><i class="fa fa-sign-in fa-lg fa-fw"></i>Send Payment</button>
</div>
</form>
</div>
</div>
</div>
<!-- =================================== JS VALIDATION START ========================================== -->
<script src="https://cdn.rawgit.com/PascaleBeier/bootstrap-validate/v2.2.0/dist/bootstrap-validate.js" ></script>
<script>
// bootstrapvalidate('#temperature','min:2:Enter at least 2 character');
bootstrapValidate('#name', 'regex:^[A-z]+$:Must enter character!' );
bootstrapValidate('#tranxid', 'min:10:Enter valid transaction id!' );
bootstrapValidate('#threedigit', 'regex:^[0-9]+$:Enter valid last three digit of your mobile number!' );
bootstrapValidate('#threedigit', 'min:3:Enter last three digit of your mobile number!' );
</script>
<!-- =================================== JS VALIDATION START ========================================== -->
</section>
<!-- Essential javascripts for application to work-->
<script src="assets/js/jquery-3.3.1.min.js"></script>
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> -->
<script src="assets/js/popper.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/main.js"></script>
<!-- The javascript plugin to display page loading on top-->
<script src="assets/js/plugins/pace.min.js"></script>
<script>
$(document).ready(function(){
$('#password, #confirmpassword').on('keyup', function () {
if ($('#password').val() == $('#confirmpassword').val()) {
$('#message').html('Matching').css('color', 'green');
} else
$('#message').html('Not Matching').css('color', 'red');
});
});
</script>
</body>
</main>
<?php
include_once('include/footer.php');
//include_once('include/Hfooter.php');
}
?>