forked from RittickSR/EIN_Website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
employrem.php
84 lines (72 loc) · 2.76 KB
/
employrem.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
<?php
require 'dbconfig/cofig.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="sign2.php">REGISTER EMPLOYEE</a>
</div>
<div id="main">
<h1>EMPLOYEE NUMBER</h1>
<div class="login">
ENTER DETAILS
<form id="loginf" method="post" action="">
EIN NUMBER
<input name="uname" type="text" class="formc" required><br>
<input name="submit" type="submit" class="formsub" >
</form></div>
</div>
<?php
if(isset($_POST['submit']))
{
$db=$_SESSION['username'];
$name=$_POST['uname'];
$query="DELETE from employeelist WHERE ein='$name'";
$con1= mysqli_connect('localhost','root','',"$db") or die('UNABLE TO CONNECT');
$query_run= mysqli_query($con1,$query);
echo '<script type="text/javascript"> alert("SUBMITTED")</script>';
if($query_run==true)
{
echo '<script type="text/javascript"> alert("REMOVED")</script>';
}
else
{ echo '<script type="text/javascript"> alert("EMPLOY NOT PRESENT")</script>';}
$con= mysqli_connect('localhost','root','',"sample") or die('UNABLE TO CONNECT');
$sq="UPDATE user SET ename='NULL' WHERE ein='$name'";
$result = mysqli_query($con,$sq) or die('ERROR'); }
?>
<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>