forked from LakshayD02/Project-Management-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
101 lines (94 loc) · 2.67 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
session_start();
include 'includes/header2.php';
if(isset($_SESSION['UID']))
header('location:pages/index.php');
?>
<style>
#title1 {
display: block;
width:50%;
height:90px;
background-color: white;
padding:1px;
border-radius:5px;
position:fixed;
top:30%;
z-index: 1000px;
}
#main-bod{
background: url(images/1930875.jpg);
background-repeat: no-repeat;
background-size: cover;
display:flex;
height:calc(100%);
width:calc(100%);
align-items:center;
justify-content:center;
top: 0;
margin:unset
}
</style>
<body id="main-bod">
<div class="col-lg-4">
<div class="panel panel-info" style="">
<div class="panel-heading">
Login
</div>
<div class="panel-body">
<div class="container-fluid">
<form class="form-horizontal" method="POST" id="login_form">
<div class="form-group" id="form-login">
<label for="" class="control-label">Username</label>
<input class="form-control" id="user" name="user" type="text">
</div>
<div class="form-group">
<label for="" class="control-label">Password</label>
<input type="password" name="pass" id="pass" class="form-control">
</div>
<div class="form-group" id="msg">
<div class="col-sm-8 col-sm-offset-8">
<button type="submit" class="btn btn-info">Login</button> <br>
</div>
<div class="col-sm-12">
<div class="alert alert-success" id="correct"> Successfully Log in!</div>
<div class="alert alert-danger" id="error"> Error Log in </div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</body>
<script>
jQuery(document).ready(function(){
jQuery(document).ready(function(){
$("#correct").hide();
$("#error").hide();
jQuery("#login_form").submit(function(e){
e.preventDefault();
var formData = jQuery(this).serialize();
$.ajax({
type: "POST",
url: "includes/login.php",
data: formData,
success: function(html){
if(html=='true' )
{
$('#error').hide();
$("#correct").slideDown();
var delay = 2000;
setTimeout(function(){ window.location = 'pages/index.php?page=home'; }, delay);
}else{
$('#error').slideDown();
var delay = 2000;
setTimeout(function(){ $('#error').slideUp(); }, delay);
}
}
});
return false;
});
});
});
</script>