PageSourceSearch

https://board.thaivi.org/ext/mindphp/m_online_course/styles/all/te…/js/m_online_course.js?assets_version=816

js thaivi.org collected 2026-10-02 11:10:35 UTC 12,405 bytes, 326 lines download raw bytes

1$(function(){
2   $(".button.shared_course").click(function(){     
3        //var css_alert = ('.phpbb_alert').attr('class');
4        $('.action-shared').show();
5        $('.show-v2').show();        
6        $('.show-v1').hide();
7        $('.youtube-play').hide();
8   });
9   $(".button.btn-buy").click(function(){     
10    $('#payment-popup').show();
11     var url_pop = $(this).attr('data-url');
12     var course_id = $(this).attr('data-value');
13
14       data = { course_id : course_id };
15        $.ajax({
16                type:'post',
17                url:url_pop,             
18                data:data, 
19                contentType: false,
20                cache:false,
21                processData: true,
22                success:function(data2){ 
23                    console.log(data2.action);
24//                    console.log('u_next=='+data2.u_next);
25                    $('#payment-popup').find('.modal-body').html(data2.pay_show);
26                    $('#payment-popup .form_regis .item-submit').find('#cart_id').val(data2.course_id);
27                    if(data2.action == 'register')
28                    {                            
29                            $('#payment-popup .form_regis').html(data2.regis_page);
30                            $('#payment-popup .form_regis .item-submit').find('#save_m').attr('data-url',data2.u_next);
31                            $('#payment-popup #course_member .subtitle-regis').find('a').attr('href',$('input[name="redirect_login"]').val());
32                    }
33                    else
34                    {
35                        if(typeof data2.error != 'undefined')
36                        {  
37                            $('#payment-popup .after_regis').html("<span class='error'>"+data2.error+"</span>");
38                        }
39                        else
40                        {
41                            $('#payment-popup .after_regis').html(data2.regis_page);
42                            $('#payment-popup').find('.button-paid').attr('data-url',data2.u_next);
43                        }
44                    }
45                    
46                }
47          });
48    });
49    
50    $(".button-paid").click(function(){     
51    //console.log('payment');
52    $('#payment-popup').hide();
53    $('#payomise-popup').show();
54     var url_pop = $(this).attr('data-url');
55     var course_id = $(this).attr('data-value');
56    console.log(url_pop);
57       data = { course_id : course_id };
58    $.ajax({
59                type:'post',
60                url:url_pop,             
61                data:data, 
62                contentType: false,
63                cache:false,
64                processData: true,
65                success:function(data2){ 
66                    console.log(data2.action);
67                    $('#payment-popup').find('.modal-body').html(data2.pay_show);
68                    $('#payment-popup').find('.button-paid').attr('data-url',data2.u_next);
69                }
70          });
71    });
72    
73    $("#payment-popup .modal-dialog .close, #payment-popup-buffet .modal-dialog .close").click(function(){   
74       var url = $(this).attr('data-url');
75         data = { mode : 'close' };
76      $.ajax({
77                type:'post',
78                url:url,             
79                data:data, 
80                contentType: false,
81                cache:false,
82                processData: true,
83                success:function(data2){ 
84                    console.log('close');
85                     window.location.reload();
86                }
87          });
88       
89    });
90    $("#underconstr-popup .close").click(function(){     
91        $('#underconstr-popup').hide();
92    });
93    $(".button-doc").click(function(){     
94        $('#underconstr-popup').show();
95    });
96    
97    $(".btn-download").click(function(){     
98        var url_download = $(this).attr('data-url');
99        $.post(url_download, function (result) {
100            console.log('download-cer');
101            if (result.ok === 'sucess') {
102                 window.open(result.file_pdf, '_blank'); 
103            }
104        });
105       
106    });
107//    $(".btn-shared").click(function(){     
108//     $('#facebook-popup').show();
109//    });
110//    $("#facebook-popup .close").click(function(){     
111//        $('#facebook-popup').hide();
112//    });
113//    $(".link-downloadcert").click(function(){     
114//     $('#underconstr-popup').show();
115//    });
116//    $("#save_m").click(function(e){     
117//            e.preventDefault();
118//            console.log('submit');
119//            $('.payment-popup').show();
120//            $('.regis-quick').remove();
121//            $('.paid-zone').show();
122//             return false;
123//    });
124   
125});
126 $(document).ready(function() {
127    var open = $('#s_shop_popup').val();
128    var open_buy = $('#s_course_pop').val();
129//    var url_buffet = $('.list-cousre-view.last').attr('data-url');
130    if(open == 1)
131    {
132        open_popup(); //$('.btn-buy'),click();
133    }
134    if(open_buy == 1)
135    {
136        $(".button.btn-buy, .button.btn-buffet").click(); //$('.btn-buy'),click();
137    }
138//    if(url_buffet != "")
139//    {
140//        show_buffet(url_buffet);//$('.btn-buy'),click();
141//    }
142});
143function open_popup(){
144    $('#paystatus-popup').show();
145     var url_pop = $('#s_shop_popup').attr('data-url');
146     var course_id = $('#s_shop_popup').attr('data-value');
147    
148       data = { course_id : course_id };
149        $.ajax({
150                type:'post',
151                url:url_pop,             
152                data:data, 
153                contentType: false,
154                cache:false,
155                processData: true,
156                success:function(data2){ 
157                    console.log(data2.pay_show);
158                    $('#paystatus-popup .loading').hide();
159                    if(data2.action == 'pending')
160                    {
161                        
162                        $('#paystatus-popup').find('.modal-body').html(data2.pay_show+'<br>');
163                        console.log(data2.type_omise);
164                        if(data2.type_omise == 1)
165                        {
166                            setTimeout(function() {
167                                window.location.href = data2.authorize_uri;
168                             }, 60); 
169                            
170                        }
171                        else
172                        {
173                            $('#s_shop_popup').val("");
174                        }
175                        
176                    }
177                    else
178                    {
179                        if(data2.action == 'successful' || data2.action == ''){
180                            $('#paystatus-popup').find('.modal-body').html(data2.pay_show+'<br>');
181//                            window.location.href = data2.u_watch_vdo;
182                            $('#s_shop_popup').val("");
183                        }
184                        else
185                        {
186                            $('#paystatus-popup').find('.modal-body').html(data2.pay_show+'<br>');
187                            $('#s_shop_popup').val("");
188                        }
189                    }
190                }
191          });
192//    });
193}
194$("#paystatus-popup .modal-dialog .close").click(function(){   
195        $('#s_shop_popup').val("");
196        $('#paystatus-popup').hide();
197        
198        console.log('close pop');
199        
200    });
201function next_paid(url,course_id){
202    console.log('next_paid');
203    data = { course_id : course_id };
204    $.ajax({
205            type:'post',
206            url:url,             
207            data:data, 
208            contentType: false,
209            cache:false,
210            processData: true,
211            success:function(data2){ 
212                 console.log('confirm_page'+confirm_page);
213                $('#payment-popup ').find('.after_regis').html(data2.regis_page);
214               
215            }
216      });
217}
218$("button.fav_link").click(function(){   
219    console.log('following');
220    var u_action = $(this).attr('data-url');
221    var u_toggle = $(this).attr('data-toggle');
222    var follow_status = $(this).val();
223    var course_id = $(this).attr('data-id');
224    data = { course_id : course_id,follow_status :  follow_status};
225    $.ajax({
226            type:'post',
227            url:u_action,             
228            data:data, 
229            contentType: false,
230            cache:false,
231            processData: true,
232            success:function(response){ 
233                    console.log('follow_status=='+response.follow_status);
234                    $(".col.c"+course_id+" button.fav_link").attr('data-url',u_toggle);
235                    $(".col.c"+course_id+" button.fav_link").attr('data-toggle',u_action);
236                    $(".col.c"+course_id+" button.fav_link").attr('data-value',response.follow_status);
237                    $(".col.c"+course_id+" button.fav_link").find('img.fav-start').attr('src',response.img_star);
238            }
239      });
240});
241
242$(".btn-buffet").click(function(){     
243//function buy_buffet(val){
244$('#payment-popup-buffet').show();
245 var url_pop = $(".btn-buffet").attr('data-url');
246 var buffet_id = $(".btn-buffet").attr('data-id');
247   data = { buffet_id : buffet_id };
248    $.ajax({
249            type:'post',
250            url:url_pop,             
251            data:data, 
252            contentType: false,
253            cache:false,
254            processData: true,
255            success:function(data2){ 
256//                console.log(data2.action);
257                $('#payment-popup-buffet').find('.modal-body').html(data2.pay_show);
258                $('#payment-popup-buffet .form_regis .item-submit').find('#cart_id').val(data2.course_id);
259                if(data2.action == 'register')
260                {                            
261                        $('#payment-popup-buffet .form_regis').html(data2.regis_page);
262                        $('#payment-popup-buffet .form_regis .item-submit').find('#save_m').attr('data-url',data2.u_next);
263                        $('#payment-popup-buffet #course_member .subtitle-regis').find('a').attr('href',$('input[name="redirect_login"]').val());
264                }
265                else
266                {
267                    if(typeof data2.error != 'undefined')
268                    {  
269                        $('#payment-popup-buffet .after_regis').html("<span class='error'>"+data2.error+"</span>");
270                    }
271                    else
272                    {
273                        $('#payment-popup-buffet .after_regis').html(data2.regis_page);
274                        $('#payment-popup-buffet').find('.button-paid').attr('data-url',data2.u_next);
275                    }
276                }
277
278            }
279      });
280});
281
282function next_paid_buffet(url){
283    console.log('next_paid_buffet');
284    data = { mode : "buffet" };
285    $.ajax({
286            type:'post',
287            url:url,             
288            data:data, 
289            contentType: false,
290            cache:false,
291            processData: true,
292            success:function(data2){ 
293                $('#payment-popup ').find('.after_regis').html(data2.regis_page);
294               
295            }
296      });
297}
298$(".button.btn-buy-free").click(function(){     
299
300     var url_pop = $(this).attr('data-url');
301     var course_id = $(this).attr('data-value');
302
303       data = { course_id : course_id };
304        $.ajax({
305                type:'post',
306                url:url_pop,             
307                data:data, 
308                contentType: false,
309                cache:false,
310                processData: true,
311                success:function(data2){ 
312                        console.log(data2.status);
313                        if(data2.status == 'sucess')
314                        {
315                            //message_thank
316                            $('#paystatus-popup').show();
317                            $('#paystatus-popup .modal-body').html(data2.message_thank);
318                            setTimeout(function() {
319                                window.location.reload();
320                             }, 30); 
321                        }
322                    
323                }
324          });
325    });
326    

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.