forked from chiragmaniar/php_website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2_dashboard_hod.php
More file actions
302 lines (245 loc) · 9.21 KB
/
2_dashboard_hod.php
File metadata and controls
302 lines (245 loc) · 9.21 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
<?php
session_start();
if(!isset($_SESSION['loggedInUser'])){
//send them to login page
header("location:index.php");
}
//connect to database
include("includes/connection.php");
$fid = $_SESSION['Fac_ID'];
//query and result
/*$query = "SELECT P_ID, Fac_ID,Paper_title,Paper_type,Paper_N_I,Paper_category,Date_from,Date_to
,Location,paper_path,certificate_path,report_path,Paper_co_authors,volume FROM faculty";*/
$query = "SELECT * from faculty inner join facultydetails on faculty.Fac_ID = facultydetails.Fac_ID ";
$result = mysqli_query($conn,$query);
$successMessage="";
if(isset($_GET['alert'])){
if($_GET['alert']=="success"){
$successMessage='<div class="alert alert-success">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×
</button>
<strong>Record added successfully</strong>
</div>';
}
elseif($_GET['alert']=="update"){
$successMessage='<div class="alert alert-success">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×
</button>
<strong>Record updated successfully</strong>
</div>';
}
elseif($_GET['alert']=="delete"){
$successMessage='<div class="alert alert-success">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×
</button>
<strong>Record deleted successfully</strong>
</div>';
}
}
?>
<?php include_once('head.php'); ?>
<?php include_once('header.php'); ?>
<?php
if($_SESSION['username'] == 'hodextc@somaiya.edu' || $_SESSION['username'] == 'member@somaiya.edu')
{
include_once('sidebar_hod.php');
}
else
include_once('sidebar.php');
?>
<style>
div.scroll
{
overflow:scroll;
}
</style>
<div class="content-wrapper">
<?php
{
echo $successMessage;
}
$display = 0;
if($_SESSION['username'] == 'hodextc@somaiya.edu')
{
$display = 1;
}
else if($_SESSION['username'] == 'member@somaiya.edu')
{
$display = 2;
}
?>
<section class="content">
<div class="row">
<div class="col-xs-12">
<div class="box box-primary">
<div class="box-header with-border">
<h2 class="box-title">Paper Publication/Presentation</h2>
</div><!-- /.box-header -->
<div class="box-body">
<div class="scroll">
<table class="table table-stripped table-bordered " id = 'example1'>
<thead>
<tr>
<th>Faculty</th>
<th>Title</th>
<th>Type</th>
<th>N/I</th>
<th>Conference/Journal Name</th>
<th>Category</th>
<th>Co-authors</th>
<th>Date from</th>
<th>Date to</th>
<th>Location</th>
<th>Volume</th>
<th>H-Index</th>
<th>FDC Status</th>
<th>Paper</th>
<th>Certificate</th>
<th>Report</th>
<th>Upload Paper</th>
<th>Upload Certificate</th>
<th>Upload Report</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
<?php
if(mysqli_num_rows($result)>0 ){
//we have data to display
while($row =mysqli_fetch_assoc($result)){
echo "<tr>";
echo "<td>".$row['F_NAME']."</td>";
echo "<td>".$row['Paper_title']."</td>";
echo "<td>".$row['Paper_type']."</td>";
echo "<td>".$row['Paper_N_I']."</td>";
echo "<td>".$row['conf_journal_name']."</td>";
echo "<td>".$row['paper_category']."</td>";
echo "<td>".$row['Paper_co_authors']."</td>";
echo "<td>".$row['Date_from']."</td>";
echo "<td>".$row['Date_to']."</td>";
echo "<td>".$row['Location']."</td>";
echo "<td>".$row['volume']."</td>";
echo "<td>".$row['h_index']."</td>";
echo "<td>".$row['FDC_Y_N']."</td>";
$_SESSION['P_ID'] = $row['P_ID'];
if(($row['paper_path']) != "")
{
if(($row['paper_path']) == "NULL")
echo "<td>not yet available</td>";
else if(($row['paper_path']) == "not_applicable")
echo "<td>not applicable</td>";
else
echo "<td> <a href = '".$row['paper_path']."'>View paper</td>";
}
else
echo "<td>no status </td>";
if(($row['certificate_path']) != "")
{
if(($row['certificate_path']) == "NULL")
echo "<td>not yet available</td>";
else if(($row['certificate_path']) == "not_applicable")
echo "<td>not applicable</td>";
else
echo "<td> <a href = '".$row['certificate_path']."'>View certificate</td>";
}
else
echo "<td>no status </td>";
if(($row['report_path']) != "")
{
if(($row['report_path']) == "NULL")
echo "<td>not yet available</td>";
else if(($row['report_path']) == "not_applicable")
echo "<td>not applicable</td>";
else
echo "<td> <a href = '".$row['report_path']."'>View report</td>";
}
else
echo "<td>no status </td>";
echo "<td>
<form action = 'upload-paper.php' method = 'POST'>
<input type = 'hidden' name = 'id' value = '".$row['P_ID']."'>
<button type = 'submit' class = 'btn btn-primary btn-sm'>
<span class='glyphicon glyphicon-upload'></span>
</button>
</form>
</td>";
echo "<td>
<form action = 'upload-certificate.php' method = 'POST'>
<input type = 'hidden' name = 'id' value = '".$row['P_ID']."'>
<button type = 'submit' class = 'btn btn-primary btn-sm'>
<span class='glyphicon glyphicon-upload'></span>
</button>
</form>
</td>";
echo "<td>
<form action = 'upload-report.php' method = 'POST'>
<input type = 'hidden' name = 'id' value = '".$row['P_ID']."'>
<button type = 'submit' class = 'btn btn-primary btn-sm'>
<span class='glyphicon glyphicon-upload'></span>
</button>
</form>
</td>";
echo "<td>
<form action = '3_edit_hod.php' method = 'POST'>
<input type = 'hidden' name = 'id' value = '".$row['P_ID']."'>
<button type = 'submit' class = 'btn btn-primary btn-sm'>
<span class='glyphicon glyphicon-edit'></span>
</button>
</form>
</td>";
echo "<td>
<form action = '4_delete.php' method = 'POST'>
<input type = 'hidden' name = 'id' value = '".$row['P_ID']."'>
<button type = 'submit' class = 'btn btn-primary btn-sm'>
<span class='glyphicon glyphicon-trash'></span>
</button>
</form>
</td>";
echo"</tr>";
}
}
else{
//if ther are no entries
echo "<div class='alert alert-warning'>You have no papers</div>";
}
?>
</table>
</div>
<div class="text-left"><a href="actcount.php"type="button" class="btn btn-success btn-sm"><span class="glyphicon glyphicon-plus">Add Paper</span></a>
<a href="count_all.php" type="button" class="btn btn-success btn-sm"><span class="glyphicon ">Count Publications</span></a>
<a href="mail_reminder.php" type="button" class="btn btn-success btn-sm" target="_blank"><span class="glyphicon ">Mail Reminder</span></a> </div>
</div>
</div>
</div>
</div>
</section>
</div>
<script src="plugins/jQuery/jQuery-2.1.4.min.js"></script>
<!-- Bootstrap 3.3.5 -->
<script src="bootstrap/js/bootstrap.min.js"></script>
<!-- DataTables -->
<script src="plugins/datatables/jquery.dataTables.min.js"></script>
<script src="plugins/datatables/dataTables.bootstrap.min.js"></script>
<!-- SlimScroll -->
<script src="plugins/slimScroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="plugins/fastclick/fastclick.min.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/app.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="dist/js/demo.js"></script>
<!-- page script -->
<script>
$(function () {
$("#example1").DataTable();
$('#example2').DataTable({
"paging": true,
"lengthChange": false,
"searching": false,
"ordering": true,
"info": true,
"autoWidth": false
});
});
</script>
<?php include_once('footer.php'); ?>