-
Notifications
You must be signed in to change notification settings - Fork 1
/
Search.php
36 lines (36 loc) · 1.38 KB
/
Search.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
<?php
$id=$_GET["txtvar"];
$connstr= mysqli_connect("localhost", "root", "","payroll") or die("could not connect server");
$error="";
$sql="select * from employee where id=$id";
$result=mysqli_query($connstr,$sql);
$row=mysqli_fetch_array($result,MYSQLI_BOTH);
if($row['id']!=null)
{
echo "<div align=\"center\">";
echo "<fieldset style=\"width:65%\">";
echo "<legend>"."<h1 style=color:blue;>Employee Details</h1>"."</legend>";
echo "<table cellspacing=\"0\" cellpadding=\"0\" border=\"2\">";
echo "<tr>";
echo "<td>"."<h2 style=\"color:darkmagenta;\">Emp_id</h2>"."</td>";
echo "<td>"."<h2 style=\"color:darkmagenta;\">Name</h2>"."</td>";
echo "<td>"."<h2 style=\"color:darkmagenta;\">DOB</h2>"."</td>";
echo "<td>"."<h2 style=\"color:darkmagenta;\">Contact</h2>"."</td>";
echo "<td>"."<h2 style=\"color:darkmagenta;\">Email</h2>"."</td>";
echo "<td>"."<h2 style=\"color:darkmagenta;\">No. of Days worked</h2>"."</td>";
echo "<td>"."<h2 style=\"color:darkmagenta;\">Salary</h2>"."</td>";
echo "</tr>";
echo "<tr>";
echo "<td>".$row['id']."</td>";
echo "<td>".$row['name']."</td>";
echo "<td>".$row['dob']."</td>";
echo "<td>".$row['contact']."</td>";
echo "<td>".$row['email']."</td>";
echo "<td>".$row['no_of_days_worked']."</td>";
$sal=$row['no_of_days_worked']*700;
echo "<td>".$sal."</td>";
echo "</tr>";
}
else
echo "Employee not found.";
?>