-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
151 lines (135 loc) · 5.69 KB
/
login.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<?php
if (isset($_SESSION['user'])) {
header("location:index.php");
}
require_once 'models/user.php';
require_once './views/top.php';
?>
<script>
$(document).ready(function (e) {
$("#btn_moveon").click(function(){
var username = $("#get_username").val();
$.post("process/process_signup.php?action=get_profile", {username: username}, function (data)
{
$("#show").html(data);
});
});
});
</script>
</head>
<body>
<!--logo Area-->
<?php
require_once './views/header.php';
?>
<!--logo area closed-->
<!-- Page Content -->
<!--Middle Nav close-->
<!--Form Registeration-->
<div class="container">
<div class="col-md-3"></div>
<div class="col-md-6">
<div class="page-header text-center">
<h3>
<span class="glyphicon glyphicon-user"></span>
Login
<?php
if (isset($_SESSION['msg'])) {
$msg = $_SESSION['msg'];
unset($_SESSION['msg']);
echo(" - $msg");
}
if (isset($_SESSION['errors'])) {
$errors = $_SESSION['errors'];
unset($_SESSION['errors']);
}
if (isset($_SESSION['obj_user'])) {
$obj_user = unserialize($_SESSION['obj_user']);
} else {
$obj_user = new User();
}
?>
</h3>
</div>
<form id="signup-form" class="form-horizontal" role="form" method="post" action="process/process_login.php" enctype="multipart/form-data" novalidate>
<div class="form-group">
<label class="control-label col-sm-4" for="username">Username:</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="username"
name="username" placeholder="Enter username">
</div>
<span class="col-sm-4"></span>
<span class="col-sm-6" id="username_error">
<?php
if (isset($errors['username'])) {
echo '<div class="alert alert-danger fade in">';
echo '<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>';
echo '<strong>';
echo($errors['username']);
echo '</strong>';
echo '</div>';
}
?>
</span>
</div>
<div class="form-group">
<label class="control-label col-sm-4" for="password">Password:</label>
<div class="col-sm-6">
<input type="password" class="form-control" name="password" placeholder="Enter password">
</div>
<span class="col-sm-4" id="error_msg"></span>
<span class="col-sm-6" id="error_msg">
<?php
if (isset($errors['password'])) {
echo '<div class="alert alert-danger fade in">';
echo '<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>';
echo '<strong>';
echo($errors['password']);
echo '</strong>';
echo '</div>';
}
?>
</span>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-10">
<div class="checkbox">
<label><input type="checkbox" name="remember"> Remember me</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-6">
<button type="submit" class=" form-control btn btn-primary">Login</button>
</div>
</div>
<a class="btn btn-link col-md-offset-4" data-toggle="modal" data-target="#forgot" href="#" >Forget Password</a>
</form>
</div>
</div>
<!--Modal For image details-->
<div class="modal fade" id="forgot" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Enter Username</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" action="users/f_password.php">
<input type="text" name="username" id="get_username" class="form-control">
<input type="button" id="btn_moveon" value="Move on" class="form-control">
</form>
</div>
<div class="modal-footer" id="show"></div>
</div>
</div>
</div>
<hr>
<!-- Footer -->
<?php
require_once "views/footer.php";
?>
<!--Footer-->
</body>
</html>