- Timestamp:
- Apr 23, 2015 12:00:06 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/assets/js/frontend/lecture.js
r838 r906 5 5 $('#alert-services').modal('show'); 6 6 } 7 $('#alert-services').on('hidden.bs.modal', function () { 8 if (update_user_info == "1") 9 { 10 $('#update_user_info').modal({backdrop: 'static',keyboard: false,}); 11 } 12 }); 7 13 } 8 14 9 15 if (p_period == -1 && is_overdate == 1) 10 16 { 17 11 18 $('#alert-trial-services').modal('show'); 12 19 $('#alert-trial-services').on('hidden.bs.modal', function () { … … 17 24 }); 18 25 } 26 19 27 else 20 28 { 21 if (update_user_info == "1") 22 { 23 $('#update_user_info').modal({backdrop: 'static'}); 29 if (licenseAvailable == "OK"){ 30 if (update_user_info == "1") 31 { 32 $('#update_user_info').modal({backdrop: 'static'}); 33 } 24 34 } 25 35 } … … 194 204 195 205 }); 196 197 if ($("#form-field-province").val() !== 'undefined'){ 198 provinceId = $("#form-field-province").val(); 199 $.ajax({ 200 url: 'user/getDistrict/' + provinceId, 201 type: 'POST', 202 success: function (data, textStatus, jqXHR) 203 { 204 result = jQuery.parseJSON(data); 205 content = ""; 206 if (result != null){ 207 for (var i in result){ 208 content = content + '<option value="' + result[i].district_id + '">' + result[i].district_name + '</option>' 206 $(document).ready(function(){ 207 if ($("#form-field-province").val() !== 'undefined'){ 208 provinceId = $("#form-field-province").val(); 209 $.ajax({ 210 url: 'user/getDistrict/' + provinceId, 211 type: 'POST', 212 success: function (data, textStatus, jqXHR) 213 { 214 result = jQuery.parseJSON(data); 215 content = "<option></option>"; 216 if (result != null){ 217 for (var i in result){ 218 content = content + '<option value="' + result[i].district_id + '">' + result[i].district_name + '</option>' 219 } 220 209 221 } 210 222 $("#form-field-district").html(content); 211 223 } 212 } 213 }); 214 } 215 216 $("#form-field-province").change(function(){ 217 provinceId = this.value; 218 $.ajax({ 219 url: 'user/getDistrict/' + provinceId, 220 type: 'POST', 221 success: function (data, textStatus, jqXHR) 222 { 223 result = jQuery.parseJSON(data); 224 content = ""; 225 if (result != null){ 226 for (var i in result){ 227 content = content + '<option value="' + result[i].district_id + '">' + result[i].district_name + '</option>' 224 }); 225 } 226 227 $("#form-field-province").change(function(){ 228 provinceId = this.value; 229 $.ajax({ 230 url: 'user/getDistrict/' + provinceId, 231 type: 'POST', 232 success: function (data, textStatus, jqXHR) 233 { 234 console.log(data); 235 result = jQuery.parseJSON(data); 236 content = "<option></option>"; 237 if (result != null){ 238 for (var i in result){ 239 content = content + '<option value="' + result[i].district_id + '">' + result[i].district_name + '</option>' 240 } 241 228 242 } 229 243 $("#form-field-district").html(content); 230 244 } 231 } 232 233 }); 245 }); 246 }); 247 });
Note: See TracChangeset
for help on using the changeset viewer.