-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBranchAuth.php
145 lines (145 loc) · 4.47 KB
/
BranchAuth.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
<!doctype html>
<html lang="en">
<head>
<title>Authorization</title>
<link rel="stylesheet" href="Layout.css">
<meta charset="utf-8"/>
</head>
<body>
<div id="content">
<?php
require_once('db_connect.php');
if(!empty($_POST))
{
$src='SELECT * FROM branch_auth WHERE user="' . $_POST["user"] . '"';
$response=@mysqli_query($dbc,$src);
if($response)
{
if(mysqli_num_rows($response)>0)
{
$row=mysqli_fetch_array($response);
if($_POST["user"]==$row["user"] && $_POST["pass"]==$row["pass"])
{
echo '<header>'
. '<h3>Enter Branch Details</h3>'
. '</header>'
. '<div id="meat">'
. '<div id="main_section">'
. '<section>'
. '<form action="BranchAdded.php" method="post">'
. '<div class="bdet" id="bno">'
. '<h4>Enter Branch Number</h4>'
. '<input type="text" name="bno" size="5"/>'
. '</div>'
. '<div class="bdet" id="bloc">'
. '<h4>Enter Branch Location</h4>'
. '<input type="text" name="location" size="40"/>'
. '</div>'
. '<div class="bdet" id="bcon">'
. '<h4>Enter Contact No.</h4>'
. '<input type="text" name="contact" size="10"/>'
. '</div>'
. '<div class="bdet">'
. '<button type="submit" name="Enter" value="Enter" class="button" id="bdadd">Enter</button>'
. '</div>'
. '</form>'
. '</section>'
. '</div>'
. '</div>';
}
else
{
echo '<header>'
. '<h3>Authorization</h3>'
. '</header>'
. '<div id="meat">'
. '<div id="main_section">'
. '<section>'
. '<h3 class="error">Authorization Failed, Invalid Password</h3>'
. '</section>'
. '<section>'
. '<form action="BranchAuth.php" method="post">'
. '<div class="adet" id="ausn">'
. '<h4>Enter Username</h4>'
. '<input type="text" name="user"/>'
. '</div>'
. '<div class="adet" id="apass">'
. '<h4>Enter Password</h4>'
. '<input type="password" name="pass"/>'
. '</div>'
. '<div class="adet">'
. '<button type="submit" name="Authorize" value="Authorize" class="button" id="abt">Authorize</button>'
. '</div>'
. '</form>'
. '</section>'
. '</div>'
. '</div>';
}
}
else
{
echo '<header>'
. '<h3>Authorization</h3>'
. '</header>'
. '<div id="meat">'
. '<div id="main_section">'
. '<section>'
. '<h3 class="error">Authorization Failed, Invalid Username</h3>'
. '</section>'
. '<section>'
. '<form action="BranchAuth.php" method="post">'
. '<div class="adet" id="ausn">'
. '<h4>Enter Username</h4>'
. '<input type="text" name="user"/>'
. '</div>'
. '<div class="adet" id="apass">'
. '<h4>Enter Password</h4>'
. '<input type="password" name="pass"/>'
. '</div>'
. '<div class="adet">'
. '<button type="submit" name="Authorize" value="Authorize" class="button" id="abt">Authorize</button>'
. '</div>'
. '</form>'
. '</section>'
. '</div>'
. '</div>';
}
}
else
{
echo '<h3 class="error">Error has occoured</h3>';
}
}
else
{
echo '<header>'
. '<h3>Authorization</h3>'
. '</header>'
. '<div id="meat">'
. '<div id="main_section">'
. '<section>'
. '<form action="BranchAuth.php" method="post">'
. '<div class="adet" id="ausn">'
. '<h4>Enter Username</h4>'
. '<input type="text" name="user"/>'
. '</div>'
. '<div class="adet" id="apass">'
. '<h4>Enter Password</h4>'
. '<input type="password" name="pass"/>'
. '</div>'
. '<div class="adet">'
. '<button type="submit" name="Authorize" value="Authorize" class="button" id="abt">Authorize</button>'
. '</div>'
. '</form>'
. '</section>'
. '</div>'
. '</div>';
}
mysqli_close($dbc);
?>
<footer>
<h5>Copyright ©</h5>
</footer>
</div>
</body>
</html>