-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdonations.php
213 lines (174 loc) · 6.11 KB
/
donations.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
<?php
session_start();
include 'common/connect.php';
//session code
if(!isset($_SESSION['user_id']))
{
header('location:home.php');
}
//finish
$cat = $obj->query("select * from category");
$city = $obj->query("select * from city");
$area = $obj->query("select * from area");
if (isset($_POST['submit'])) {
# code...
$title = $_POST['title'];
$desc = $_POST['desc'];
$cat_id = $_POST['cat_id'];
$dob = $_POST['date'];
$address = $_POST['add'];
$city_id = $_POST['city_id'];
$area_id = $_POST['area_id'];
$status = 'pending';
$time = $_POST['dtime'];
$etime = $_POST['etime'];
$c_name = $_POST['c_name'];
$c_num = $_POST['c_number'];
$user_id = $_SESSION['user_id'];
$exe = $obj->query("INSERT INTO donation(title,description,cat_id,donation_date,address,city_id,area_id,status,fromtime,user_id,contact_name,contact_number,totime)VALUES('$title','$desc',$cat_id,'$dob','$address',$city_id,$area_id,'$status','$time',$user_id,'$c_name','$c_num','$etime')");
if($exe){
echo "<script>alert('donation request send Successfullly');</script>";
}
else {
echo "<script>alert(' error');</script>";
}
}
?>
<!--
Author: W3layouts
Author URL: http://w3layouts.com
-->
<!doctype html>
<html lang="zxx">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Helping-Hand(NGO)
</title>
<!-- Template CSS -->
<link rel="stylesheet" href="assets/css/style-starter.css">
<!-- Template CSS -->
<link href="//fonts.googleapis.com/css?family=Poppins:300,400,400i,500,600,700&display=swap" rel="stylesheet">
<!-- Template CSS -->
</head>
<body>
<!--w3l-header-->
<?php include 'common/header.php'; ?>
<!--/header-->
<div class="inner-banner">
</div>
<!-- /donation-form -->
<section class="w3l-contact-11">
<div class="form-41-mian py-5">
<div class="container py-lg-4">
<div class="row align-form-map">
<div class="col-lg-6 contact-left pr-lg-4">
</div>
<div class="col-lg-12 form-inner-cont">
<div class="title-content text-left">
<h3 class="hny-title mb-lg-5 mb-4">Please Donate</h3>
</div>
<form method="post" class="signin-form">
<div class="container">
<div class="col-lg-10 form-input">
<input type="text" name="title" id="title" placeholder="title" required="" />
<textarea name="desc" id="desc" placeholder="description"></textarea>
<input type="text" name="c_name" id="c_name" placeholder="Contact Name" required="" />
<input type="text" name="c_number" id="c_number" placeholder="Contact Number" required="" />
<select class="form-control" id="cat_id" name="cat_id">
<option value="">--Select category--</option>
<?php
while($ca = $cat->fetch_object())
{
?>
<option value="<?php echo $ca->cat_id;?>"><?php echo $ca->cat_name;?></option>
<?php
}
?>
</select>
<br>
<textarea name="add" id="add" placeholder="Address"></textarea>
<select class="form-control" id="city_id" name="city_id">
<option value="">--Select city--</option>
<?php
while($ci = $city->fetch_object())
{
?>
<option value="<?php echo $ci->city_id;?>"><?php echo $ci->city_name;?></option>
<?php
}
?>
</select>
<br>
<select class="form-control" id="area_id" name="area_id">
<option value="">--Select area--</option>
<?php
while($a = $area->fetch_object())
{
?>
<option value="<?php echo $a->area_id;?>"><?php echo $a->area_name;?></option>
<?php
}
?>
</select>
<br>
<input type="date" name="date" id="date" placeholder="Date" required="" />
<label for="dtime">From time</label>
<input type="time" name="dtime" id="dtime" placeholder="Starttime" required="" />
<label for="etime">To time</label>
<input type="time" name="etime" id="etime" placeholder="Endtime" required="" />
</div>
<div class="submit-button text-lg-center">
<button type="submit" class="btn btn-style" name="submit" id="submit">Submit</button>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
<!-- //contact-form -->
<!-- footer-66 -->
<?php include 'common/footer.php'; ?>
<!--//footer-66 -->
</body>
</html>
<script src="assets/js/jquery-3.3.1.min.js"></script>
<!-- disable body scroll which navbar is in active -->
<!-- disable body scroll which navbar is in active -->
<script>
$(function () {
$('.navbar-toggler').click(function () {
$('body').toggleClass('noscroll');
})
});
</script>
<!-- disable body scroll which navbar is in active -->
<!--/MENU-JS-->
<script>
$(window).on("scroll", function () {
var scroll = $(window).scrollTop();
if (scroll >= 80) {
$("#site-header").addClass("nav-fixed");
} else {
$("#site-header").removeClass("nav-fixed");
}
});
//Main navigation Active Class Add Remove
$(".navbar-toggler").on("click", function () {
$("header").toggleClass("active");
});
$(document).on("ready", function () {
if ($(window).width() > 991) {
$("header").removeClass("active");
}
$(window).on("resize", function () {
if ($(window).width() > 991) {
$("header").removeClass("active");
}
});
});
</script>
<!--//MENU-JS-->
<script src="assets/js/bootstrap.min.js"></script>