Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('includes/config.php');
- error_reporting(E_PARSE | E_ERROR);
- require('rightclick.js');
- if( $user->is_logged_in() ){ header('Location: operation.php'); }
- //process login form if submitted
- if(isset($_POST['submit'])){
- $username = $_POST['username'];
- $password = $_POST['password'];
- if($user->login($username,$password))
- {
- $_SESSION['username'] = $username;
- header('Location: operation.php');
- exit;
- } else {
- $error[] = 'Wrong Employee-Id/Password<br />
- or<br />
- Your account has not been activated';
- }
- }//end if submit
- //define page title
- $title = 'ATIS-Login';
- //include header template
- require('layout/header.php');
- ?>
- <div class="container">
- <div class="row">
- <div class="col-xs-12 col-sm-8 col-md-6 col-sm-offset-2 col-md-offset- 3">
- <form role="form" method="post" action="" autocomplete="off">
- <br>
- <br>
- <br>
- <br>
- <center><b><h1>Welcome to ATIS</b></h1></center>
- <hr>
- <center><h3><p>Not a Member?</p></h3></center>
- <a href="signup.php" role="button" class="btn btn-success btn- block btn-lg" tabindex="6">Sign Up</a>
- <div class="row voffset2">
- <hr>
- <?php
- //check for any errors
- if(isset($error)){
- foreach($error as $error){
- echo '<p class="bg-danger">'.$error.'</p>';
- }
- }
- if(isset($_GET['action'])){
- //check the action
- switch ($_GET['action']) {
- case 'active':
- echo "<h2 class='bg-success'>Your account is now active you may now log in.</h2>";
- break;
- case 'reset':
- echo "<h2 class='bg-success'>Please check your inbox for a reset link.</h2>";
- break;
- case 'resetAccount':
- echo "<h2 class='bg-success'>Password changed, you may now login.</h2>";
- break;
- }
- }
- if(isset($_GET['action']) && $_GET['action'] == 'joined'){
- echo "<h3 class='bg-success'>Signup complete<br /> Your account will be activated after approval.</h3>";
- }
- ?>
- <div class="form-group">
- <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">
- </div>
- <div class="form-group">
- <input type="password" name="password" id="password" class="form-control input-lg" placeholder="Password" tabindex="3">
- </div>
- <div class="row">
- <div class="row voffset3">
- <div class="col-xs-6 col-sm-6 col-md-6">
- <div class="form-group">
- <input type="submit" name="submit" value="Login" class="btn btn-danger btn-block btn-lg"
- tabindex="5"> // This is my submit button.
- </div>
- </div>
- <div class="col-xs-6 col-sm-6 col-md-6">
- <div class="form-group">
- <a href="reset.php" role="button" class="btn btn-primary btn-block btn-lg" tabindex="6">Forgot your Password?</a>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- <?php
- //include header template
- require('layout/footer.php');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement