-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrequest-edit-access-panel.php
109 lines (93 loc) · 2.9 KB
/
request-edit-access-panel.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
session_start();
include 'dbh.php';
date_default_timezone_set('Asia/Kolkata');
if(isset($_SESSION['id']))
{
$userId=mysqli_real_escape_string($conn,$_SESSION['id']);
$sqlp="SELECT profilePicLocation,admin,hod,committee FROM faculty_table WHERE id='$userId'";
$resultp=mysqli_query($conn,$sqlp);
$rowp=mysqli_fetch_assoc($resultp);
$profilePicLocation=$rowp['profilePicLocation'];
$admin=$rowp['admin'];
$hod=$rowp['hod'];
$committee=$rowp['committee'];
if($admin==1 || $hod==1 || $committee==1)
{
include 'top.php';
include 'left-nav.php';
?>
<div class="container" style="margin-top: 8px">
<div class="row">
<div class="col offset-md-2 parta" id="part-a-container">
<header>
<h2 class="heading" style="font-size:20px"><b>EDIT ACCESS PANEL</b></h2>
</header>
<p>List of faculties that have applied for Edit Access</p>
<table class="table table-bordered" style="background-color: white">
<thead style="color: white">
<tr>
<th scope="col" style="background-color: #343a40;text-align: center">#</th>
<th scope="col" style="background-color: #343a40;text-align: center">Faculty Name</th>
<th scope="col" style="background-color: #343a40;text-align: center">Form</th>
<th scope="col" style="background-color: #343a40;text-align: center">Grant Access</th>
</tr>
</thead>
<tbody>
<?php
$sql="SELECT facultyId, form, year FROM request_edit_access ORDER BY id DESC";
$result=mysqli_query($conn, $sql);
if(mysqli_num_rows($result)==0)
{
?>
<p>No faculties have applied for edit access</p>
<?php
}
else
{
$counter=0;
while($row=mysqli_fetch_assoc($result))
{
$facultyId=$row['facultyId'];
$form=$row['form'];
$year=$row['year'];
$counter+=1;
$sqln="SELECT faculty_name FROM faculty_table WHERE id='$facultyId'";
$resultn=mysqli_query($conn,$sqln);
$rown=mysqli_fetch_assoc($resultn);
$faculty_name=$rown['faculty_name'];
?>
<tr id="ga<?php echo $counter; ?>">
<td><?php echo $counter; ?></td>
<td><?php echo $faculty_name; ?></td>
<td>Form <?php echo $form; ?> ~ <?php echo ($year-1).'-'.$year; ?></td>
<td>
<form class="grant-access-form" action="" method="POST">
<input type="hidden" name="counter" value="<?php echo $counter; ?>">
<input type="hidden" name="facultyId" value="<?php echo $facultyId; ?>">
<input type="hidden" name="year" value="<?php echo $year; ?>">
<input type="hidden" name="form" value="<?php echo $form; ?>">
<button type="submit" name="submit" class="btn btn-primary" id="ga<?php echo $id; ?>">Grant Access</button>
</form>
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
<?php
}
else
{
header("LOCATION: userprofile.php");
}
}
else
{
header("LOCATION: index.php");
}