Guest User

Untitled

a guest
Dec 10th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1.  
  2. // CheckUsername takes parameter username and password from the user and checks if he is a
  3. function checkUsername(username, password) {
  4. if (username == "" && password == "") {
  5. window.alert("Please enter your Username & Password");
  6. } else if (username == "") {
  7. window.alert("Please enter your Username");
  8. } else if (password == "") {
  9. window.alert("Please enter your Password");
  10. } else {
  11. Ext.Ajax.request({
  12. url: 'database.php',
  13. params: {
  14. functionID: 1,
  15. uname: username,
  16. pass: password
  17. },
  18. success: function (response, opts) {
  19. var checked = Ext.util.JSON.decode(response.responseText);
  20. if(checked == true)
  21. {
  22. window.location = "index.html";
  23. }
  24. else
  25. {
  26. alert("Unsuccessful")
  27. }
  28. }
  29. });
  30.  
  31. }
  32. }
  33.  
  34.  
  35. function showUserName(username)
  36. {
  37. var name;
  38. Ext.Ajax.request({
  39. url: 'database.php',
  40. params: {
  41. functionID: 2,
  42. uname: username
  43. },
  44. success: function (response, opts) {
  45. name = response.responseText;
  46. Ext.getCmp('fieldset_index').setTitle("Hello Professor "+name);
  47. }
  48. });
  49. }
Add Comment
Please, Sign In to add comment