-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.php
executable file
·84 lines (77 loc) · 2.66 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html>
<head>
<title>Golden Pharmaceutical</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<style type="text/css" media="screen">
body{
background-image: url("img/logo.png");
background-size: 15% 40%;
background-position: center;
background-repeat: no-repeat;
}
</style>
</head>
<body>
<div class="row">
<div class="col-sm-4">
</div>
<div class="col-sm-4">
<img src="img/bg.png" style="height: 150px;width: 430px;" alt="">
</div>
<div class="col-sm-4">
</div>
</div>
<div class="row">
<div class="col-sm-4">
</div>
<div class="col-sm-4">
<form action="" method="POST">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1"><li class="fa fa-id-badge fa-lg"></li></span>
<input type="text" name="username" class="form-control" placeholder="Username" required="">
</div>
<div class="input-group">
<span class="input-group-addon" id="basic-addon1"><li class="fa fa-key fa-sm"></li></span>
<input type="password" name="password" class="form-control" placeholder="Password" required="">
</div>
<button class="btn btn-primary form-control" type="submit" name="login"><li class="fa fa-sign-in fa-lg"></li> Login</button>
</form>
</div>
<div class="col-sm-4">
</div>
</div>
<div class="row">
<div class="col-sm-4">
</div>
<div class="col-sm-4">
<?php
include 'php/config.php';
include 'php/crud.php';
$oop = new CRUD();
if (isset($_POST['login'])) {
$user = mysqli_real_escape_string($db,$_POST['username']);
$pass = mysqli_real_escape_string($db,$_POST['password']);
$sql = $oop->login($user,$pass);
if (!$sql) {
?>
<div class="alert alert-warning alert-dismissable">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>Invalid Username and Password!</strong> Try Again.
</div>
<?php
}
}
?>
</div>
<div class="col-sm-4">
</div>
</div>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>
</body>
</html>