forked from mishraadarsh602/contact_form
-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact.php
347 lines (330 loc) · 12.6 KB
/
contact.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
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
<?php
//adding header
require('top.php');
?>
<!-- Start Bradcaump area -->
<div class="ht__bradcaump__area" style="background: rgba(0, 0, 0, 0) url(images/bg/4.jpg) no-repeat scroll center center / cover ;">
<div class="ht__bradcaump__wrap">
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="bradcaump__inner">
<nav class="bradcaump-inner">
<a class="breadcrumb-item" href="index.html">Home</a>
<span class="brd-separetor"><i class="zmdi zmdi-chevron-right"></i></span>
<span class="breadcrumb-item active">Contact Us</span>
</nav>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- End Bradcaump area -->
<!-- Start Contact Area -->
<section class="htc__contact__area ptb--100 bg__white">
<div class="container">
<div class="row">
<div class="col-lg-7 col-md-6 col-sm-12 col-xs-12">
<div class="map-contacts--2">
<div id="googleMap"></div>
</div>
</div>
<div class="col-lg-5 col-md-6 col-sm-12 col-xs-12">
<h2 class="title__line--6">CONTACT US</h2>
<div class="address">
<div class="address__icon">
<i class="icon-location-pin icons"></i>
</div>
<div class="address__details">
<h2 class="ct__title">our address</h2>
<p>666 5th Ave New York, NY, United </p>
</div>
</div>
<div class="address">
<div class="address__icon">
<i class="icon-envelope icons"></i>
</div>
<div class="address__details">
<h2 class="ct__title">openning hour</h2>
<p>666 5th Ave New York, NY, United </p>
</div>
</div>
<div class="address">
<div class="address__icon">
<i class="icon-phone icons"></i>
</div>
<div class="address__details">
<h2 class="ct__title">Phone Number</h2>
<p>123-6586-587456</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="contact-form-wrap mt--60">
<div class="col-xs-12">
<div class="contact-title">
<h2 class="title__line--6">SEND A MAIL</h2>
</div>
</div>
<div class="col-xs-12">
<form id="contact-form" action="" method="post">
<div class="single-contact-form">
<div class="contact-box name">
<input type="text" id="name" name="name" placeholder="Your Name*">
<input type="email" id="email" name="email" placeholder="Email*">
<input type="text" id="mobile" name="mobile" placeholder="Mobile*">
</div>
</div>
<div class="single-contact-form">
<div class="contact-box message">
<textarea name="message" id="message" placeholder="Your Message"></textarea>
</div>
</div>
<div class="contact-btn">
<button type="button" onclick="send_message()" class="fv-btn">Send MESSAGE</button>
</div>
</form>
<div class="form-output">
<p class="form-messege"></p>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- End Contact Area -->
<!-- End Banner Area -->
<!-- Google Map js -->
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBmGmeot5jcjdaJTvfCmQPfzeoG_pABeWo "></script>
<script src="js/contact-map.js"></script>
<script>
// When the window has finished loading create our google map below
google.maps.event.addDomListener(window, 'load', init);
function init() {
// Basic options for a simple Google Map
// For more options see: https://developers.google.com/maps/documentation/javascript/reference#MapOptions
var mapOptions = {
// How zoomed in you want the map to start at (always required)
zoom: 12,
scrollwheel: false,
// The latitude and longitude to center the map (always required)
center: new google.maps.LatLng(23.7286, 90.3854), // New York
// How you would like to style the map.
// This is where you would paste any style found on Snazzy Maps.
styles:
[ {
"featureType": "all",
"elementType": "labels.text.fill",
"stylers": [
{
"saturation": 36
},
{
"color": "#000000"
},
{
"lightness": 40
}
]
},
{
"featureType": "all",
"elementType": "labels.text.stroke",
"stylers": [
{
"visibility": "on"
},
{
"color": "#000000"
},
{
"lightness": 16
}
]
},
{
"featureType": "all",
"elementType": "labels.icon",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "administrative",
"elementType": "geometry.fill",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 20
}
]
},
{
"featureType": "administrative",
"elementType": "geometry.stroke",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 17
},
{
"weight": 1.2
}
]
},
{
"featureType": "landscape",
"elementType": "geometry",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 20
}
]
},
{
"featureType": "poi",
"elementType": "geometry",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 21
}
]
},
{
"featureType": "road.highway",
"elementType": "geometry.fill",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 17
}
]
},
{
"featureType": "road.highway",
"elementType": "geometry.stroke",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 29
},
{
"weight": 0.2
}
]
},
{
"featureType": "road.arterial",
"elementType": "geometry",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 18
}
]
},
{
"featureType": "road.local",
"elementType": "geometry",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 16
}
]
},
{
"featureType": "transit",
"elementType": "geometry",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 19
}
]
},
{
"featureType": "water",
"elementType": "geometry",
"stylers": [
{
"color": "#141516"
},
{
"lightness": 17
}
]
}
]
};
// Get the HTML DOM element that will contain your map
// We are using a div with id="map" seen below in the <body>
var mapElement = document.getElementById('googleMap');
// Create the Google Map using our element and options defined above
var map = new google.maps.Map(mapElement, mapOptions);
// Let's also add a marker while we're at it
var marker = new google.maps.Marker({
position: new google.maps.LatLng(23.7286, 90.3854),
map: map,
title: 'Ramble!',
icon: 'images/icons/map-2.png',
animation:google.maps.Animation.BOUNCE
});
}
</script>
<script>
//send click listener button
function send_message(){
var name= jQuery("#name").val();
var email= jQuery("#email").val();
var mobile= jQuery("#mobile").val();
var message= jQuery("#message").val();
if(name==""){
alert('Please enter name');
} else if(email==""){
alert('Please enter email');
}else if(mobile==""){
alert('Please enter mobile');
} else if(message==""){
alert('Please enter message');
} else{
//sending data to backened using ajax
jQuery.ajax({
url:'send_message.php',
type:'post',
data:'name='+name+'&email='+email+'&mobile='+mobile+'&message='+message,
success:function(result){
alert(result);
}
})
}
}
</script>
<?php
//adding footer
require('footer.php');
?>