-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwel.php
88 lines (82 loc) · 2.01 KB
/
wel.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();
require_once('db.php');
?>
<html>
<head>
<style>
.fo{
border-radius : 20px;
background-color: white;
border: 3px solid #000000;
width: 500px;
margin: 0 auto;
margin-bottom:20px;
font-weight:bold;
font-size:15px;
padding:10px;
}
}
</style>
<center> <h1>EMPLOYEE MANAGEMENT SYSTEM<h1>
<h3>Employee Details</h3>
</center>
</head>
<body>
<center><h1>
<?php
if (isset($_SESSION['id'])){
$apn= $_SESSION['id'];
echo "Employee ID: " . $apn . "";
}
?>
<form action="wel.php" class="fo" method="post">
<br><button type="Submit" name="view">View details</button>
<button type="Submit" name="salary">Salary details</button>
<a href="logout.php"><button type="button" name="view">Log out</button></a>
<?php
if(isset($_POST['view'])){
$con=connect();
$id=$_SESSION['id'];
$sql="SELECT * from emp where id='$id'";
$result =$con->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "<br><br>Employee ID: " . $row["id"]."<br>";
echo "Name: " . $row["fn"]. $row["mn"]. $row["ln"]."<br>" ;
echo "Date Of Birth: " . $row["dob"]."<br>";
echo "Gender: " . $row["gender"]."<br>";
echo "Department: " . $row["dept"]."<br>";
echo "Job:" . $row["Job"]."<br>";
echo "Contact: " . $row["phone"]."<br>";
echo "E-Mail ID: " . $row["email"]."<br>";
echo "Address: " . $row["address"]."<br>";
echo "Salary: " . $row["sal"]."<br>";
}
} else {
echo "0 results";
}
}
?>
<?php
if(isset($_POST['salary'])){
$con=connect();
$id=$_SESSION['id'];
$sql="SELECT * from emp where id='$id'";
$result = $con->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<br><br>Employee Id: " . $row["id"]."<br>";
echo "Name: " . $row["fn"].$row["mn"].$row["ln"]."<br>" ;
echo "Salary: ". $row["sal"]."<br>";
}
} else {
echo "0 results";
}
}
?>
</center>
</form>
</body>
</html>