-
Notifications
You must be signed in to change notification settings - Fork 0
/
registration.html
180 lines (173 loc) · 7.85 KB
/
registration.html
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
<!DOCTYPE html>
<html>
<head>
<title>Form 1 (Booking)</title>
<link rel="stylesheet" href="form.css" >
</head>
<body>
<div class="testbox">
<form method="post" name="google-sheet">
<div class="banner">
<h1>Cafe Booking Form-gatherings-frist room</h1>
</div>
<br/>
<fieldset>
<legend>Reservation Details</legend>
<div class="columns">
<div class="item">
<label for="fname">First Name<span>*</span></label>
<input id="fname" type="text" name="fname" required/>
</div>
<div class="item">
<label for="lname"> Last Name<span>*</span></label>
<input id="lname" type="text" name="lname" />
</div>
<div class="item">
<label for="address">Address<span>*</span></label>
<input id="address" type="text" name="address" />
</div>
<div class="item">
<label for="city">City<span>*</span></label>
<input id="city" type="text" name="city" />
</div>
<div class="item">
<label for="state">State<span>*</span></label>
<input id="state" type="text" name="state" />
</div>
<div class="item">
<label for="email">Email Address<span>*</span></label>
<input id="email" type="email" name="email" required/>
</div>
<div class="item">
<label for="phone">Phone<span>*</span></label>
<input id="phone" type="tel" name="phone" />
</div>
</div>
</fieldset>
<br/>
<fieldset>
<legend>Dates</legend>
<div class="columns">
<div class="item">
<label for="Formdate">From Date <span>*</span></label>
<input id="Formdate" type="date" name="Fromdate" />
<i class="fas fa-calendar-alt"></i>
</div>
<div class="item">
<label for="Todate">To Date <span>*</span></label>
<input id="Todate" type="date" name="Todate" />
<i style="background-color:aquamarine" class="fas fa-calendar-alt"></i>
</div>
<div class="item">
<p>In Time </p>
<select>
<option value="" disabled selected>Select time</option>
<option value="1" >Morning</option>
<option value="2">Afternoon</option>
<option value="3">Evening</option>
</select>
</div>
<div class="item">
<p>Out Time </p>
<select>
<option value="4" disabled selected>Select time</option>
<option value="5" >Morning</option>
<option value="6">Afternoon</option>
<option value="7">Evening</option>
</select>
</div>
<div class="item">
<p>How many adults are coming?</p>
<div class="item">
<input id="Acount" type="number" placeholder=" count" name="Acount" />
</div>
</div>
<div class="item">
<p>How many children are coming?</p>
<div class="item">
<input id="Ccount" type="number" placeholder=" count" name="Ccount" />
</div>
</div>
<div class="item" >
<label for="hours">Number of Hours</label>
<input id="hours" type="number" placeholder="Duration"name="hours" />
</div>
<div class="item">
<label for="amount">Amount</label>
<input id="amount" type="number" placeholder="10k per hour" name="amount" />
</div>
</div>
<div class="item">
<label for="instruction">Special Instructions</label>
<textarea id="instruction" rows="3"></textarea>
<h3>qr code</h3>
<p> you will get the qr code after the registartion after please make shoure to sake it </p>
</div>
</fieldset>
<div class="btn-block">
<button type="submit" value="send message" onclick="generateqr();sendemail()">Submit</button>
</div>
<div id="qrcode" >
</div>
</form>
</div>
<script>
const scriptURL = 'https://script.google.com/macros/s/AKfycbxOHuyGlxoj_Dqk4EJHnI0geAjeR0OrQB05UjsqQMlgidO-f7sjnH-bbDdjFOMXqQZ6/exec'
const form = document.forms['google-sheet']
form.addEventListener('submit', e => {
e.preventDefault()
fetch(scriptURL, { method: 'POST', body: new FormData(form)})
.then(response => alert("Thanks for Contacting us..! We Will Contact You Soon..."))
.catch(error => console.error('Error!', error.message))
})
</script>
<script>
function generateqr() {
var fname = document.getElementById('fname').value;
var lname = document.getElementById('lname').value;
var address = document.getElementById('address').value;
var city = document.getElementById('city').value;
var state = document.getElementById('state').value;
var email = document.getElementById('email').value;
var phone = document.getElementById('phone').value;
var Formdate = document.getElementById('Formdate').value;
var Todate = document.getElementById('Todate').value;
var hours = document.getElementById('hours').value;
console.log( "<br>fname" + fname + "lname" + lname+ "address" + address+ "city" + city+ "state " + state+ "email" + email+ "phone " + phone+ "Formdate " + Formdate+ "Todate " + Todate+ "hours" + hours);
var url = "https://chart.googleapis.com/chart?cht=qr&chs=200x200&chl=Name:"+"<br>room-1"+"<br>fname:" + fname +"<br>"+ "lname:" + lname+"<br>"+ "address:" + address+"<br>"+ "city:" + city+"<br>"+ "state: " + state+"<br>"+ "email:" + email+"<br>"+ "phone: " + phone+"<br>"+ "Formdate:" + Formdate+"<br>"+ "Todate:" + Todate+"<br>"+ "hours:" + hours;
var ifr = `<iframe src="${url}" height="200" width="200" margin-left="500px"> </iframe>`;
document.getElementById('qrcode').innerHTML = ifr;
}
</script>
<script src="https://smtpjs.com/v3/smtp.js"></script>
<script>
function sendemail(){
var fname = document.getElementById('fname').value;
var lname = document.getElementById('lname').value;
var address = document.getElementById('address').value;
var city = document.getElementById('city').value;
var state = document.getElementById('state').value;
var email = document.getElementById('email').value;
var phone = document.getElementById('phone').value;
var Formdate = document.getElementById('Formdate').value;
var Todate = document.getElementById('Todate').value;
var hours = document.getElementById('hours').value;
Email.send({
Host : "smtp.elasticemail.com",
Username : "[email protected]",
Password : "77E68D2816F3938CBDEFCC325E0457772371",
To : document.getElementById('email').value,
From : "[email protected]",
Subject : "To Conform your reservation at room-1 in cafe",
Body : "you have registered at the cafe at the room-1 we will provide you all the things required to you <br>your booked place:room-1"+"<br>fname:" + fname +"<br>:"+ "lname:" + lname+"<br>"+ "address:" + address+"<br>"+ "city:" + city+"<br>"+ "state:" + state+"<br>"+ "email:" + email+"<br>"+ "phone:" + phone+"<br>"+ "Formdate:" + Formdate+"<br>"+ "Todate:" + Todate+"<br>"+ "hours:" + hours+"<br>this are the registration details of your booking"+"<br>we will contact you as soon as possible and your responce is noted "+"we welocome to our cafe we promisse you that you will have best time in our cafe",
}).then(
message => alert(message)
);
}
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="jquery.min.js"></script>
<script src="jquery.validate.min.js"></script>
</body>
</html>