Guest User

Untitled

a guest
Apr 3rd, 2018
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. //browser refresh code
  2. if((localStorage.getItem('is_Reloaded_admin')==true))
  3. {
  4. $.ajax({
  5. type:'Post',
  6. cache: true,
  7. url: 'adminnew.php',
  8. success:function(html)
  9. {
  10. $('#dummy_div').html(html);
  11. }
  12.  
  13. });
  14.  
  15. }
  16.  
  17.  
  18. if((localStorage.getItem('is_Reloaded_super')==true))
  19. {
  20. $.ajax({
  21. type:'Post',
  22. cache: true,
  23. url: 'superadmin.php',
  24. success:function(html)
  25. {
  26. $('#dummy_div').html(html);
  27.  
  28. }
  29.  
  30. });
  31. }
  32.  
  33.  
  34. if((localStorage.getItem('is_Reloaded_normal')==true))
  35. {
  36. $.ajax({
  37. type:'Post',
  38. cache:true,
  39. url: 'dash.php',
  40. success:function(html)
  41. {
  42.  
  43. $('#dummy_div').html(html);
  44.  
  45. }
  46. });
  47. }
  48.  
  49.  
  50.  
  51.  
  52.  
  53. //Based on the conditions given in ny_scripte file
  54. $('#dash_button').click(function()
  55. {
  56. var username = $('#username').val();
  57. var password = $('#password').val();
  58. $('#dummy_div').empty();
  59. $.ajax({
  60. type:'Post',
  61. cache: false,
  62. url: 'ajax_check.php',
  63. data: {username:username,password:password},
  64.  
  65. success:function(html)
  66. {
  67. if(html=="ADMIN")
  68. {
  69.  
  70. $.ajax({
  71. type:'Post',
  72. cache: false,
  73. url: 'adminnew.php',
  74. success:function(html)
  75. {
  76. localStorage.setItem('is_Reloaded_admin',true);
  77. $('#dummy_div').html(html);
  78. }
  79.  
  80. });
  81. }
  82. if(html=="SUPERADMIN")
  83. {
  84.  
  85. $.ajax({
  86. type:'Post',
  87. cache: false,
  88. url: 'superadmin.php',
  89. success:function(html)
  90. {
  91. localStorage.setItem('is_Reloaded_super', true);
  92. $('#dummy_div').html(html);
  93.  
  94. }
  95.  
  96. });
  97. }
  98. if(html=="Normal User")
  99. {
  100.  
  101. $.ajax({
  102. type:'Post',
  103. cache: false,
  104. url: 'dash.php',
  105. success:function(html)
  106. {
  107. localStorage.setItem('is_Reloaded_normal',true);
  108. $('#dummy_div').html(html);
  109.  
  110. }
  111.  
  112. });
  113. }
  114.  
  115. }
  116. });
  117. });
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124. });
Add Comment
Please, Sign In to add comment