-
Notifications
You must be signed in to change notification settings - Fork 31
/
index.php
51 lines (47 loc) · 1.49 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
session_start();
if(isset($_SESSION['admin'])){
header('location: admin/home.php');
}
if(isset($_SESSION['voter'])){
header('location: home.php');
}
?>
<?php include 'includes/header.php'; ?>
<body class="hold-transition login-page">
<div class="login-box">
<div class="login-logo">
<b>Voting System</b>
</div>
<div class="login-box-body">
<p class="login-box-msg">Sign in to start your session</p>
<form action="login.php" method="POST">
<div class="form-group has-feedback">
<input type="text" class="form-control" name="voter" placeholder="Voter's ID" required>
<span class="glyphicon glyphicon-user form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input type="password" class="form-control" name="password" placeholder="Password" required>
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div class="row">
<div class="col-xs-4">
<button type="submit" class="btn btn-primary btn-block btn-flat" name="login"><i class="fa fa-sign-in"></i> Sign In</button>
</div>
</div>
</form>
</div>
<?php
if(isset($_SESSION['error'])){
echo "
<div class='callout callout-danger text-center mt20'>
<p>".$_SESSION['error']."</p>
</div>
";
unset($_SESSION['error']);
}
?>
</div>
<?php include 'includes/scripts.php' ?>
</body>
</html>