-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathget-quote.html
339 lines (273 loc) · 15.8 KB
/
get-quote.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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
<!DOCTYPE HTML>
<html><!-- InstanceBegin template="/Templates/main.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Mobile App</title>
<link href="http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,700"
rel="stylesheet" type="text/css"/>
<link href="css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
<link href="css/jquerymobile.css" rel="stylesheet" type="text/css"/>
<!-- nativeDroid core CSS -->
<link href="css/jquerymobile.nativedroid.css" rel="stylesheet" type="text/css"/>
<!-- nativeDroid: Light/Dark -->
<link href="css/jquerymobile.nativedroid.dark.css" rel="stylesheet" type="text/css" id='jQMnDTheme'/>
<!-- nativeDroid: Color Schemes -->
<link href="css/jquerymobile.nativedroid.color.green.css" rel="stylesheet" type="text/css" id='jQMnDColor'/>
<link href="css/style.css" rel="stylesheet" type="text/css"/>
<script src="js/jquery-1.11.0.min.js" type="text/javascript"></script>
<script src="js/jquery.mobile-1.4.2.min.js" type="text/javascript"></script>
<script src="js/logger.js" type="text/javascript"></script>
<script src="cordova.js" type="text/javascript"></script>
<script src="js/functions.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
allowAccess();
$(document).on( 'pagecreate','#page', function(event){
setUserToken();
});
getHeaderBgColor();
getUserMenu();
});
</script>
<!-- InstanceBeginEditable name="EditableHead" -->
<script type="text/javascript">
$(document).ready(function() {
var newWidth = $(window).width() - 15;
//alert(newWidth);
if( newWidth > 0 && newWidth < 321 ){
$( ".input-container input[type=text], .input-container input[type=password]" ).css( { "height": "45px", "padding-left": "50px" } );
$( ".icon-ph" ).css( { "padding": "12.5px", "font-size": "20px" } );
} else if ( newWidth > 320 && newWidth < 481 ){
$( ".input-container input[type=text], .input-container input[type=password]" ).css( { "height": "45px", "padding-left": "50px" } );
$( ".icon-ph" ).css( { "padding": "12.5px", "font-size": "20px" } );
} else if ( newWidth > 480 && newWidth < 641 ){
$( ".input-container input[type=text], .input-container input[type=password]" ).css( { "height": "45px", "padding-left": "50px" } );
$( ".icon-ph" ).css( { "padding": "12.5px", "font-size": "20px" } );
} else {
$( ".input-container input[type=text], .input-container input[type=password]" ).css( { "height": "45px", "padding-left": "50px" } );
$( ".icon-ph" ).css( { "padding": "12.5px", "font-size": "20px" } );
}
});
</script>
<script src="http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places"></script>
<script src="js/jquery.geocomplete.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".more-options-hidden, .panel-1").css("display","none");
$('.more-options').click(function(){ $(".more-options-hidden").slideToggle("8000"); });
$(".flip-1").click(function(){ $(".panel-1").fadeToggle(1000); });
$("#pickup").geocomplete().bind("geocode:result", function(event, result){ $.log("Result: " + result.formatted_address); }).bind("geocode:error", function(event, status){ $.log("ERROR: " + status); }).bind("geocode:multiple", function(event, results){ $.log("Multiple: " + results.length + " results found"); });
$("#dropoff").geocomplete().bind("geocode:result", function(event, result){ $.log("Result: " + result.formatted_address); }).bind("geocode:error", function(event, status){ $.log("ERROR: " + status); }).bind("geocode:multiple", function(event, results){ $.log("Multiple: " + results.length + " results found"); })
});
function callbackTarif(data) {
if(data.success != false) {
setLocalStorage('price',data.data.price.Tarif);
setLocalStorage('option',data.data.option);
location.replace('review-offer.html');
} else {
console.log('noooooooo');
showMessage(data);
}
}
function setQuoteData(form) {
var src = $('#pickup').val();
var dst = $('#dropoff').val();
var src_convrt = src.replace(" ","+");
var dst_convrt = dst.replace(" ","+");
var source_data = 'http://maps.googleapis.com/maps/api/geocode/json?address='+src_convrt+'&sensor=true';
var destination_data = 'http://maps.googleapis.com/maps/api/geocode/json?address='+dst_convrt+'&sensor=true';
var source_post_code;
var destination_post_code;
var source_current_latitude;
var source_current_longitude;
$.getJSON(source_data,function(result){
$.each(result.results, function(i, field){
$.each(field.address_components, function(i, obj_type){
if(inArray('postal_code_prefix',obj_type.types)||
inArray('postal_code',obj_type.types)){
console.log(inArray('postal_code_prefix',obj_type.types));
if( inArray('postal_code_prefix',obj_type.types) ){
var source_post_code = obj_type.short_name;
console.log(obj_type.short_name.length+' == '+obj_type.short_name+' == '+source_post_code);
}
else{
var source_post_code = obj_type.short_name.substring(0, obj_type.short_name.indexOf(" "));
console.log(obj_type.short_name.length+' == '+obj_type.short_name+' == '+source_post_code);
}
document.getElementById("from_post_code").value = source_post_code;
}
});
$.each(field.geometry.location, function(i, obj_return){
if(i =='lat') source_current_latitude = obj_return;
if(i =='lng') source_current_longitude = obj_return;
});
document.getElementById("current_location_latitude").value = new String(source_current_latitude);
document.getElementById("current_location_longitude").value = new String(source_current_longitude);
document.getElementById("from_detail").value = $('#pickup').val();
document.getElementById("to_detail").value = $('#pickup').val();
console.log(source_current_latitude, source_current_longitude);
});
});
$.getJSON(destination_data,function(result){
$.each(result.results, function(i, field){
$.each(field.address_components, function(i, obj_type){
if(inArray('postal_code_prefix',obj_type.types)||
inArray('postal_code',obj_type.types)){
if( inArray('postal_code_prefix',obj_type.types) ){
var destination_post_code = obj_type.short_name;
console.log(obj_type.short_name.length+' == '+obj_type.short_name+' == '+destination_post_code);
}
else{
var destination_post_code = obj_type.short_name.substring(0, obj_type.short_name.indexOf(" "));
console.log(obj_type.short_name.length+' == '+obj_type.short_name+' == '+destination_post_code);
}
document.getElementById("to_post_code").value = destination_post_code;
}
});
});
submitForm(form);
});
return false;
}
function inArray(needle, haystack) {
var length = haystack.length;
for(var i = 0; i < length; i++) {
if(haystack[i] == needle) return true;
}
return false;
}
</script>
<!-- InstanceEndEditable -->
</head>
<body>
<div data-role="page" id="pageone" class="content_wrapper container" data-theme='b'>
<div data-role="header" data-position="fixed" data-tap-toggle="false" data-theme="e"
id="header" class="bg-black">
<div class="container">
<div class="top-icons ti-left">
<a href="#sidebar_panael" class="ui-btn ui-corner-all ui-shadow manu_btn" data-role='button' data-icon='tasks' data-iconpos='left' data-inline='true'><i class='fa fa-bars'></i></a>
</div>
<div id="header-logo">
<div class="tile-box text-center">
<a href="dashboard.html" rel="external">
<img src="images/taxi-logo.png" alt="Get a Taxi App">
</a>
</div>
</div>
<div class="top-icons ti-right" id="header-right">
<!--<a href="#">
<i class="icon-user"></i>
</a>
<a href="#right-panel" data-role="button" data-icon="tasks" data-iconpos="right" data-inline="true">
<i class="icon-cogs"></i>
</a>
<a href="#">
<i class="icon-cogs"></i>
</a>-->
</div>
<!-- InstanceBeginEditable name="EditableHeader" -->
<!-- InstanceEndEditable -->
<div class="clearfix"></div>
</div>
</div>
<div id="content">
<div class="container">
<!-- InstanceBeginEditable name="EditableBody" -->
<div class="get-quote-bg content-position">
<h2>Get A Quote</h2>
<form method="POST" enctype="multipart/form-data" onsubmit="return setQuoteData(this)">
<div class='input-container'>
<div class="icon-ph"><i class="ui-icon-heart"></i></div>
<input class="custom-text" type="text" placeholder="Pickup Address?" data-role="none" id="pickup">
<div class="icon-qh" id="my-locatipn"><i class="ui-icon-heart"></i></div>
</div>
<div class='input-container'>
<div class="icon-ph"><i class="ui-icon-heart"></i></div>
<input class="custom-text" type="text" placeholder="Dropoff Address?" data-role="none" id="dropoff">
</div>
<div class='input-container'>
<select id="taxi_type" class="custom-text" data-role="none" name="data[tarif][taxi_type]">
<option value="Choose">Choose One</option>
<option value="Silver">Silver</option>
<option value="Black">Black</option>
<option value="White">White</option>
</select>
</div>
<div class='input-container'>
<select id="taxi_type" class="custom-text" data-role="none" name="data[tarif][vehicle_type]">
<option value="Choose">Choose One</option>
<option value="Sedan">Sedan</option>
<option value="Station_Wagon">Station Wagon</option>
<option value="Micro">Micro</option>
</select>
</div>
<div class='input-container'>
<div class="flip-1 ui-shadow-inset"><label>Click to show more details</label></div>
<div class="panel-1">
<input type="checkbox" name="data[tarif][baby_seat]" data-role="none" />Baby Seat
<input type="checkbox" name="data[tarif][wheel_chair]" data-role="none" />Wheel Chair
</div>
</div>
<div class='input-container'>
<div class="icon-ph button-pointer"><i class="fa fa-chevron-left fa-fw"></i></div>
<input type="button" placeholder="Back" class="get-quote-back" data-role="none">
<button type="submit" data-role="none" class="get-quote-continue" id="get-quote-continue">Continue</button>
<!--<a href="review-offer.html" data-transition="flip" style="color:#FFF"> <button type="submit" data-role="none" class="get-quote-continue" id="get-quote-continue">Continue</button></a> -->
</div>
<input type="hidden" name='controller' value="Tarifs" />
<input type="hidden" name='action' value="price" />
<input type="hidden" name='callback' value="callbackTarif" />
<input type="hidden" id="from_detail" value="" name="data[tarif][from_detail]" />
<input type="hidden" id="to_detail" value="" name="data[tarif][to_detail]" />
<input type="hidden" id="from_post_code" value="" name="data[tarif][location_from]" />
<input type="hidden" id="to_post_code" value="" name="data[tarif][location_to]" />
<input type="hidden" id="current_location_latitude" value="" name="data[tarif][current_lat]" />
<input type="hidden" id="current_location_longitude" value="" name="data[tarif][current_lng]" />
</form>
</div>
<!-- InstanceEndEditable -->
</div>
<div class="clearfix"></div>
</div>
<!-- <div data-position="fixed" data-tap-toggle="false" data-role="footer" data-tap-toggle="false" data-theme="b"
id="footer">
<div class="container">
<div data-role="navbar">
<ul>
<li>
<a href="index.html">
<i class="icon-home"></i>
</a>
</li>
<li>
<a href="#">
<i class="icon-picture"></i>
</a>
</li>
<li>
<a href="logout.html" id="logout">
<i class="icon-signout"></i>
</a>
</li>
</ul>
</div>-->
<!-- InstanceBeginEditable name="EditableFooter" -->
<!-- InstanceEndEditable -->
<!-- </div> -->
<!--left panel content-->
<div data-role="panel" id="sidebar_panael" data-dismissible="false" data-display="push" data-theme="b">
<ul data-role="listview">
<li><h2>Your wishes</h2></li>
<li data-icon='false'><a href="#"><i class='lIcon fa fa-coffee'></i>About us</a></li>
<li data-icon='false'><a href="#"><i class='lIcon fa fa-beer'></i>Testomonial</a></li>
<li data-icon='false'><a href="#"><i class='lIcon fa fa-music'></i>Hire a taxi</a></li>
<li data-icon='false'><a href="#"><i class='lIcon fa fa-fire'></i>Location</a></li>
<li data-icon='false'><a href="#"><i class='lIcon fa fa-bullhorn'></i>Contact us</a></li>
<li data-icon='false'><a href="#"><i class='lIcon fa fa-heart'></i>Tell a friend</a></li>
<li data-icon='false'><a href="#"><i class='lIcon fa fa-trophy'></i>Rate this apps</a></li>
</ul>
</div>
</div>
</div>
</body>
<!-- InstanceEnd --></html>