-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd.php
133 lines (120 loc) · 4.68 KB
/
add.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
<html>
<?php
session_start();
if($_SESSION['STATUS']!="Online")
header('Location: login.php');
?>
<?php
error_reporting(E_ERROR | E_PARSE);
if($_REQUEST["btn"])
{
$value=1;
$email=$_REQUEST['e-mail'];
$host="localhost";
$username="root";
$password="";
$dbname="dbs";
$conn = mysqli_connect($host, $username, $password,$dbname);
$query="select User_ID from e_user where E_mail='$email'";
$result=mysqli_query($conn,$query);
$row=mysqli_fetch_assoc($result);
$uid=$row['User_ID'];
session_start();
$_SESSION['user_id']=$uid;
$_SESSION['email']=$email;
if($uid==NULL)
{
session_start();
$_SESSION['status']="NEW";
header('Location: addUser.php');
}
else
{
session_start();
$_SESSION['status']="OLD";
header('Location: addVehicle.php');
}
}
?>
<link rel="stylesheet" type="text/css" href="style.css">
<body>
<div id="menu">
<img src="logo.PNG" >
<nav>
<a href="admin.php">Home</a>
<a href="about.php">About</a>
<a href="profile.php">Profile</a>
<a href="login.php">Log Out</a>
</nav>
</div> <div id="leftdiv">
<ul>
<li >Wardon
<ul>
<a href="addWarden.php" ><li>Add Wardon</li></a>
<a href="removeWarden.php" > <li>Remove Wardon</li></a>
<a href="changeArea.php" > <li>Change Area</li></a>
<a href="listWardon.php" > <li>List Wardons</li></a>
</ul>
</li>
<li >Vehicle
<ul>
<a href="add.php" ><li>Add Vehicle</li></a>
<a href="removeVehicle.php" ><li>Remove Vehicle</li></a>
<a href="listVehicle.php" ><li>List All Vehicle</li></a>
</ul>
</li>
<li >User
<ul>
<a href="removeUser.php" ><li>Remove User</li></a>
<a href="listUser.php" ><li>List all User</li></a>
</ul></li>
<li >Area
<ul>
<a href="listArea.php" ><li>List all Areas</li></a>
<a href="addArea.php" ><li>Add New Area</li></a>
</ul></li>
<li >Challan
<ul>
<a href="listChallan.php" ><li>List all Challan</li></a>
<a href="changeChallanStatus.php" ><li>Change Status</li></a>
</ul>
</li>
</ul>
</div>
<div id="centerdiv">
<form method="POST">
<h1>Add Vehicle</h1>
<input id="button" type="text" placeholder="E_Mail" name="e-mail" > <br>
<input id="button" type='submit' name="btn" value="Next"><br>
</form>
<?php
if($value==2)
echo "<p style='color:red;'>Record Edited</p>";
else if($value==1)
echo "<p style='color:red;'>Invalid Input</p>";
?>
</div>
<div id="rightdiv">
<img src="user.png">
<?php
session_start();
echo "<table>
<tr>
<td id='usertable'>"."User_ID : "."</td>
<td id='usertable'>". $_SESSION['auser_id'] ."</td>
</tr>
<br>
<tr>
<td id='usertable'>"."Name : "."</td>
<td id='usertable'>". $_SESSION['user_name'] ."</td>
</tr>
<br>
<tr>
<td id='usertable'>"."Email : "."</td>
<td id='usertable'>". $_SESSION['aemail'] ."</td>
</tr>
</table>";
?>
</div>
</body>
</html>