-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstaffAssets.php
51 lines (39 loc) · 958 Bytes
/
staffAssets.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
<?php
session_start();
include("dbconn.php");
if ($connection->connect_error) {
die("Connection failed!");
}
$a =$_SESSION['username'];
$id = $_SESSION['id'];
//echo $id;
/*$sql = "SELECT id FROM employee WHERE Email_id='$a'";
$result = mysqli_query($connection,$sql);
if(mysqli_num_rows($result)>0)
{
$row = $result->fetch_assoc();
$result = $row["r_id"];
//echo $result;
}*/
$sql = "SELECT r_id FROM pr_request WHERE e_id='$id'";
$result = $connection->query($sql);
//$row="";
//if($result->num_rows>0)
//{
$row = $result->fetch_array();
$result = $row['r_id'];
/*print_r($row);
print_r($result);*/
//}
$sql = "SELECT * FROM indent WHERE r_id IN('$result')";
$result = $connection->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo $row["p_name"]." ".$row["number"]."<br />";
}
} else {
echo "0 assets";
//echo $id;
}
$connection->close();
?>