Bedhoel

plasma_1

Feb 3rd, 2019
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function call_pop_up(loket,no_antrian){
  2.       swal({
  3.         title: '<span style="font-size:50px">No Antrian</span>',
  4.         html: '<span style="color:red;font-size:130px">'+no_antrian+' <br/> Loket '+loket+'</span>',
  5.         showCancelButton: false,
  6.         showConfirmButton: false,
  7.         animation: false
  8.         });
  9.   }
  10.   function call_ajax_antrian(){
  11.       $.ajax({
  12.        url: 'ajax/ajax_antrian',
  13.        type: 'POST',
  14.        success: function(data) {
  15.            $("#ajax_data").html(data);
  16.        }
  17.      });
  18.   }
  19.   call_ajax_antrian();
  20.   setInterval(function() {
  21.       call_ajax_antrian();
  22.        $.ajax({
  23.         url: 'ajax/jam',
  24.         type: 'POST',
  25.          success: function(data_jam) {
  26.            $("#tgl").html(data_jam);
  27.       }
  28.       });
  29.     }, 2000);
  30.  
  31.    //Start Pop Up
  32.    var antrian_current;
  33.     setInterval(function() {
  34.         $.ajax({
  35.           url: 'ajax/ajax_pop_up',
  36.           type: 'POST',
  37.            success: function(mydata) {
  38.             if(mydata!="no_data"){
  39.                  var arr = mydata.split('%%$$%%');
  40.                  if(antrian_current==""){
  41.                     antrian_current = mydata;
  42.                     call_pop_up(arr[0],arr[1]);  
  43.                  }
  44.                  else {
  45.                     if(mydata!=antrian_current){
  46.                         call_pop_up(arr[0],arr[1]);
  47.                     }
  48.                  }
  49.             }
  50.             else {
  51.                swal.close();
  52.             }
  53.           }
  54.         });
  55.     }, 2000);
  56.    //End Pop Up
Advertisement
Add Comment
Please, Sign In to add comment