Changeset 906 for pro-violet-viettel/sourcecode/assets/js
- Timestamp:
- Apr 23, 2015 12:00:06 PM (10 years ago)
- Location:
- pro-violet-viettel/sourcecode/assets/js
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/assets/js/admin/collaborator.js
r576 r906 9 9 {$(".error").html(""); 10 10 $.ajax({ 11 url: " cong_tac_vien/them",11 url: "/admin/cong_tac_vien/them", 12 12 type: "POST", 13 13 data: $("#add_user").serialize(), 14 14 success: function (data, textStatus, jqXHR) 15 15 { 16 console.log(data); 16 17 $result = jQuery.parseJSON(data); 17 18 if ($result.success == "1") … … 41 42 { 42 43 $.ajax({ 43 url: ' cong_tac_vien/cap_nhat',44 url: '/admin/cong_tac_vien/cap_nhat', 44 45 type: "POST", 45 46 data: $("#editUser_"+id).serialize(), … … 73 74 { 74 75 $.ajax({ 75 url: ' cong_tac_vien/xoa_cong_tac_vien',76 url: '/admin/cong_tac_vien/xoa_cong_tac_vien', 76 77 type: "POST", 77 78 data: $("#editUser_"+id).serialize(), -
pro-violet-viettel/sourcecode/assets/js/admin/user.js
r883 r906 104 104 { 105 105 result = jQuery.parseJSON(data); 106 content = " ";106 content = "<option></option>"; 107 107 if (result != null){ 108 108 for (var i in result){ … … 113 113 } 114 114 } 115 $(".form-field-district").html(content);115 116 116 } 117 $(".form-field-district").html(content); 117 118 } 118 119 }); … … 127 128 { 128 129 result = jQuery.parseJSON(data); 129 content = " ";130 content = "<option></option>"; 130 131 if (result != null){ 131 132 for (var i in result){ 132 133 content = content + '<option value="' + result[i].district_id + '">'+ result[i].type + " " + result[i].district_name + '</option>' 133 134 } 134 $(".form-field-district").html(content);135 135 } 136 $(".form-field-district").html(content); 136 137 } 137 138 }); … … 140 141 $(document).ready(function(){ 141 142 $(".form-field-province").change(function(){ 142 //alert("OK");143 143 changeEventProvince(); 144 144 }); -
pro-violet-viettel/sourcecode/assets/js/collaborator/collaborator.js
r883 r906 1 (function($){ 2 $.fn.setCursorToTextEnd = function() { 3 $initialVal = this.val(); 4 this.val($initialVal + ' '); 5 this.val($initialVal); 6 }; 7 })(jQuery); 1 8 $(document).on('change', '.upload', function() { 2 9 var path = this.value; … … 22 29 cache: false, 23 30 success: function(data){ 31 console.log(data) 24 32 $("#charging").css('display', 'none'); 25 33 $("#result").html(data); 26 34 }, 27 35 error: function(data){ 36 console.log(data); 28 37 } 29 38 }); … … 32 41 33 42 }); 43 44 function updateInfo() { 45 $.ajax({ 46 url: '/collaborator/collaborator/updateCollaborator/', 47 type: 'POST', 48 data: $("#frm-update-info").serialize(), 49 success: function (data, textStatus, jqXHR) 50 { 51 result = jQuery.parseJSON(data); 52 if (result.success == "1") 53 { 54 $("#updateInfoSuccess").modal('show'); 55 $("#close").click(function(){ 56 window.location.reload(true); 57 }); 58 59 } 60 else 61 { 62 //console.log(result.errors); 63 for (var key in result.errors) 64 { 65 console.log(result.errors[key]['field']); 66 $('#' + result.errors[key]['field']).html(result.errors[key]['content']); 67 } 68 } 69 } 70 }); 71 } 34 72 35 73 function changePassword(collaborator_id) -
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 }); -
pro-violet-viettel/sourcecode/assets/js/frontend/user.js
r883 r906 302 302 } 303 303 } 304 $(".form-field-district").html(content); 305 } 304 305 } 306 $(".form-field-district").html(content); 306 307 } 307 308 }); … … 317 318 { 318 319 result = jQuery.parseJSON(data); 319 content = " ";320 content = "<option></option>"; 320 321 if (result != null){ 321 322 for (var i in result){ 322 323 content = content + '<option value="' + result[i].district_id + '">'+ result[i].type + " " + result[i].district_name + '</option>' 323 324 } 324 $(".form-field-district").html(content); 325 } 325 326 } 327 $(".form-field-district").html(content); 326 328 } 327 329 });
Note: See TracChangeset
for help on using the changeset viewer.