[396] | 1 | (function($){
|
---|
| 2 | $.fn.setCursorToTextEnd = function() {
|
---|
| 3 | $initialVal = this.val();
|
---|
| 4 | this.val($initialVal + ' ');
|
---|
| 5 | this.val($initialVal);
|
---|
| 6 | };
|
---|
[644] | 7 | })(jQuery);
|
---|
| 8 |
|
---|
| 9 | function regisHistory(id, page)
|
---|
| 10 | {
|
---|
| 11 | $.ajax({
|
---|
| 12 | url: '/frontend/user/regis_history/'+id +'/page/'+page,
|
---|
| 13 | type: 'POST',
|
---|
| 14 | success: function(data)
|
---|
| 15 | {
|
---|
| 16 | results = jQuery.parseJSON(data);
|
---|
| 17 | paging = results.paging;
|
---|
| 18 | result = results.packagelogs;
|
---|
| 19 | content = "";
|
---|
| 20 | if(result.length>0){
|
---|
| 21 | for (var i in result)
|
---|
| 22 | {
|
---|
[773] | 23 | content += '<tr><td class="center">'+result[i].source+'</td><td class="center">'+result[i].amount+'</td><td class="center">'+result[i].p_name+'</td><td>'+result[i].created_time+'</td></tr>';
|
---|
[644] | 24 |
|
---|
| 25 | }
|
---|
| 26 | }else
|
---|
| 27 | {
|
---|
[773] | 28 | content += '<tr><td class="center" colspan=4>Chưa ÄÄng kà gói dá»ch vụ nà o!</td></tr>';
|
---|
[644] | 29 | }
|
---|
| 30 | $("#user-history").find("#content-regis-histoty").html(content);
|
---|
| 31 | $("#user-history").find("#regis-pagination").html(paging);
|
---|
[645] | 32 | $("#regis-pagination .ajax_paging").click(function ()
|
---|
[644] | 33 | {
|
---|
| 34 | $.ajax({
|
---|
| 35 | url: $(this).attr("href"),
|
---|
| 36 | type: "POST",
|
---|
| 37 | success: function (data, textStatus, jqXHR)
|
---|
| 38 | {
|
---|
| 39 | results = jQuery.parseJSON(data);
|
---|
| 40 | regisHistory(id, results.current_page);
|
---|
| 41 | },
|
---|
| 42 | error: function ()
|
---|
| 43 | {
|
---|
| 44 | $(".ajaxloading").hide();
|
---|
| 45 | }
|
---|
| 46 | });
|
---|
| 47 | return false;
|
---|
| 48 | });
|
---|
| 49 |
|
---|
| 50 | }
|
---|
| 51 | });
|
---|
| 52 | }
|
---|
| 53 |
|
---|
| 54 | function tradeHistory(id, page)
|
---|
| 55 | {
|
---|
| 56 | $.ajax({
|
---|
[725] | 57 | url: '/frontend/user/getUserInfor/'+id +'/page/'+page,
|
---|
[644] | 58 | type: 'POST',
|
---|
| 59 | success: function(data)
|
---|
| 60 | {
|
---|
[725] | 61 |
|
---|
[644] | 62 | results = jQuery.parseJSON(data);
|
---|
[725] | 63 |
|
---|
| 64 | $("#content-trade-histoty").html(results.modal);
|
---|
| 65 |
|
---|
[644] | 66 | }
|
---|
| 67 | });
|
---|
| 68 | }
|
---|
| 69 |
|
---|
[725] | 70 |
|
---|
[644] | 71 | function getUserHistory(id, page)
|
---|
| 72 | {
|
---|
| 73 | regisHistory(id, page);
|
---|
| 74 | tradeHistory(id, page);
|
---|
| 75 | $("#user-history").modal('show');
|
---|
[725] | 76 | }
|
---|
| 77 |
|
---|
| 78 | function admin_update_user()
|
---|
| 79 | {
|
---|
| 80 |
|
---|
| 81 | $.ajax({
|
---|
| 82 | url: '/frontend/user/adminUpdateUser/',
|
---|
| 83 | type: 'POST',
|
---|
| 84 | data: $("#admin_update_user_form").serialize(),
|
---|
| 85 | success: function(data)
|
---|
| 86 | {
|
---|
| 87 |
|
---|
| 88 | results = jQuery.parseJSON(data);
|
---|
| 89 |
|
---|
| 90 | if(results.success==1)
|
---|
| 91 | {
|
---|
| 92 | $('#user-history').modal('hide');
|
---|
[773] | 93 | //alert("Äã cáºp nháºt");
|
---|
[770] | 94 | location.reload();
|
---|
[725] | 95 | }
|
---|
| 96 |
|
---|
| 97 | }
|
---|
| 98 | });
|
---|
[644] | 99 | } |
---|