Repository navigation
Expand file tree
/
Copy pathadmin.php
More file actions
123 lines (115 loc) · 3.31 KB
/
Copy pathadmin.php
File metadata and controls
123 lines (115 loc) · 3.31 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
<!DOCTYPE html>
<html>
<head>
<title>Add Study Content</title>
<link rel="stylesheet" href="css/bootstrap.min.css"/>
<link rel="stylesheet" href="css/bootstrap-theme.min.css"/>
<link rel="stylesheet" href="css/welcome.css">
<link rel="stylesheet" href="css/font.css">
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/bootstrap.min.js" type="text/javascript"></script>
</head>
<style>
body{
margin:auto;
text-align:center;}
.header {
display: flex;
justify-content: space-between;
align-items: center;
background-image:linear-gradient(#00004d 55%,#0000);/*,#000033 30%*/
}
.header .logo {
font-size: 25px;
font-family: 'Sriracha', cursive;
color: #000;
text-decoration: none;
margin-left: 30px;
}
.header h2{
}
.nav-items {
display: flex;
justify-content: space-around;
align-items: center;
margin-right: 20px;
}
.nav-items a {
text-decoration: none;
padding: 35px 20px;
}
th {color:black;}
td {color:black;}
table, th, td {
border:0.09px solid black;
text-align:center;
font-size:125%;
padding:9px 9px;
margin:auto;
}
</style>
<div class="header">
<h2 style="color:white">Online E-learningSystem</h2>
<?php if(@$_GET['q']==0) ?>
<a href="dashboard.php?q=0">Home</a>
<nav class="nav-items">
<?php if(@$_GET['q']==1) ?>
<a href="dashboard.php?q=1">User</a>
<?php if(@$_GET['q']==2) ?>
<a href="dashboard.php?q=2">Ranking</a>
<?php if(@$_GET['q']==4 || @$_GET['q']==5) ?>
<a href="dashboard.php?q=4">Add Quiz</a>
<a href="dashboard.php?q=5">Remove Quiz</a>
<?php if(@$_GET['q']==6) ?>
<a href="cont.php?q=6">Add Content</a>
<?php if(@$_GET['q']==7) ?>
<a href="admin.php?q=7">Show Doubt</a>
<?php if(@$_GET['q']==10)?>
<a href="index1.php?q=10">Add Files</a>
<?php if(@$_GET['q']==9) ?>
<a href="ashow.php?q=9">Show Files</a>
<a href="logout1.php?q=dashboard.php">Logout</a>
</nav>
</div>
</html>
<?php
include_once 'database.php';
if(isset($_POST['reply']) && isset($_POST['email'])) {
$reply = $_POST['reply'];
$email = $_POST['email'];
// update the doubt with the admin's reply
$sql = "UPDATE doubt SET reply='$reply' WHERE email='$email'";
if(mysqli_query($con, $sql)) {
echo "Reply submitted successfully";
} else {
echo "Error: " . mysqli_error($con);
}
}
$result = mysqli_query($con, "SELECT * FROM doubt");
?>
<div class="panel">
<div class="table-responsive">
<table class="table table-striped title1">
<tr>
<th>Email</th>
<th>Subject</th>
<th>Query</th>
<th>Admin Reply</th>
<th>Action</th>
</tr>
<?php while($row = mysqli_fetch_array($result)) { ?>
<tr>
<td><?php echo $row['email']; ?></td>
<td><?php echo $row['subject']; ?></td>
<td><?php echo $row['query']; ?></td>
<td><?php echo $row['reply']; ?></td>
<td>
<form method='post'>
<input type='text' name='reply' placeholder='Enter reply'>
<input type='hidden' name='email' value='<?php echo $row['email']; ?>'>
<button type='submit'>Submit</button>
</form>
</td>
</tr>
<?php } ?>
</table></div></div>