-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsel_dep.php
More file actions
43 lines (40 loc) · 2 KB
/
sel_dep.php
File metadata and controls
43 lines (40 loc) · 2 KB
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
<?php
include 'conn.php';
include 'header.php';
if(!(isset($_SESSION['username']) && !empty($_SESSION['username']))){
header('Refresh: 5; url=login.php');
echo "You have not logged in... You will be redirected shortly";
die();
}
?>
<pre> <a href="logout.php" style="text-decoration: none;font-size: 120% ">logout</a></pre>
<h2>Enter the Staff Name to know his/her details </h2>
<form action="sel_dep.php" method="POST">
<input type="text" name="search1">
<input type="submit" value="search">
</form>
<?php
if(isset($_POST['search1'])){
$name11 = $_POST['search1'];
$query21 = "SELECT s.*,d.Dep_Name FROM staff_details s,department d WHERE d.Dep_no=s.Dep_no and s.Name = '$name11' ";
$query_run21 = mysql_query($query21);
if (mysql_num_rows($query_run21) == NULL){
echo 'No Staff of that name found';
die();
}
else{
while($query_row = mysql_fetch_assoc($query_run21)){
$id = $query_row['Staff_id'];
$name12 = $query_row['Name'];
$no = $query_row['Dep_no'];
$salary = $query_row['Salary'];
$address = $query_row['Address'];
$sex = $query_row['Sex'];
$dep_name = $query_row['Dep_Name'];
//$name = $query_row['Name'];
echo "<h4>Staff id: ".$id." "."Name: ".$name12." "."Department no.: ".$no." "."Salary: ".$salary." "."Address: ".$address." "."Sex: ".$sex." "."Department Name: ".$dep_name." </h4>".'<br>';
}
//echo mysql_result($query_run,0,'Customer_Name');
}
}
?>