forked from chiragmaniar/php_website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2_dashboard_online_organised.php
More file actions
203 lines (192 loc) · 7.45 KB
/
2_dashboard_online_organised.php
File metadata and controls
203 lines (192 loc) · 7.45 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
<?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 online_course_organised 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">Online Course Organised</h2>
</div><!-- /.box-header -->
<div class="box-body">
<div class="scroll">
<table class="table table-stripped table-bordered " id = 'example1'>
<thead>
<tr>
<th>Name</th>
<th>Date from</th>
<th>Date to</th>
<th>Organised By</th>
<th>Purpose</th>
<th>Target Audience</th>
<th>Certificate</th>
<th>Report</th>
<th>Attendence Record</th>
<th>Upload Certificate</th>
<th>Upload Report</th>
<th>Upload Attendence Record</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['Course_Name']."</td>";
echo "<td>".$row['Date_From']."</td>";
echo "<td>".$row['Date_To']."</td>";
echo "<td>".$row['Organised_By']."</td>";
echo "<td>".$row['Purpose']."</td>";
echo "<td>".$row['Target_Audience']."</td>";
$_SESSION['OC_O_ID'] = $row['OC_O_ID'];
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>";
if(($row['attendence_path']) != "")
{
if(($row['attendence_path']) == "NULL")
echo "<td>not yet available</td>";
else if(($row['attendence_path']) == "not_applicable")
echo "<td>not applicable</td>";
else
echo "<td> <a href = '".$row['attendence_path']."'>View Attendence Record</td>";
}
else
echo "<td>no status </td>";
echo "<td>
<form action = 'upload-certificate-organised.php' method = 'POST'>
<input type = 'hidden' name = 'id' value = '".$row['OC_O_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-organised.php' method = 'POST'>
<input type = 'hidden' name = 'id' value = '".$row['OC_O_ID']."'>
<button type = 'submit' class = 'btn btn-primary btn-sm'>
<span class='glyphicon glyphicon-upload'></span>
</button>
</form>
</td>";
echo "<td>
<form action = 'upload-attendence.php' method = 'POST'>
<input type = 'hidden' name = 'id' value = '".$row['OC_O_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_online_organised.php' method = 'POST'>
<input type = 'hidden' name = 'id' value = '".$row['OC_O_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_online_organised.php' method = 'POST'>
<input type = 'hidden' name = 'id' value = '".$row['OC_O_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 courses organised</div>";
}
?>
</table>
</div>
<div class="text-left"><a href="actcount_course_organised.php"type="button" class="btn btn-success btn-sm"><span class="glyphicon glyphicon-plus">Add Course</span></a>
<a href="count_your_online.php" type="button" class="btn btn-success btn-sm"><span class="glyphicon ">Count Courses</span></a>
<a href="export_to_excel_course_organised.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'); ?>