-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact.php
153 lines (130 loc) · 4.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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<link rel="icon" href="images/logo1.png" type="image/icon tye">
<title>Contact Us</title>
<link rel="stylesheet" type="text/css" href="css/contact.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="fontswesome/css/all.css">
<!------------- Bootstarp Links --------------->
<link rel="stylesheet" type="text/css" href="libraries1/bootstrap.min.css">
<script type="text/javascript" src="libraries1/popper.min.js"></script>
<script type="text/javascript" src="libraries1/bootstrap.min.js"></script>
</head>
<body>
<div class="back-image">
<!-------------------- Header start ------------------->
<?php include "common/headers.php" ?>
<!-------------------- Header END ------------------->
<!-------------------- banner start ------------------->
<div class="banner-text">
Contact Us
</div>
<div class="banner-text01">
<p>Do you have any questions? Please do not hesitate to contact us directly. Our team will come back to you within a matter of hours to help you.</p>
</div>
</div>
<!-------------------- banner end ------------------->
<!-------------------- Contact-form start ------------------->
<form class="my-form" action=" " id="myForm" method="post" autocomplete="off">
<div class="container mt-5">
<h1>Get in touch!</h1>
<ul>
<li>
<div class="grid grid-2">
<input type="text" name="contact_username" placeholder="Full Name" id="name" class="name" required>
<input type="email" name="contact_email" placeholder="Email" id="email" class="email" required>
</div>
</li>
<li>
<div class="grid grid-2">
<input type="tel" name="contact_phone" placeholder="Phone" id="subject" class="phone">
<input type="tel" name="contact_whatsapp" placeholder="Whatsapp No" id="whatsapp" class="whatsapp">
</div>
</li>
<li>
<textarea name="contact_msg" placeholder="Message" id="body" class="message"></textarea>
</li>
<li>
<div class="grid grid-3">
<button class="btn-grid bttn" type="submit" name="submit" onclick="sendEmail()" value="Send An Email"/>
<span class="back">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/email-icon.svg" alt="">
</span>
<span class="front">SUBMIT</span>
</button>
<h5 class="sent-notification" style="color:black;"></h5>
</div>
</li>
</ul>
</div>
</form>
<!-------------------- Contact-form END ------------------->
<!-------------------- Footer start ------------------->
<?php include "common/footer.php" ?>
<!-------------------- Footer END ------------------->
</body>
</html>
<script src="http://code.jquery.com/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
function sendEmail() {
var name = $("#name");
var email = $("#email");
var subject = $("#subject");
var body = $("#body");
if (isNotEmpty(name) && isNotEmpty(email)) {
$.ajax({
url: 'sendEmail.php',
method: 'POST',
dataType: 'json',
data: {
name: name.val(),
email: email.val(),
subject: subject.val(),
body: body.val()
},
success: function (response) {
$('#myForm')[0].reset();
$('.sent-notification').text("Message Sent Successfully.");
}
});
}
}
function isNotEmpty(caller) {
if (caller.val() == "") {
caller.css('border', '1px solid red');
return false;
} else
caller.css('border', '');
return true;
}
</script>
<script>
$(document).ready(function () {
$('.bttn').click(function (e) {
e.preventDefault();
var username = $('.name').val();
var useremail = $('.email').val();
var userphone = $('.phone').val();
var userwhatsapp = $('.whatsapp').val();
var usermsg = $('.message').val();
if(username != '' & useremail !='')
{
$.ajax({
type: "POST",
data: {
'checking_add':true,
'contact_username': username,
'contact_email': useremail,
'contact_phone': userphone,
'contact_whatsapp': userwhatsapp,
'contact_msg': usermsg,
},
success: function (response) {
}
});
}
});
});
</script>