-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemployee_registration.php
57 lines (52 loc) · 1.56 KB
/
employee_registration.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
<!doctype html>
<?php
include('session.php');
$user_check = $_SESSION['login_user'];
$con = mysqli_connect("localhost","root");
mysqli_select_db($con, "bughound");
$test = "Select userlevel from employees where `username` = '{$user_check}'";
$result = mysqli_query($con, $test);
$row = mysqli_fetch_row($result);
//echo "$row[0]";
if($row[0]==1)
{
echo "<script language='javascript' type='text/javascript'>";
echo "alert('Not an authorize user');";
echo "</script>";
$URL="welcome.php";
echo "<script>location.href='$URL'</script>";
}
?>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="style.css">
<title>Untitled Document</title>
</head>
<body class = "centered-wrapper" bgcolor= "#FFD700">
<form action="Employee2.php" method="post">
<td>Add an Employee:</td>
<br>
<td>Name</td>
<td><input type="text" name="name" required></td>
<br>
<td>User Name</td>
<td><input type="text" name="user_name" required></td>
<br>
<td>Password</td>
<td><input type="password" name="password" required></td>
<br>
<td>User Level</td>
<td><input type="number_format" name="user_level" required></td>
<td></td>
<br><td><input type="submit" name="submit" value="Submit"></td><td> <input type="reset" name="reset" value="Reset"></td><td><input type="button" value="Cancel" id=button1 name=button1 onclick="go_home()"></td>
<script language=Javascript>
function go_home(){
window.location.replace("welcome.php");
}
</script>
</tr>
</table>
</form>
</body>
</html>