Guest User

Untitled

a guest
Mar 1st, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.82 KB | None | 0 0
  1. <?php include('connection.php'); ?>
  2.  
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <meta charset="utf-8" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1" />
  8. <meta name="apple-mobile-web-app-capable" content="yes" />
  9. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  10. <title>ADMINISTRATIVE LOGIN</title>
  11. <link rel="stylesheet" href="css/jquery.mobile-1.2.0.min.css" />
  12. <link rel="stylesheet" href="css/my.css" />
  13. <script src="javascript/jquery.min.js">
  14. </script>
  15. <script src="javascript/jquery.mobile-1.2.0.min.js">
  16. </script>
  17. <script src="javascript/my.js">
  18. </script>
  19. <!-- User-generated css -->
  20. <style>
  21. </style>
  22. <!-- User-generated js -->
  23. <script>
  24. try {
  25.  
  26. $(function() {
  27.  
  28. });
  29.  
  30. } catch (error) {
  31. console.error("Your javascript has an error: " + error);
  32. }
  33. </script>
  34. </head>
  35.  
  36. <!-- Home -->
  37. <body>
  38.  
  39. <?php
  40. if(isset($_POST['cmdSubmit']))
  41. {
  42. $user = $_POST['txtusername'];
  43. $pass = $_POST['txtpassword'];
  44.  
  45. if($user == "" || $pass == "")
  46. {
  47. echo "Either username or password field is empty.";
  48. echo "<br/>";
  49. echo "<a href='login.php'>Go back</a>";
  50. }
  51. else
  52. {
  53. $result = mysql_query($con,"select * from USER_ACCOUNTS where USERNAME='$user' and USERPASS='$pass'")
  54. or die("Could not execute the select query.");
  55.  
  56. $row = mysql_fetch_assoc($result);
  57.  
  58. if(is_array($row) && !empty($row))
  59. {
  60. $validuser = $row['USERNAME'];
  61. $_SESSION['valid'] = $validuser;
  62. }
  63. else
  64. {
  65. echo "Invalid username or password.";
  66. echo "<br/>";
  67. echo "<a href='login.php'>Go back</a>";
  68. }
  69. if(isset($_SESSION['valid']))
  70. {
  71. echo "Welcome ".$_SESSION['valid']."! | <a href='logout.php'>Logout</a>";
  72. echo "<br/>";
  73. echo "<br/>";
  74. echo "<br/>";
  75. echo '<div data-role="nested-list" data-theme="a" data-content-theme="e">
  76. <div data-role="nested-list">
  77. <ul data-role="listview" data-inset="false" data-theme="c">
  78. <li><a href="occupants.php" data-transition="slide"><img src="images/home_32.png" alt="Rooms" class="ui-li-icon"><font face = "Eurostile">OCCUPANTS</font></a></li>
  79. </ul>
  80. <div data-role="collapsible-set" data-theme="a" data-content-theme="e">
  81. <div data-role="collapsible">
  82. <h3><font face = "Eurostile">VIEW</font></h3>
  83. <ul data-role="listview" data-inset="false" data-theme="e">
  84. <li><a href="studClassSched.php" data-transition="slide"><img src="images/home_32.png" alt="Rooms" class="ui-li-icon"><font face = "Eurostile">CLASS SCHEDULE</font></a></li>
  85. <li><a href="stulogged.php" data-transition="slide"><img src="images/home_32.png" alt="Rooms" class="ui-li-icon"><font face = "Eurostile">STUDENT LOGGED RECORD</font></a></li>
  86. </ul>
  87. </div>
  88. </div>
  89. </div>
  90. </div>';
  91. }
  92. }
  93. }
  94. else
  95. {
  96. ?>
  97. <div data-role="page" id="page1">
  98. <h2 id="banner"> Login </h2>
  99. <br><br><br><br><br><br>
  100. <div data-theme="a" data-role="header">
  101. <a href="login.php" data-icon="back">Back</a>
  102. <h5>
  103. <font face="Eurostile">Administrative Login</font>
  104. </h5>
  105. </div>
  106.  
  107. <div data-role="content">
  108. <form id="loginForm" name="loginForm" action="" method="post">
  109. <div data-role="fieldcontain">
  110. <fieldset data-role="controlgroup" data-mini="true">
  111. <font face="Eurostile" size="+1">
  112. <label>Username:</label>
  113. <input name="txtusername" placeholder="Username" value="" type="text"/>
  114. </font>
  115. </fieldset>
  116. </div>
  117.  
  118. <div data-role="fieldcontain">
  119. <fieldset data-role="controlgroup" data-mini="true">
  120. <font face="Eurostile" size="+1">
  121. <label>Password:</label>
  122. <input name="txtpassword" placeholder="Password" value="" type="password"/>
  123. </font></fieldset>
  124. </div>
  125. <font face="Eurostile" size="+1">
  126. <input type="submit" data-inline="true" data-icon="check" data-iconpos="left" value="Login" name="cmdSubmit"/>
  127. </font>
  128. </form>
  129.  
  130. </div>
  131. <?php
  132. }
  133. ?>
  134.  
  135. </body>
  136. </html>
Add Comment
Please, Sign In to add comment