-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcontactform.php
More file actions
244 lines (205 loc) · 9.23 KB
/
contactform.php
File metadata and controls
244 lines (205 loc) · 9.23 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Dashboard">
<meta name="keyword" content="Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina">
<title>THE ENERGY HUB</title>
<!-- Favicons -->
<link href="img/favicon.jpg" rel="icon">
<!-- Bootstrap core CSS -->
<link href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!--external css-->
<link href="lib/font-awesome/css/font-awesome.css" rel="stylesheet" />
<!-- Custom styles for this template -->
<link href="css/style.css" rel="stylesheet">
<link href="css/style-responsive.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Acme&family=Kalam:wght@300;400;700&display=swap" rel="stylesheet">
<style>
body {
font-size: 16px;
font-family: 'Acme', sans-serif;
font-family: 'Kalam', cursive;
}
</style>
<body>
<section id="container">
<!-- **********************************************************************************************************************************************************
TOP BAR CONTENT & NOTIFICATIONS
*********************************************************************************************************************************************************** -->
<!--header start-->
<header class="header black-bg">
<div class="sidebar-toggle-box">
<div class="fa fa-bars tooltips" data-placement="right" data-original-title="Toggle Navigation"></div>
</div>
<!--logo start-->
<a href="home.php" class="logo"><b>THE ENERGY<span>HUB</span></b></a>
<!--logo end-->
<div class="top-menu">
<ul class="nav pull-right top-menu">
<li><a class="logout" href="index.php" style="font-size: 18px;">Logout</a></li>
</ul>
</div>
</header>
<!--header end-->
<!-- **********************************************************************************************************************************************************
MAIN SIDEBAR MENU
*********************************************************************************************************************************************************** -->
<!--sidebar start-->
<aside>
<div id="sidebar" class="nav-collapse ">
<!-- sidebar menu start-->
<ul class="sidebar-menu" id="nav-accordion">
<p class="centered"><a href="about.php"><img src="img/favicon.jpg" class="img-circle" width="80"></a></p>
<h5 class="centered" style="font-size: 16px;"> MORE ABOUT US?</h5>
<li class="mt">
<li class="sub-menu">
<a href="javascript:;">
<i class="fa fa-dashboard"></i>
<span style="font-size: 17px;">Dashboard</span>
</a>
<ul class="sub">
<li><a href="gallery.html" style="font-size: 14px;">Gallery</a></li>
<li><a href="pricing_table.html" style="font-size: 14px;">Pricing Table</a></li>
</ul>
</li>
</li>
<li class="sub-menu">
<a href="javascript:;">
<i class="fa fa-tasks"></i>
<span style="font-size: 17px;">Forms</span>
</a>
<ul class="sub">
<li><a href="TrainerForm.php" style="font-size: 14px;">Trainer Form</a></li>
<li><a href="MemberForm.php" style="font-size: 14px;">Member Form</a></li>
<li><a href="contactform.php" style="font-size: 14px;">Contact Form</a></li>
</ul>
</li>
<li class="sub-menu">
<a href="javascript:;">
<i class="fa fa-th"></i>
<span style="font-size: 17px;">Data Tables</span>
</a>
<ul class="sub">
<li><a href="General-table.php" style="font-size: 14px;">General</a></li>
<li><a href="Batch-n-Package.php" style="font-size: 14px;">Batches n Packages</a></li>
<li><a href="count.php" style="font-size: 14px;">Count</a></li>
<li><a href="Accounts.php" style="font-size: 14px;">Accounts</a></li>
</ul>
</li>
</ul>
<!-- sidebar menu end-->
</div>
</aside>
<!--sidebar end-->
<!-- **********************************************************************************************************************************************************
MAIN CONTENT
*********************************************************************************************************************************************************** -->
<!--main content start-->
<section id="main-content">
<section class="wrapper">
<h4 class="sent-notification"></h4>
<h3><i class="fa fa-angle-right"></i>CONTACT MEMBER</h3>
<!-- BASIC FORM ELELEMNTS -->
<div class="row mt">
<div class="col-lg-6 col-md-6 col-sm-6">
<h4 class="title">Contact Form</h4>
<div id="message"></div>
<form id="myForm" class="contact-form php-mail-form" role="form">
<div class="form-group">
<input id="name" type="name" name="name" class="form-control" placeholder="Enter Name" data-rule="minlen:4" data-msg="Please enter at least 4 chars" >
<div class="validate"></div>
</div>
<div class="form-group">
<input id="email" type="email" name="email" class="form-control" name="email" placeholder="Enter Email" data-rule="email" data-msg="Please enter a valid email">
<div class="validate"></div>
</div>
<div class="form-group">
<input id="subject" type="text" name="subject" class="form-control" placeholder="Subject" data-rule="minlen:4" data-msg="Please enter at least 8 chars of subject">
<div class="validate"></div>
</div>
<div class="form-group">
<textarea id="body" class="form-control" name="body" placeholder="Type Message" rows="5" data-rule="required" data-msg="Please write something for us"></textarea>
<div class="validate"></div>
</div>
<div class="form-send">
<button type="button" onclick="sendEmail()" value="Send An Email">SEND MAIL</button>
</div>
<!--<div class="loading"></div>
<div class="error-message"></div>
<div class="sent-message">Your message has been sent. Thank you!</div> -->
</form>
</div>
</div>
<!-- /row -->
<!-- /row -->
</section>
<!-- /wrapper -->
</section>
<!-- /MAIN CONTENT -->
<!--main content end-->
<section>
<!--footer start-->
<footer class="site-footer">
<div class="text-center">
<a href="contactform.php" class="go-top">
<i class="fa fa-angle-up"></i>
</a>
</div>
</footer>
<!--footer end-->
</section>
</section>
<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) && isNotEmpty(subject) && isNotEmpty(body)) {
$.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>
<!-- js placed at the end of the document so the pages load faster -->
<script src="lib/jquery/jquery.min.js"></script>
<script src="lib/bootstrap/js/bootstrap.min.js"></script>
<script class="include" type="text/javascript" src="lib/jquery.dcjqaccordion.2.7.js"></script>
<script src="lib/jquery.scrollTo.min.js"></script>
<script src="lib/jquery.nicescroll.js" type="text/javascript"></script>
<!--common script for all pages-->
<script src="lib/common-scripts.js"></script>
<!--script for this page-->
<script src="lib/jquery-ui-1.9.2.custom.min.js"></script>
<!--custom switch-->
<script src="lib/bootstrap-switch.js"></script>
<!--custom tagsinput-->
<script src="lib/jquery.tagsinput.js"></script>
<!--Contactform Validation-->
<script src="lib/php-mail-form/validate.js"></script>
</body>
</html>