-
Notifications
You must be signed in to change notification settings - Fork 2
/
api.html
261 lines (227 loc) · 7.75 KB
/
api.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
<!-- jewGWTnUPRCnRUPb -->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Country State City Dropdown.</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="./dist/css/style.css">
<link rel="shortcut icon" href="dist/img/log.ico" type="image/x-icon">
</head>
<body>
<div class="container mt-2">
<h1>Country State City Dropdown</h1>
<br>
<div class="alert alert-danger alert-dismissible fade show" role="alert">
<span id="message"></span>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="row p-2 ">
<div class="col-sm-4">
<div class="form-group">
<label for="country">Country</label>
<select class="form-control" id="country">
<option value="-1">Select Country</option>
</select>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label for="state">State</label>
<select class="form-control" id="state">
<option>Select State</option>
</select>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label for="city">City</label>
<select class="form-control" id="city">
<option>Select City</option>
</select>
</div>
</div>
</div>
<div class="row mt-5">
<div class="col-sm-3 ">
<div>GETTING STARTED</div>
<hr>
<ul class="list-group">
<li class="list-group-item "><a href="#api-install">Installation</a></li>
<li class="list-group-item "><a href="#api-unisntall">Delete</a></li>
<li class="list-group-item "><a href="#api-keys">API Key</a></li>
<li class="list-group-item "><a href="#use-api">Use API</a></li>
</ul>
</div>
<div class="col-sm-9 ">
<div class="tutorial">
<div id="api-install">
<div class="display-4"> Installation </div>
<ul class="list-group">
<li class="list-group-item">1 - Download API https://github.com/IrfanGhuori/Dynamically-Selector/archive/refs/heads/master.zip</li>
<li class="list-group-item">2 - Upload the API zip folder to your web server public_html director, using FTP or File Manager.</li>
<li class="list-group-item">3 - Create a MySQL database for API or Use exists database for API.</li>
<li class="list-group-item">4 - Ran installation file path: www.yourDomain.com/api/installer/</li>
<li class="list-group-item">5 - After installation delete installer folders </li>
</ul>
<div class="display-4"> Videos tutorial </div>
<div class="col-8 mt-3">
<video width="600" height="400" controls>
<source src="./assets/images/installer.mp4" type="video/mp4">
</video>
</div>
<br><br>
<hr>
<div id="api-unisntall">
<br><br><br>
<div class="display-4"> Uninstall API </div>
<ul class="list-group">
<li class="list-group-item">1 - Go your phpMyAdmin </li>
<li class="list-group-item">2 - Drop down 4 columns Name "city","country","key","state"
</li>
<li class="list-group-item">3 - Delete FOlder name
<ol>
<li> App folder </li>
<li> Dist folder</li>
<li> api.html </li>
</ol>
</li>
</ul>
<div class="display-4"> Videos tutorial </div>
<div class="col-8 mt-3">
<video width="600" height="400" controls>
<source src="./assets/images/uninstall.mp4" type="video/mp4">
</video>
</div>
</div>
<br><br>
<hr>
<div id="api-keys">
<br><br><br>
<div class="display-4"> API Key </div>
<ul class="list-group">
<li class="list-group-item">1 - Generate your API key and save it on a notepad! </li>
<li class="list-group-item">2 - Paste your API key in ajax script after URL path <br> Example: url: ‘…/api/app/api_countries.php?key=YourKeyHere’. </li>
<li class="list-group-item">3 - If you forgot the copy key. You can copy it from your database column name “key”.</li>
</ul>
<div class="display-4"> Videos tutorial </div>
<div class="col-8 mt-3">
<video width="600" height="400" controls>
<source src="./assets/images/key.mp4" type="video/mp4">
</video>
</div>
</div>
<br><br>
<hr>
<div id="use-api">
<br><br><br>
<div class="display-4"> Use API </div>
<ul class="list-group">
<li class="list-group-item">1 - Copy the HTML code. </li>
<li class="list-group-item">2 - It is designed with Bootstrap 4, you can easily customize it.</li>
<li class="list-group-item">3 - Place the fetcher.js after the jquery library </li>
</ul>
<code><pre>
<script src="YourDomain.com/dist/js/fetcher.js"></script>
</pre></code>
<ul class="list-group">
<li class="list-group-item">4 - copy ajax code and place it after jquery library. </li>
</ul>
<code>
<pre>
<script>
$(document).ready(function () {
jQuery.ajax({
type: 'post',
url: '../api/app/api_countries.php?key=Your-API-Key',
success: function (countries) {
if (countries.status == "connected") {
$.each(countries.data, function (ind, co) {
jQuery('#country').append("<option value='" + co.id + "'>" + co.name + " </option>");
});
} else if (countries.status == "error") {
$('.alert-danger').fadeIn();
$('#message').append(countries.message);
}
}
});
});
</script>
</pre>
</code>
<ul class="list-group">
<li class="list-group-item">4 - Copy the HTML code and place it where you want it to appear. </li>
</ul>
<code>
<pre>
<div class="row">
<div class="col-sm-4">
<div class="form-group">
<label for="country">Country</label>
<select class="form-control" id="country">
<option value="-1">Select Country</option>
</select>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label for="state">State</label>
<select class="form-control" id="state">
<option>Select State</option>
</select>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label for="city">City</label>
<select class="form-control" id="city">
<option>Select City</option>
</select>
</div>
</div>
</div>
</pre>
</code>
</div>
</div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin="anonymous"></script>
<script>
$(document).ready(function () {
jQuery.ajax({
type: 'post',
url: '../api/app/api_countries.php?key=z0bHwnngx6',
success: function (countries) {
if (countries.status == "connected") {
$.each(countries.data, function (ind, co) {
jQuery('#country').append("<option value='" + co.id + "'>" + co.name + " </option>");
});
} else if (countries.status == "error") {
$('.alert-danger').fadeIn();
$('#message').append(countries.message);
}
}
});
});
$(document).on('click', 'a[href^="#"]', function (e) {
e.preventDefault();
$('.tutorial').stop().animate({
scrollTop: $($(this).attr('href')).offset().top
}, 1000, 'linear');
});
</script>
<script src="./dist/js/fetcher.js"></script>
</body>
</html>