-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjoin_Request.php
More file actions
152 lines (130 loc) · 4.63 KB
/
Copy pathjoin_Request.php
File metadata and controls
152 lines (130 loc) · 4.63 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
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<?php
require "./db_connection.php";
$email = $_COOKIE['useremail'];
$query_11 = "SELECT * FROM Employee WHERE Email = '$email'";
$result_11 = $conn->query($query_11);
$orgName;
$employee_id;
$query;
if ($result_11 === false) {
// Handle the query error here
echo "no account found";
} else {
if ($result_11->num_rows > 0) {
$row_11 = $result_11->fetch_assoc();
$orgName = $row_11["Organization_Name"];
}
if ($orgName == "Your Organization") {
$query = "SELECT * FROM Organization WHERE Email = '$email'";
$result = $conn->query($query);
} else {
$query = "SELECT * FROM Organization WHERE Organization_Name = '$orgName'";
$result = $conn->query($query);
}
$Access_Level;
if ($result->num_rows > 0) {
$row = $result->fetch_assoc();
// Access individual fields by column name
$orgName = $row["Organization_Name"];
$employee_id = $row["Employee_id"];
$Access_Level = $row['Access_Level'];
// echo $orgName;
} else {
echo "error";
}
$query1 = "SELECT * FROM $orgName" . "_" . "$employee_id";
// echo $query1;
$result1 = $conn->query($query1);
}
$Access_Levels = unserialize($Access_Level);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v6.0.0-beta3/css/all.css">
<link rel="stylesheet" href="Styles\All.css" />
<link rel="stylesheet" href="Styles\Typography.css" />
<title>Dashboard</title>
<style>
.small-button {
width: 100px;
}
</style>
</head>
<body>
<!-- <div class="help-support-main-section"> -->
<div class="container">
<!-- Back button with page name -->
<nav class="top">
<a href="profile.php">
<div class="small-circle" style="margin-right: 20px;">
<img src="img\Back.png" alt="Back arrow">
</div>
</a>
<div class="large-head">
<div name="title">Requests</div>
</div>
</nav>
</div>
<div class="container container-subhead">
<span style="text-align: left;"></span>
</div>
<form class="container" method="post" action="./Accept.php">
<input type="hidden" name="emp_id" value="<?php echo $employee_id ?>">
<table>
<thead class="container-body">
<tr>
<td>Empoyeee id</td>
<td>Name</td>
<td style="margin: 0 6vh;">Role</td>
</tr>
</thead>
<tbody class="container-label">
<?php
if ($result1->num_rows > 0) {
while ($row1 = $result1->fetch_assoc()) {
// Access individual fields by column name
$id = $row1["Request_id"];
$REmployee_Name = $row1["REmployee_Name"];
$REmployee_id = $row1["REmployee_id"];
$Role = $row1["Role"];
?>
<tr>
<td>
<?php echo $REmployee_id; ?>
</td>
<td>
<?php echo $REmployee_Name; ?>
</td>
<td>
<select name="Role">
<?php
for ($i = 0; $i < count($Access_Levels); $i++) {
if ($i == (count($Access_Levels) - 1)) {
echo "<option selected value='$Access_Levels[$i]'>$Access_Levels[$i]</option>";
} else {
echo "<option value='$Access_Levels[$i]'>$Access_Levels[$i]</option>";
}
}
?>
</select>
</td>
</tr>
</tbody>
</table>
<?php
echo '<input type="submit" class="small-button safe-button" value="Accept" name="Accept"></input>
<input type="submit" class="small-button safe-button" value="Reject" name="Reject"></input>';
}
}
?>
</form>
</body>
<script>
// function hello(){
// hello("om");
// }
</script>
</html>