-
Notifications
You must be signed in to change notification settings - Fork 0
/
c_list.php
103 lines (94 loc) · 2.97 KB
/
c_list.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
<?php
session_start();
include "handf/header_forms.php";
include_once 'php_connection.php';
error_reporting(0);
if($_SESSION['l_id']){
include "handf/slideL.php";
}elseif ($_SESSION['i_id']) {
include "handf/slideI.php";
}elseif ($_SESSION['a_id']) {
include "handf/slideA.php";
}else {
echo "invalid login details";
}
?>
<head>
<style>
#other #p{
text-align: center;
}
</style>
</head>
<br><br><br><br>
<!----------------------------------------->
<p id="p" class="text-lg-right font-weight-bold"> Scroll down for add tests in "other" categoris</p>
<?php
$url = "http://$_SERVER[HTTP_HOST] $_SERVER[REQUEST_URI]";
if (strpos($url, "c_delete=success") == true) {
echo "<script>
window.alert('Course Deleated Sucessfully!!!');
</script>";
}
if (strpos($url, "c_edit=success") == true) {
echo "<div class='container-fluid'>
<div class='col-lg-12'><div class='alert alert-info'>
<strong>Success!</strong> Changes has been made to Database.<i class='material-icons'>
sentiment_very_satisfied
</i>
</div></div></div>";
}elseif (strpos($url,"upload=success")==true) {
echo "<div class='container-fluid'>
<div class='col-lg-12'><div class='alert alert-success'>
<strong>Success!</strong> Data uploaded successfully.<i class='material-icons'>
sentiment_very_satisfied
</i>
</div></div></div>";
}
?>
<!----------------------------------------->
<div class="container-fluid">
<div class="col-lg-12">
<table id="t1" class="table table-hover table-secondary table-striped">
<tr>
<th>Course ID</th>
<th>Course Name</th>
<th>Discription</th>
<th>Delete</th>
<th>Edit</th>
<th>Upload</th>
<th>Tests</th>
</tr>
<?php
$sql = "select * from course;";
$r = mysqli_query($conn, $sql);
$rc = mysqli_num_rows($r);
if ($rc > 0) {
while ($row = mysqli_fetch_assoc($r)) {
$r1 = $row['c_id'];
echo '<tr><td>' . $row['c_id'] . "</td>";
echo "<td>" . $row['c_name'] . "</td>";
echo "<td>" . $row['discription'] . "</td>
<td><a class='btn btn-outline-danger' href='c_delete.php?id=$r1'>Delete</a></td>
<td><a class='btn btn-outline-info' href='c_edit_form.php?id=$r1&nm=$row[c_name]&d=$row[discription]'>Edit</a></td>
<td><a class='btn btn-outline-primary ' href='d_course.php?id=$r1'>Add</a></td>
<td><a class='btn btn-outline-secondary' href='quiz/I_quiz.php?id=$r1'>Add</a></td>";
}
echo "
</tr>
</table>
</div>
</div>";
}
?>
<div class="container-fluid">
<div class="col-lg-12">
<div id="other" class="card">
<p id="p" class="font-italic">Add tests in "OTHER" cotegory</p>
<a class='btn btn-secondary' href='quiz/I_quiz.php?id=other'>Add</a>
</div>
</div>
</div>
<?php
include "handf/footer_forms.php";
?>