-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdisplay.php
58 lines (48 loc) · 1.21 KB
/
display.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
<?php
session_start();
include('connect.php');
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Display PDF</title>
<style media="screen">
embed {
border: 2px solid black;
margin-top: 30px;
}
.div1 {
margin-left: 170px;
}
</style>
</head>
<body>
<div class="div1">
<?php
if (isset($_POST['submit2'])){
$cid = $_SESSION['courseID'];
$sql="SELECT pdf FROM course WHERE C_ID = $cid";
$query=mysqli_query($conn,$sql);
while ($info=mysqli_fetch_array($query)) {
// echo $row["mail"];
?>
<embed type="application/pdf" src="pdf/<?php echo $info['pdf'] ; ?>" width="900" height="500">
<?php
}
}
if (isset($_POST['selected_id'])){
$cid = $_SESSION['courseID'];
$lec = $_POST['selected_id'];
$sql2="SELECT pdf FROM course WHERE C_ID = $cid AND lecture = $lec";
$query2=mysqli_query($conn,$sql2);
while ($info2=mysqli_fetch_array($query2)) {
?>
<embed type="application/pdf" src="pdf/<?php echo $info2['pdf'] ; ?>" width="900" height="500">
<?php
}
}
?>
</div>
</body>
</html>