Advertisement
Guest User

Untitled

a guest
Oct 30th, 2017
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function hide()
  2.             {
  3.                 $('#1').hide();
  4.                 $('#2').hide();
  5.                 $('#3').hide();
  6.                 $('#4').hide();
  7.             }
  8.  
  9.             function echoData(data)
  10.             {
  11.                 if(data == 1)
  12.                 {
  13.                     $('#1').show();
  14.                     setTimeout(function()
  15.                     {
  16.                         $('#1').hide();
  17.                     }, 15000);
  18.                 }
  19.  
  20.                 if(data == 2)
  21.                 {
  22.                     $('#2').show();
  23.                     setTimeout(function()
  24.                     {
  25.                         $('#2').hide();
  26.                     }, 15000);
  27.                 }
  28.  
  29.                 if(data == 3)
  30.                 {
  31.                     $('#3').show();
  32.                     setTimeout(function()
  33.                     {
  34.                         $('#3').hide();
  35.                     }, 15000);
  36.                 }
  37.  
  38.                 if(data == 4)
  39.                 {
  40.                     $('#4').show();
  41.                     setTimeout(function()
  42.                     {
  43.                         window.location = 'home.php';
  44.                         $('#4').hide();
  45.                     }, 1000);
  46.                 }
  47.             }
  48.            
  49.             function login()
  50.             {
  51.                 hide();
  52.                 $.post('modules/login.php',
  53.                     {
  54.                         username: $('#username').val(),
  55.                         password: $('#password').val(),
  56.                         port : $('#port').val()
  57.                     }
  58.                 )
  59.                 .done(function(data)
  60.                 {
  61.                     echoData(data);
  62.                 });
  63.             }
  64.  
  65.             $('#loginform').submit(function(event)
  66.             {
  67.                 login();
  68.                 event.preventDefault();
  69.             });
  70.            
  71.             $(document).ready(function()
  72.             {
  73.                 hide();
  74.             });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement