-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewPendingAdmin.php
157 lines (147 loc) · 4.34 KB
/
viewPendingAdmin.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
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
153
154
155
156
157
<?php
session_start();
function __autoload($class_name) {
require_once('Database.php');
require_once('User.php');
}
?>
<!DOCTYPE html>
<html>
<title>Financial Grant Management System</title>
<head>
<script>
$(document).ready(function(){
$('ul.tabs').tabs();
});
$(document).ready(function(){
$('ul.tabs').tabs('select_tab', 'tab_id');
});
</script>
<style>
ul {
list-style-type: none;
margin:auto;
margin-left:0px;
padding: 0;
margin:5%;
overflow: hidden;
background-color: #009688;
color:#ffcdd2;
}
li {
float: left;
width:16.66%;
}
li a {
display: block;
color: white;
text-align: center;
padding: 16px;
text-decoration: none;
font-family: GillSans, Calibri, Trebuchet, sans-serif;
font-size:16px;
}
li a:hover {
background-color:#00E5EE;
font-weight: bold;
color:gray;
}
table{
border-collapse: collapse;
margin:auto;
width: 80%;
margin-top:20px;
font-family: GillSans, Calibri, Trebuchet, sans-serif;
}
th, td {
text-align: center;
font-family: GillSans, Calibri, Trebuchet, sans-serif;
height:50px;
}
tr:nth-child(even){background-color: #D0D0D0}
tr:nth-child(odd){background-color: #f0f0f0}
th {
background-color: #009688;
color: white;
}
td{
height:50px;
}
</style>
</head>
<img src="logo.png" style="width:69.84px;height:75.76px;" ><h1 style="color:black; font-family:Comic Sans MS, cursive, sans-serif; font-size:30px; font-weight: bold; margin-top:-5%; margin-left:1%;" align ="center">Indian Institute Of Technology,Jodhpur</h1>
<body style="width:99%; height:100%;">
<div class="row">
<div class="col s12">
<ul style="color:white;margin-top:3%;">
<li class="tab col s2"><a style="color:white;" target="_self" href="profile_admin.php">HOME</a></li>
<li class="tab col s2"><a style="color:white;" target="_self" href="viewPendingAdmin.php">PENDING GRANTS</a></li>
<li class="tab col s2"><a style="color:white;" target="_self" href="viewGrantsAdmin.php">VIEW OLD GRANTS</a></li>
<li class="tab col s2"><a style="color:white;" target="_self" href="removeApplicant_layout.php">REMOVE APPLICANT</a></li>
<li class="tab col s2"><a style="color:white;" target="_self" href="grantMoney_layout.php">GRANT MONEY</a></li>
<li class="tab col s2"><a style="color:white;" target="_self" href="logout.php">LOG OUT</a></li>
</ul>
</div>
</div>
<?php
if(isset($_SESSION['login'])==true){
if($_SESSION["obj"]->getUserName()=="admin"){
if(isset($_SESSION['result'])){
echo '<div style="color:green; font-size : 25px; text-align:center"><br>'.$_SESSION["result"].'</div>';
unset($_SESSION['result']);
}
$result = $_SESSION["obj"]->viewPendingGrants("pending");
if($result->num_rows>0){
echo "
<table>
<tr>
<th>Username</th>
<th>Grant Id</th>
<th>Grant Type</th>
<th>Grant Money</th>
<th>Request Time</th>
<th>Link</th>
<th>Form</th>
</tr>
";
echo " <form class='col s12' action='decision.php' method='POST'>";
while($rows = $result->fetch_assoc()){
$id = $rows['grantId'];
$userName = $rows['userName'];
echo "
<tr>
<td>".$rows['userName']."</td>
<td>".$rows['grantId']."</td>
<td>".$rows['grantType']."</td>
<td>".$rows['grantMoney']."</td>
<td>".$rows['requestTime']."</td>
<td><a href='uploads/".$rows['grantId'].".pdf' target='_blank'>See Document</a></td>
<td>
<form class='col s12' action='decision.php' method='POST'>
<input type='hidden' name='id' value='$id'>
<input type='hidden' name='userName' value='$userName'>
<input name='approval' type='radio' id='test5' value='Approved'>Approve
<input name='approval' type='radio' id='test5' value='Disapproved' >Disapprove
<br>
<input style='margin:auto;border-radius:3px; width:80px; height:30px;' type='submit'>
</form>
</td>
</tr>
";
}
echo "</table>";
}
else{
echo '<div style="color:black; font-size : 25px; text-align:center">No Pending Grants</div>';
}
}
else{
header("Location:profile.php");
}
}
else{
header("Location:login.php");
}
?>
</body>
</html>