-
Notifications
You must be signed in to change notification settings - Fork 0
/
offrir.html
272 lines (228 loc) · 9.61 KB
/
offrir.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="favicon.ico">
<title>Mariage Géraldine et Bertrand</title>
<!-- Bootstrap core CSS -->
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link href="bootstraps/assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="cover.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
var QueryString = function () {
// This function is anonymous, is executed immediately and
// the return value is assigned to QueryString!
var query_string = {};
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
// If first entry with this name
if (typeof query_string[pair[0]] === "undefined") {
query_string[pair[0]] = decodeURIComponent(pair[1]);
// If second entry with this name
} else if (typeof query_string[pair[0]] === "string") {
var arr = [ query_string[pair[0]],decodeURIComponent(pair[1]) ];
query_string[pair[0]] = arr;
// If third or later entry with this name
} else {
query_string[pair[0]].push(decodeURIComponent(pair[1]));
}
}
return query_string;
}();
function validateEmail(email) {
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email);
}
function validate() {
document.getElementById('result').value.text("");
var email = document.getElementById('inputEmail3').value.val();
if (validateEmail(email)) {
} else {
document.getElementById('result').value.text("L'adresse électronique n'est pas correcte.");
document.getElementById('result').value.css("color", "red");
}
return false;
}
var updateFields = function () {
var price = 0;
console.log(QueryString.item);
switch ( QueryString.item ) {
case "undefined":
break;
case "ameublement-table-wood-lo":
price=75;
break;
case "ameublement-chaise":
price=50;
break;
case "ameublement-fauteuil-biblio":
price=250;
break;
case "ameublement-tv":
price=100;
break;
case "ameublement-bac-potager":
price=30;
break;
case "ameublement-lampe-trepied":
price=125;
break;
case "ameublement-machine-pain":
price=85;
break;
case "ameublement-livres":
price=15;
break;
case "ameublement-table-sam":
price=120;
break;
case "ameublement-vase":
price=25;
break;
case "ameublement-velo-ge":
price=230;
break;
case "ameublement-velo-bert":
price=200;
break;
case "ameublement-lustre":
price=130;
break;
case "ameublement-rechaud":
price=25;
break;
default:
QueryString.item="Indéfini"
price=1;
}
document.getElementById('inputParticipation').value=QueryString.item;
document.getElementById('inputMontant').value=price*parseInt(document.getElementById('inputQuantity').value)+"€";
};
window.onload = updateFields;
</script>
</head>
<body>
<div class="site-wrapper">
<div class="site-wrapper-inner">
<div class="cover-container">
<div class="masthead clearfix" data-spy="affix" data-offset-top="50">
<div class="inner">
<h3 class="masthead-brand">Géraldine & Bertrand</h3>
<nav>
<ul class="nav masthead-nav">
<li><a href="index.html">Home</a></li>
<li><a href="#">Infos pratiques</a></li>
<li class="active"><a href="liste.html">Liste</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</div>
</div>
<div class="content">
<div>
<h1>Réserver un cadeau</h1>
</div>
<div class="liste-container">
<form class="form-horizontal" id="gform" action="https://script.google.com/macros/s/AKfycbzElSWhet4BEtzFpdS6eP4fYd8wYo_yweumcWOtovMFRsiIrHLC/exec" method="POST">
<div class="form-group">
<label for="inputName" class="col-sm-2 control-label">Votre Nom</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inputName" placeholder="Nom" name="name" required>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">Votre Email</label>
<div class="col-sm-10">
<input type="email" class="form-control" id="inputEmail3" placeholder="Email" name="email" required >
</div>
</div>
<div class="form-group">
<label for="inputParticipation" class="col-sm-2 control-label">Votre réservation</label>
<div class="col-sm-10">
<select class="form-control" id="inputParticipation" name="gift" onchange="updateFields()" required >
<option value="ameublement-table-wood-lo">Table basse by Wood-Lo</option>
<option value="ameublement-chaise">Chaise salle à manger</option>
<option value="ameublement-fauteuil-biblio">Fauteuil pour la bibliothèque</option>
<option value="ameublement-tv">Télévision cathodique</option>
<option value="ameublement-bac-potager">Bac pour potager</option>
<option value="ameublement-lampe-trepied">Lampe trépied de campagne</option>
<option value="ameublement-machine-pain">Four à pain Philips</option>
<option value="ameublement-livres">De beaux livres pour notre bibliothèque</option>
<option value="ameublement-table-sam">Table de salle à manger by Wood-Lo</option>
<option value="ameublement-vase">Vase</option>
<option value="ameublement-velo-ge">Vélo pour Géraldine</option>
<option value="ameublement-velo-bert">Vélo pour Bertrand</option>
<option value="ameublement-lustre">Lustre pour la salle à manger</option>
<option value="ameublement-rechaud">Réchaud électrique d'appoint</option>
</select>
</div>
</div>
<div class="form-group">
<label for="inputQuantity" class="col-sm-2 control-label">Quantité</label>
<div class="col-sm-10">
<input type="number" class="form-control" id="inputQuantity" name="quantity" value="1" onchange="updateFields()" required >
</div>
</div>
<div class="form-group">
<label for="inputMontant" class="col-sm-2 control-label">Montant total</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inputMontant" placeholder="0,00€" name="amount" required >
</div>
</div>
<div class="form-group">
<label for="inputMessage" class="col-sm-2 control-label">Votre message</label>
<div class="col-sm-10">
<textarea class="form-control" rows="3" id="inputMessage" name="message" placeholder="Vous pouvez nous écrire un petit message si vous le souhaitez!"></textarea>
</div>
</div>
<hr/>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10" id="result"></div>
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary btn-lg">Envoyer</button>
</div>
</div>
</form>
<hr/>
</div>
</div>
<!--
<div class="inner cover">
<h1 class="cover-heading">Cover your page.</h1>
<p class="lead">Cover is a one-page template for building simple and beautiful home pages. Download, edit the text, and add your own fullscreen background photo to make it your own.</p>
<p class="lead">
<a href="#" class="btn btn-lg btn-default">Learn more</a>
</p>
-->
</div>
<div class="mastfoot">
<div class="inner">
</div>
</div>
</div>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="bootstrap/assets/js/vendor/jquery.min.js"><\/script>')</script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="bootstrap/assets/js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>