-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact.php
178 lines (149 loc) Β· 7.69 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<link href="css/thiss.css" rel="stylesheet">
<link href="http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Josefin+Slab:100,300,400,600,700,100italic,300italic,400italic,600italic,700italic" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css2?family=Lobster&display=swap" rel="stylesheet">
<script type="text/javascript">
$(document).ready(function () {
$("#contact").click(function () {
fname = $("#fname").val();
email = $("#email").val();
message = $("#message").val();
$.ajax({
type: "POST",
url: "sendmsg.php",
data: "fname=" + fname + "&email=" + email + "&message=" + message,
success: function (html) {
if (html == 'true') {
$("#add_err2").html('<div class="alert alert-success"> \
<strong>Message Sent!</strong> \ \
</div>');
} else if (html == 'fname_long') {
$("#add_err2").html('<div class="alert alert-danger"> \
<strong>First Name</strong> must cannot exceed 50 characters. \ \
</div>');
} else if (html == 'fname_short') {
$("#add_err2").html('<div class="alert alert-danger"> \
<strong>First Name</strong> must exceed 2 characters. \ \
</div>');
} else if (html == 'email_long') {
$("#add_err2").html('<div class="alert alert-danger"> \
<strong>Email</strong> must cannot exceed 50 characters. \ \
</div>');
} else if (html == 'email_short') {
$("#add_err2").html('<div class="alert alert-danger"> \
<strong>Email</strong> must exceed 2 characters. \ \
</div>');
} else if (html == 'eformat') {
$("#add_err2").html('<div class="alert alert-danger"> \
<strong>Email</strong> format incorrect. \ \
</div>');
} else if (html == 'message_long') {
$("#add_err2").html('<div class="alert alert-danger"> \
<strong>Message</strong> must cannot exceed 50 characters. \ \
</div>');
} else if (html == 'message_short') {
$("#add_err2").html('<div class="alert alert-danger"> \
<strong>Message</strong> must exceed 2 characters. \ \
</div>');
} else {
$("#add_err2").html('<div class="alert alert-danger"> \
<strong>Error'+html+'</strong> processing request. Please try again. \ \
</div>');
}
},
beforeSend: function () {
$("#add_err2").html("loading...");
}
});
return false;
});
});
</script>
</head>
<body>
<!-- Navigation -->
<?php require_once 'nav.php'; ?>
<div class="container">
<div class="row">
<div class="box">
<div class="col-lg-12">
<hr>
<h2 class="intro-text text-center">Contact
<strong>The Cafeteria</strong>
</h2>
<hr>
</div>
<div class="col-md-8">
<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d1721.195294607377!2d76.7991745!3d30.3682649!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x390fc9bbd8086c01%3A0x8635bd54eda0725f!2sJaggi%20city%20center!5e0!3m2!1sen!2sin!4v1610215683752!5m2!1sen!2sin" width="100%" height="400" frameborder="0" style="border:0" allowfullscreen></iframe>
</div>
<div class="col-md-4">
<p>Phone:
<strong>123.456.7890</strong>
</p>
<p>Email:
<strong><a href="mailto:infothecafeteria@gmail.com">infothecafeteria@gmail.com</a></strong>
</p>
<p>Address:
<strong>123 JUGGY CITY CENTRE
<br>AMBALA CANTT, HR 90210</strong>
</p>
</div>
<div class="clearfix"></div>
</div>
</div>
<div class="row">
<div class="box">
<div class="col-lg-12">
<hr>
<h2 class="intro-text text-center">Contact
<strong>form</strong>
</h2>
<hr>
<div id="add_err2"></div>
<form role="form">
<div class="row">
<div class="form-group col-lg-4">
<label>Name</label>
<input type="text" id="fname" name="fname" maxlength="25" class="form-control">
</div>
<div class="form-group col-lg-4">
<label>Email Address</label>
<input type="email" id="email" name="email" maxlength="25" class="form-control">
</div>
<div class="clearfix"></div>
<div class="form-group col-lg-12">
<label>Message</label>
<textarea class="form-control" id="message" name="message" maxlength="100" rows="6"></textarea>
</div>
<div class="form-group col-lg-12">
<button type="submit" id="contact" class="btn btn-default">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- /.container -->
<footer>
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<p>Copyright © The Perfect Cup 2016</p>
</div>
</div>
</div>
</footer>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>