forked from chiragmaniar/php_website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2_dashboard.php
More file actions
236 lines (205 loc) · 7.7 KB
/
2_dashboard.php
File metadata and controls
236 lines (205 loc) · 7.7 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
<?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 * FROM faculty where Fac_ID ='".$_SESSION['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')
{
include_once('sidebar_hod.php');
}
else
include_once('sidebar.php');
?>
<style>
div.scroll
{
overflow:scroll;
}
</style>
<div class="content-wrapper">
<?php
{
echo $successMessage;
}
?>
<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>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['Fac_ID']."</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.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_your.php" type="button" class="btn btn-success btn-sm"><span class="glyphicon ">Count Publications</span></a>
<a href="export_to_excel.php" type="button" class="btn btn-success btn-sm"><span class="glyphicon ">Export to Excel</span></a>
</div>
</div>
</div>
</div>
</section>
</div>
<?php include_once('footer.php'); ?>