-
Notifications
You must be signed in to change notification settings - Fork 4
/
create-donation.php
213 lines (158 loc) · 6.08 KB
/
create-donation.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
<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";
}
$mail=$_SESSION['email'];
//Flash Message
$message="";
if(isset($dbh)){
//connection check
if(isset($_POST['submit'])){
$stmt = $dbh->prepare("INSERT INTO `donation_request`(`name`,`nidno`,`description`,`donationamount`,`moneytransfermethod`) VALUES (:name, :nidno, :description,:donationamount,:moneytransfermethod)");
//bindParam
//$stmt->bindParam(':date', $date);
$stmt->bindParam(':name', $name);
$stmt->bindParam(':nidno', $nidno);
$stmt->bindParam(':description', $description);
$stmt->bindParam(':donationamount', $donationamount);
$stmt->bindParam(':moneytransfermethod', $moneytransfermethod);
//$doc_type= $_POST['date'];
$name = $_POST['name'];
$nidno = $_POST['nidno'];
$description = $_POST['description'];
$donationamount= $_POST['donationamount'];
$moneytransfermethod = $_POST['moneytransfermethod'];
//This variable data has been assigned by us
if($stmt->execute()){
$message="Insert Row Succcess!";
header("Location:create-donation.php");
}
else{
$message="Insert Row Failed!";
}
}
}
include_once('include/header.php');
include_once('include/user-sidebar.php');
?>
<?php
session_start();
require_once('sql.php');
if(strlen($_SESSION['email'])==0)
{
header('location:login.php');
}
else{
$_SESSION['email'];
$eamil=$_SESSION['email'];
$result = mysqli_query($conn,"SELECT * FROM user_helth_status Where email='$eamil'");
if (mysqli_num_rows($result) > 0) {
$i=0;
$row = mysqli_fetch_array($result);
}
else{
echo "No result found";
}
?>
<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="col-md-6 m-auto">
<div class="tile">
<h3 class="tile-title">Request For Donation </h3>
<div class="tile-body">
<form action="create-donation.php" method="post" class="form-horizontal" enctype="multipart/form-data">
<div class="form-group">
<label class="control-label">Name:<span class="text-danger">*</span></label>
<input type="name" name="name" id="name" class="form-control" placeholder="Name" autocomplete="off">
</div>
<div class="form-group">
<label class="control-label">NID No:<span class="text-danger">*</span></label>
<input type="nid_no" name="nidno" id="nid" class="form-control" placeholder="NID number" autocomplete="off">
</div>
<div class="form-group">
<label class="control-label">Description:<span class="text-danger">*</span></label>
<input type="description" name="description" id="" class="form-control" placeholder="Describe something..." autocomplete="off">
</div>
<div class="form-group">
<label class="control-label">Donation Amount(৳):<span class="text-danger">*</span></label>
<input type="donationamount" name="donationamount" id="" class="form-control" placeholder="Donation amount (৳)..." autocomplete="off">
</div>
<div class="form-group">
<label class="control-label text-dark" > Money Transfer Method: <span class="text-danger">*</span></label>
<select id="moneytransfermethod" name="moneytransfermethod" class="form-control">
<option value="Cash">Cash</option>
<option value="Check">Check</option>
<option value="Credit Card">Credit Card</option>
<option value="Mobile Banking">Mobile Banking</option>
</select>
</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>Submit Donation Request</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('#nid', 'regex:^[0-9]+$:Enter valid NID!' );
bootstrapValidate('#nid', 'min:10:NID number must be 10 digit!' );
</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>
<?php
include_once('include/footer.php');
// include_once('include/Hfooter.php');
}
}
?>