-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathadmin.php
95 lines (85 loc) · 3.82 KB
/
admin.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
85
86
87
88
89
90
91
92
93
94
95
<!--Copyrights author: Frankline Bwire-->
<!--insurance management system-->
<!--theme copyrights Colorlib-->
<!--=======User Sign Up/ Registration=========-->
<?php
require 'connect.php';
$usrname='';
$password='';
$errors=array();
// LOGIN USER
if (isset($_POST['admlogin'])) {
$usrname = mysqli_real_escape_string($conn, $_POST['usrname']);
$password = mysqli_real_escape_string($conn, $_POST['password']);
if (empty($usrname)) {
array_push($errors, "Username is required");
}
if (empty($password)) {
array_push($errors, "Password is required");
}
if (count($errors) == 0) {
$password = md5($password);
$query = "SELECT * FROM admin WHERE username='$usrname' AND password='$password'";
$results = mysqli_query($conn, $query);
if (mysqli_num_rows($results) == 1) {
$_SESSION['username'] = $usrname;
$_SESSION['success'] = "You are now logged in";
header('location: adminhome.php');
}else {
array_push($errors, "Wrong username/password combination");
}
}
}
?>
<!--======End User Sign Up/ Registration======-->
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="icon" href="img/l.png" type="image/png">
<title>Loki Insurance</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/themify-icons.css">
<link rel="stylesheet" href="vendors/fontawesome/css/all.min.css">
<link rel="stylesheet" href="vendors/owl-carousel/owl.carousel.min.css">
<link rel="stylesheet" href="vendors/animate-css/animate.css">
<!-- main css -->
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/responsive.css">
</head>
<body style="background-image:url(img/towers.jpg)">
<div class="container" style="margin-top:150px;background-image: url(img/background/pattern1.png);">
<div class="row align-items-center">
<div class="col-12">
<div class="row align-items-center">
<div class="col-lg-6 mb-4">
<h2 style="color: #191970; font-weight: bold">LOKI Insurance MIS</h2>
<p class="mb-4" style="color: #fff; font-weight: bold">Loki Insurance company is a web application which is used to tracking the details about the insurance policy, customer details and company details. The company tries to give insurance policy holders quick access to their insurance policy details, modify or update the datails and even renew an expired insurance policy. All this, with a single click on your computer, at the comfort of your home.
</p>
</div>
<!--====Login form====-->
<div class="col-lg-5 ml-auto">
<form action="admin.php" method="post" class="form-box">
<?php include('errors.php'); ?>
<h3 style="color: #191970; font-weight: bold">Administrator Login </h3>
<p>Login as <a href="index.php" style="font-weight: 600">Ordinary User</a></p>
<div class="form-group">
<input type="text" class="form-control" name="usrname" placeholder="Username" required>
</div>
<div class="form-group">
<input type="password" class="form-control" placeholder="Password" name="password" required>
</div>
</form>
<div class="form-group">
<button type="button" class="btn btn-primary btn-pill"><a href="adminhome.php" style="color: white">Login</a></button>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>