forked from abhishekdudhal/online-shopping
-
Notifications
You must be signed in to change notification settings - Fork 0
/
courierlogin.php
124 lines (105 loc) · 3.58 KB
/
courierlogin.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
<?php
session_start();
require_once("class.user.php");
$login = new USER();
require 'config.php';
if(isset($_POST['btn-login']))
{
$uname = strip_tags($_POST['txt_uname_email']);
$umail = strip_tags($_POST['txt_uname_email']);
$upass = strip_tags($_POST['txt_password']);
$sql=mysql_query("select * from users where user_name='$uname'");
if($sql==false)
{
die(mysql_error());
}
while($mat = mysql_fetch_array($sql))
{
$i=$mat['utype'];
if($i=='ADMIN')
$it=1;
if($i=='COURIER')
$it=0;
}
if($login->doLogin($uname,$umail,$upass))
{
if($i=='COURIER'||$i=='ADMIN')
{
$_SESSION['eid']=$uname;
echo "<script>location.href='courier.php?itemno=$it'</script>";
}
else
{
session_destroy();
header("location:index.php");
}
}
else
{
$error = "Wrong Details !";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> Log-in</title>
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="bootstrap/css/bootstrap-theme.min.css" rel="stylesheet" media="screen">
<link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
</div>
</nav>
<div class="signin-form">
<div class="container">
<form class="form-signin" method="post" id="login-form">
<h2 class="form-signin-heading">Welcome to Engineering Books</h2>
<h2 class="form-signin-heading">COURIER LOGIN</h2><hr />
<div id="error">
<?php
if(isset($error))
{
?>
<div class="alert alert-danger">
<i class="glyphicon glyphicon-warning-sign"></i> <?php echo $error; ?> !
</div>
<?php
}
?>
</div>
<div class="form-group">
<input type="text" class="form-control" name="txt_uname_email" placeholder="Username or E mail ID" required />
<span id="check-e"></span>
</div>
<div class="form-group">
<input type="password" class="form-control" name="txt_password" placeholder="Your Password" />
</div>
<hr />
<div class="form-group">
<button type="submit" name="btn-login" class="btn btn-default">
<i class="glyphicon glyphicon-log-in"></i> SIGN IN
</button>
</div>
</form>
</div>
</div>
<div id="Bottom" align='center'>
<h5 class="down" align='center'><b>DONT USE THIS PROJECT FOR COMMERCIAL PURPOSE</b></h5>
<h5 class="down" align='center'><b>Copyright © ABHISHEK DUDHAL</b></h5>
</div>
</body>
</html>