-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstructor.php
More file actions
81 lines (59 loc) · 2.21 KB
/
Copy pathinstructor.php
File metadata and controls
81 lines (59 loc) · 2.21 KB
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
<?php
include "inc/header.php";
$db = new Database();
$format = new Format();
?>
<link rel="stylesheet" href="css/login.css">
<?php
if (isset($_SESSION['name'])) {
Format::jumpTo("index.php",'');
}
if(isset($_POST['submit']))
{
$email=$format->Stext($_POST['email']);
$pass=$format->Spsk($_POST['pass1']);
$admin="";
$mem="";
$status='active';
$query = "SELECT * FROM instructor WHERE ins_login='$email' AND ins_pass='$pass' AND ins_status='$status'";
$read =$db->select($query);
if($read)
{
if($row=$read->fetch_assoc()){
$_SESSION['ins_name'] = $row['ins_name'];
$_SESSION['ins_login'] = $row['ins_login'];
$_SESSION['ins_id'] = $row['ins_user_id'];
Format::jumpTo("instructor-panel.php",'Login Successfully.');
}
else{
Format::jumpTo("instructor.php",'Something went wrong.', 'error');
}
}
else{
Format::jumpTo("instructor.php",'Something went wrong.', 'error');
}
}
?>
<div class="m-justify">
<div class="m-card">
<div class="m-card-body">
<form class="form-signin" action="" method="POST">
<h1 class="h3 mb-3 font-weight-normal">Sign In as Instructor</h1>
<p> <mark> <strong>You can't login</strong> with instructor account until Admin aprove your account. <br>
Contact Admin for aprove you ID</mark> </p>
<div class="m-input-group">
<input type="email" name="email" id="inputEmail" class="m-form-control text-dark" required autofocus>
<label for="inputEmail">Email address</label>
</div>
<div class="m-input-group">
<input type="password" name="pass1" id="inputPassword" class="m-form-control text-dark" required>
<label for="inputPassword">Password</label>
</div>
<a class="float-left" href="recover.php">Forget Account?</a>
<p class="float-right">Don't have an account? <a href="instructor-register.php">Register as a Instructor</a></p>
<button class="btn btn-lg btn-primary btn-block" name="submit" type="submit">Sign in</button>
</form>
</div>
</div>
</div>
<?php include "inc/footer.php"; ?>