This repository has been archived by the owner on Apr 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
customer-register.php
169 lines (160 loc) · 6.45 KB
/
customer-register.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
<?php
require_once('database.php');
require_once('sms.php');
require_once('server.php');
require_once('header.php');
include('errors.php');
?>
<section class="bg9 p-b-30">
<div class="container">
<h3 class="bg6 text-center p-t-15 p-b-15">Register New Customer</h3>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3"></div>
<form class="bgwhite p-b-20 p-l-20 p-t-20 col-xs-12 col-sm-12 col-md-8 col-lg-8" method="post" action="" autocomplete="off">
<div class="form-group">
<input class="bo9 p-t-10 p-l-10 p-r-10 p-b-10" type="phonenumber" name="phone" maxlength="10" minlength="10" required="required" placeholder="Phone Number" autocomplete="off" />
</div>
<div class="form-group">
<input class="bo9 p-t-10 p-l-10 p-r-7 p-b-7" type="text" name="name" maxlength="25" required="required" placeholder="Full Name" autocomplete="off" />
</div>
<div class="form-group">
<input class="bo9 p-t-10 p-l-10 p-r-10 p-b-10" type="password" name="password_1" maxlength="35" required="required" placeholder="Password" autocomplete="off" />
</div>
<div class="form-group">
<input class="bo9 p-t-10 p-l-10 p-r-10 p-b-10" type="password" name="password_2" maxlength="35" required="required" placeholder="Confirm Password" autocomplete="off" />
</div>
<div class="form-group bo9 p-t-10 p-l-10 p-r-10 p-b-10 " style="width:300px;">
<select name="place" id="place" class="selection-2">
<option selected="true" disabled="disabled" value="">Select your Place</option>
<?php
$places = array("Bengaluru Urban","Bagalkot","Bellary","Chamarajanagar","Bengaluru Rural","Belgaum","Bidar","Chikkamagaluru","Chikkaballapur","Vijayapura","Kalaburagi","Dakshina Kannada","Chitradurga","Dharwad","Koppal","Hassan","Davanagere","Gadag","Raichur","Kodagu","Kolar","Haveri","Yadgir","Mandya","Ramanagara","Uttara Kannada","Mysuru","Shivamogga","Udupi","Tumakuru","Others");
sort($places);
foreach ($places as $value)
echo "<option value='".$value."'>".$value."</option>\n";
?>
</select>
</div>
<div class="form-group p-t-10">
<input class="bo9 p-t-10 p-l-10 p-r-10 p-b-10" type="email" name="email" placeholder="Email" autocomplete="off" />
</div>
<div class="form-group">
<button type="button" class="flex-c-m w-size2 bg4 bo-rad-23 hov1 m-text3 trans-0-4" onclick="getLocation();">Locate Me</button>
<p id="demo">Allow permission for Geolocation after clicking the button below.</p>
<input class="bo9 p-t-10 p-l-10 p-r-10 p-b-10" type="text" name="lat" id="latbox" value="Latitude" autocomplete="off" readonly />
<input class="bo9 p-t-10 p-l-10 p-r-10 p-b-10" type="text" name="lon" id="lngbox" value="Longitude" autocomplete="off" readonly />
<div id="map">Google Map should display here on clicking the above button</div>
<span class="s-text8 p-b-10">
Adjust the marker to your exact location
</span>
</div>
<div class="w-size2">
<button type="submit" name="reg_customer" class="flex-c-m size2 bg4 bo-rad-23 hov1 m-text3 trans-0-4">
Register
</button>
</div>
<p>
Already a member? <a href="customer-login.php"><strong>Sign in</strong></a>
</p>
</form>
<div class="col-xs-12 col-sm-12 col-md-2 col-lg-2"></div>
</div>
<?php require_once('footer.php'); ?>
</div>
</section>
<!-- Container Selection -->
<div id="dropDownSelect1"></div>
<div id="dropDownSelect2"></div>
<script type="text/javascript">
$(".selection-1").select2({
minimumResultsForSearch: 20,
dropdownParent: $('#dropDownSelect1')
});
$(".selection-2").select2({
minimumResultsForSearch: 20,
dropdownParent: $('#dropDownSelect2')
});
</script>
<!-- Loading Google API -->
<script>
var x = document.getElementById("demo");
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition, showError);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
loadLoc();
}
}
function loadLoc() {
var str = document.getElementById("place").value;
var url = "https://maps.googleapis.com/maps/api/geocode/json?address=" + str + "&key=AIzaSyAQFgFA-JX5_Xna8TsXVfGtvYn7XrFPuAQ";
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var myObj = JSON.parse(this.responseText);
console.log(myObj.status);
document.getElementById("latbox").value = myObj.results[0].geometry.location.lat;
document.getElementById("lngbox").value = myObj.results[0].geometry.location.lng;
}
};
xmlhttp.open("GET", url, true);
xmlhttp.send();
setTimeout(initMap, 1000);
}
function showPosition(position) {
document.getElementById("latbox").value = position.coords.latitude;
document.getElementById("lngbox").value = position.coords.longitude;
initMap();
}
// Handling Errors
function showError(error) {
switch(error.code) {
case error.PERMISSION_DENIED:
x.innerHTML = "User denied the request for Geolocation."
break;
case error.POSITION_UNAVAILABLE:
x.innerHTML = "Location information is unavailable."
break;
case error.TIMEOUT:
x.innerHTML = "The request to get user location timed out."
break;
case error.UNKNOWN_ERROR:
x.innerHTML = "An unknown error occurred."
break;
}
loadLoc();
}
</script>
<script>
var map;
function initMap() {
var latlng = new google.maps.LatLng(document.getElementById("latbox").value, document.getElementById("lngbox").value);
map = new google.maps.Map(document.getElementById('map'), {
center: latlng,
zoom: 13,
mapTypeId: google.maps.MapTypeId.ROADMAP,
clickableIcons: false,
mapTypeControl: false,
streetViewControl: false,
overviewMapControl: true,
rotateControl: true,
panControl: true,
zoomControl: true,
scaleControl: true,
});
var marker = new google.maps.Marker({
position: latlng,
map: map,
title: 'Drag this marker to your exact location',
draggable: true,
});
google.maps.event.addListener(marker, 'dragend', function (event) {
document.getElementById("latbox").value = this.getPosition().lat();
document.getElementById("lngbox").value = this.getPosition().lng();
});
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAmt9muKRq8oFoSiZQw-B0hcG-aBrvUNPo"
async defer></script>
</body>
</html>