-
Notifications
You must be signed in to change notification settings - Fork 0
/
addup.php
328 lines (294 loc) · 8.95 KB
/
addup.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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
<?php session_start();
include('indexDB.php');
$loc = $city = $date = "";
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
$locErr = $cityErr = $dateErr = "";
$b=true;
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (empty($_POST["loc"])) {
$locErr = "*Location is required";
$b=false;
} else {
$loc = test_input($_POST["loc"]);
if (!preg_match("/^[a-zA-Z_ ]*$/",$loc) || $loc=='') {
$locErr = "*Only letters allowed";
$b=false;
}
}
if (empty($_POST["city"])) {
$cityErr = "*City is required";
$b=false;
} else {
$city = test_input($_POST["city"]);
if (!preg_match("/^[a-zA-Z]*$/",$city) || $city=='') {
$cityErr = "*Only letters allowed";
$b=false;
}
}
if (empty($_POST["date"])) {
$dateErr = "*Date is required";
$b=false;
} else {
$date = test_input($_POST["date"]);
if(!preg_match("/^[0-9]{1,2}$/",$date) || $date==''){
$dateErr = "*Enter only Numbers";
$b=false;
}
}
}
if($b==true && isset($_POST['submit']))
{
$sql = "insert into upcoming_projects(bid,location,city,comp_time) values('".$_SESSION['id']."','$loc','$city','$date')";
$res=$conn->query($sql);
$row= mysqli_fetch_array($res,MYSQLI_ASSOC);
header('Location: builderHome.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>HOUSING-CO</title>
<meta charset="UTF-8">
<meta name="description" content="HOUSING-CO">
<meta name="keywords" content="LERAMIZ, unica, creative, html">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Favicon -->
<link href="img/favicon.ico" rel="shortcut icon"/>
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet">
<!-- Stylesheets -->
<link rel="stylesheet" href="css/bootstrap.min.css"/>
<link rel="stylesheet" href="css/font-awesome.min.css"/>
<link rel="stylesheet" href="css/animate.css"/>
<link rel="stylesheet" href="css/owl.carousel.css"/>
<link rel="stylesheet" href="css/style.css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="Styles.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Page Preloder -->
<!-- Header section -->
<header class="header-section">
<div class="header-top">
<div class="container">
<div class="row">
<div class="col-lg-6 header-top-left">
</div>
<div class="col-lg-6 text-lg-right header-top-right">
<div class="top-social">
<a href="https://www.facebook.com/"><i class="fa fa-facebook"></i></a>
<a href="https://www.twitter.com/"><i class="fa fa-twitter"></i></a>
<a href="https://www.instagram.com/"><i class="fa fa-instagram"></i></a>
<a href="https://www.pinterest.com/"><i class="fa fa-pinterest"></i></a>
<a href="https://www.linkedin.com/"><i class="fa fa-linkedin"></i></a>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-12">
<div class="site-navbar">
<a href="index.html" class="site-logo"><img src="img/logo1.png" alt=""></a>
<div class="nav-switch">
<i class="fa fa-bars"></i>
</div>
<ul class="main-menu">
<?php
if($_SESSION['type']=='builder')
{
echo "<li><a href='builderHome.php'>Home</a></li>";
}
else
{
echo "<li><a href='normalHomeSale.php'>Home</a></li>";
}
?>
<li><a href="upcomingprojects.php">My Upcoming Projects</a></li>
<li><a href="PackersAndMovers.php">Packers and Movers</a></li>
</ul>
</div>
</div>
</div>
</div>
</header>
<!-- Header section end -->
<style type="text/css">
body{
background-repeat:no-repeat;
background-image:url("img/service-bg.jpg");
background-size:cover;
background-attachment:fixed;
color:white;
}
input[type=text],input[type=date],input[type=password] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
box-sizing: border-box;
background-color: #e0e0d1;
color:black;
}
input[type=submit], input[type=reset] {
background-color: #e0e0d1;
border: none;
color: black;
padding: 16px 32px;
text-decoration: none;
margin: 4px 2px;
cursor: pointer;
font-weight:bold;
}
input[type=radio] {
height: 15px;
width: 15px;
}
select {
background-color: #e0e0d1;
border: none;
color: black;
padding: 16px 32px;
text-decoration: none;
margin: 4px 2px;
cursor: pointer;
font-weight:bold;
}
textarea {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
box-sizing: border-box;
background-color:#e0e0d1;
color:black;
}
table{
background-color:black;
border-collapse: collapse;
border: 2px solid navy;
}
form{
opacity:0.7;
}
td{
font-weight:bold;
}
span
{
color:red;
}
</style>
</head>
<br><br><br><br><br><br><br><br><br><br><br>
<form id="form" method="post" action="addup.php" >
<table cellpadding="7" width="50%" border="0" align="center"cellspacing="2" color="white">
<!-- I want another button here, center to the tile-->
<tr>
<td colspan=2>
<center><img src="img/logo1.png"></img></center>
</td>
</tr>
<tr>
<td colspan=2>
<center><font size=5><b>REGISTER</b></font></center>
</td>
</tr>
<tr>
<td><b>Location:</b></td>
<td><input type="text" name="loc" size="30">
<span class="error"><?php echo $locErr; ?></span>
<br><br>
</td>
</tr>
<tr>
<td><b>City:</b></td>
<td><input type="text" name="city" size="30">
<span class="error"><?php echo $cityErr; ?></span>
<br><br>
</td>
</tr>
<tr>
<td><b>Completion Date:</b></td>
<td><input type="text" name="date" placeholder="Months" size="30">
<span class="error"><?php echo $dateErr; ?></span>
<br><br>
</td>
</tr>
<tr>
<td><input type="reset" value="Reset"></td>
<td><input type="submit" value="Register" name="submit">
<div style = "font-size:20px; color:#cc0000; margin-top:10px"></div>
</td>
</tr>
</table>
<br><br><br><br><br><br><br><br><br><br>
</form>
<footer class="footer-section set-bg" data-setbg="img/footer-bg.jpg">
<div class="container">
<div class="row">
<div class="col-lg-3 col-md-6 footer-widget">
<img src="img/logo1.png" alt="">
<p>We provide you with the best services which is best for your family and which suits your pocket.</p>
<div class="social">
<a href="https://www.facebook.com/"><i class="fa fa-facebook"></i></a>
<a href="https://www.twitter.com/"><i class="fa fa-twitter"></i></a>
<a href="https://www.instagram.com/"><i class="fa fa-instagram"></i></a>
<a href="https://www.pinterest.com/"><i class="fa fa-pinterest"></i></a>
</div>
</div>
<div class="col-lg-3 col-md-6 footer-widget">
<div class="contact-widget">
<h5 class="fw-title">CONTACT US</h5>
<p><i class="fa fa-map-marker"></i>You can contact us here...... </p>
<p><i class="fa fa-phone"></i>Number</p>
<p><i class="fa fa-envelope"></i>info.housing-co@gmail.com</p>
<p><i class="fa fa-clock-o"></i>Mon - Sat, 08 AM - 06 PM</p>
</div>
</div>
<div class="col-lg-3 col-md-6 footer-widget">
<div class="double-menu-widget">
<h5 class="fw-title">POPULAR PLACES</h5>
<ul>
<li><a href="">Mumbai</a></li>
<li><a href="">Delhi</a></li>
<li><a href="">Chennai</a></li>
<li><a href="">Kolkata</a></li>
<li><a href="">Banglore</a></li>
</ul>
<ul>
<li><a href="">Chandigarh</a></li>
<li><a href="">Pune</a></li>
<li><a href="">Jaipur</a></li>
<li><a href="">Kochi</a></li>
<li><a href="">Ooty</a></li>
</ul>
</div>
</div>
<div class="col-lg-3 col-md-6 footer-widget">
<div class="newslatter-widget">
<h5 class="fw-title">NEWSLETTER</h5>
<p>Subscribe your email to get the latest news and new offer also discount</p>
<form class="footer-newslatter-form">
<input type="text" placeholder="Email address">
<button><i class="fa fa-send"></i></button>
</form>
</div>
</div>
</div>
</div>
</footer>
</body>
</html>