forked from RittickSR/EIN_Website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
employeradd.php
88 lines (73 loc) · 2.52 KB
/
employeradd.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
<?php
session_start();
?>
<html>
<head>
<title>ADD EMPLOYEES</title>
<link rel="stylesheet" type="text/css" href="style/erlogin.css">
<link rel="stylesheet" type="text/css" href="style/login.css">
</head>
<body>
<nav class="navbar">
<span class="open-slide">
<a href="#" onclick="openSlideMenu()">
<svg width="30" height="30">
<path d="M0,5 30,5" stroke="#fff" stroke-width="5"/>
<path d="M0,14 30,14" stroke="#fff" stroke-width="5"/>
<path d="M0,23 30,23" stroke="#fff" stroke-width="5"/>
</svg>
</a>
<a href="logout.php">SIGN OUT</a>
</span>
</nav>
<div id="side-menu" class="side-nav">
<a href="#" class="btn-close" onclick="closeSlideMenu()">×</a>
<a href="employerlogin.php">HOME</a>
<a href="employadd.php">ADD EMPLOYEE</a>
<a href="editaccess.php">Edit</a>
<a href="employrem.php">REMOVE</a>
<a href="employeradd.php">ADD EMPLOYER</a>
<a href="sign.php">REGISTER EMPLOYEE</a>
</div>
<div id="main">
<h1>ADD EMPLOYER</h1>
<div class="login">
ENTER USERNAME AND PASSWORD
<form id="loginf" method="post" action="">
USERNAME
<input name="uname" type="text" class="formc" required><br>
PASSWORD
<input name="pass" type="text" class="formc" required><br>
<input name="submit" type="submit" class="formsub" >
</form></div>
</div>
<?php
if(isset($_POST['submit']))
{
$username=$_POST['uname'];
$password=$_POST['pass'];
$db=$_SESSION['username'];
$con= mysqli_connect('localhost','root','',"$db") or die('UNABLE TO CONNECT');
$query="INSERT INTO employerlist (username,password) values('$username','$password')";
$query_run= mysqli_query($con,$query);
if($query_run==true)
{
echo '<script type="text/javascript"> alert("employer details inserted")</script>';
}
else
{
echo '<script type="text/javascript"> alert("employer details unable to insert")</script>';
}
}
?>
<script>
function openSlideMenu(){
document.getElementById('side-menu').style.width = '250px';
document.getElementById('main').style.marginLeft = '250px';
}
function closeSlideMenu(){
document.getElementById('side-menu').style.width = '0';
document.getElementById('main').style.marginLeft = '0';
}
</script>
</body></html>