Advertisement
Guest User

Untitled

a guest
Dec 19th, 2016
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.53 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. require_once('includes/config.php');
  5. error_reporting(E_PARSE | E_ERROR);
  6. require('rightclick.js');
  7.  
  8. if( $user->is_logged_in() ){ header('Location: operation.php'); }
  9.  
  10. //process login form if submitted
  11. if(isset($_POST['submit'])){
  12.  
  13. $username = $_POST['username'];
  14. $password = $_POST['password'];
  15.  
  16. if($user->login($username,$password))
  17. {
  18. $_SESSION['username'] = $username;
  19.  
  20. header('Location: operation.php');
  21.  
  22. exit;
  23.  
  24. } else {
  25.  
  26. $error[] = 'Wrong Employee-Id/Password<br />
  27. or<br />
  28. Your account has not been activated';
  29. }
  30.  
  31. }//end if submit
  32.  
  33. //define page title
  34. $title = 'ATIS-Login';
  35.  
  36. //include header template
  37. require('layout/header.php');
  38. ?>
  39.  
  40.  
  41. <div class="container">
  42.  
  43. <div class="row">
  44.  
  45. <div class="col-xs-12 col-sm-8 col-md-6 col-sm-offset-2 col-md-offset- 3">
  46. <form role="form" method="post" action="" autocomplete="off">
  47.  
  48. <br>
  49. <br>
  50. <br>
  51. <br>
  52.  
  53.  
  54. <center><b><h1>Welcome to ATIS</b></h1></center>
  55. <hr>
  56. <center><h3><p>Not a Member?</p></h3></center>
  57. <a href="signup.php" role="button" class="btn btn-success btn- block btn-lg" tabindex="6">Sign Up</a>
  58. <div class="row voffset2">
  59. <hr>
  60.  
  61. <?php
  62. //check for any errors
  63. if(isset($error)){
  64. foreach($error as $error){
  65. echo '<p class="bg-danger">'.$error.'</p>';
  66. }
  67. }
  68.  
  69. if(isset($_GET['action'])){
  70.  
  71. //check the action
  72. switch ($_GET['action']) {
  73. case 'active':
  74. echo "<h2 class='bg-success'>Your account is now active you may now log in.</h2>";
  75. break;
  76. case 'reset':
  77. echo "<h2 class='bg-success'>Please check your inbox for a reset link.</h2>";
  78. break;
  79. case 'resetAccount':
  80. echo "<h2 class='bg-success'>Password changed, you may now login.</h2>";
  81. break;
  82. }
  83.  
  84. }
  85.  
  86. if(isset($_GET['action']) && $_GET['action'] == 'joined'){
  87. echo "<h3 class='bg-success'>Signup complete<br /> Your account will be activated after approval.</h3>";
  88. }
  89. ?>
  90.  
  91. <div class="form-group">
  92. <input type="text" name="username" id="username" class="form-control input-lg" placeholder="Employee-Id" value="<?php if(isset($error)){ echo $_POST['username']; } ?>" tabindex="1">
  93. </div>
  94.  
  95. <div class="form-group">
  96. <input type="password" name="password" id="password" class="form-control input-lg" placeholder="Password" tabindex="3">
  97. </div>
  98.  
  99. <div class="row">
  100. <div class="row voffset3">
  101. <div class="col-xs-6 col-sm-6 col-md-6">
  102. <div class="form-group">
  103.  
  104.  
  105.  
  106. <input type="submit" name="submit" value="Login" class="btn btn-danger btn-block btn-lg"
  107. tabindex="5"> // This is my submit button.
  108. </div>
  109. </div>
  110.  
  111.  
  112.  
  113.  
  114.  
  115. <div class="col-xs-6 col-sm-6 col-md-6">
  116. <div class="form-group">
  117. <a href="reset.php" role="button" class="btn btn-primary btn-block btn-lg" tabindex="6">Forgot your Password?</a>
  118.  
  119. </div>
  120.  
  121. </div>
  122. </form>
  123. </div>
  124. </div>
  125.  
  126.  
  127.  
  128. </div>
  129.  
  130.  
  131. <?php
  132. //include header template
  133. require('layout/footer.php');
  134. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement