-
Notifications
You must be signed in to change notification settings - Fork 0
/
course.php
48 lines (39 loc) · 1.45 KB
/
course.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
<?php
define('BASEPATH', true);
session_start();
require('backend/config/db.php');
$is_administrator = 0;
if(!isset($_SESSION["user"])) {
header("Location: login.php");
exit();
}
$id = $_GET['id'];
$query = "SELECT * FROM courses WHERE id = :id";
$statement = $pdo->prepare($query);
$statement->bindValue(':id', $id, PDO::PARAM_INT);
$statement->execute();
$course = $statement->fetch(PDO::FETCH_ASSOC);
if (!$course) {
echo '<h2 class="titlu-oopsie">Oopsie.. cursul este de negăsit! Dar nu te îngrijora, încearcă din nou!</h2>';
exit;
}
$pdfPath = $course['pdf_path'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="preload" href="styles/FontAwesome/css/all.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<link rel="stylesheet" href="styles/cursuri/all.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.all.min.js"></script>
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.min.css'>
</head>
<body>
<?php include './important/Rightbar.php'; ?>
<?php include './important/Sidebar.php'; ?>
<iframe src="<?php echo $pdfPath; ?>" width="65%" height="900px" style="position: relative; left: 300px;"></iframe>
</body>
</html>