-
Notifications
You must be signed in to change notification settings - Fork 0
/
view-certificate-b.php
48 lines (34 loc) · 1.08 KB
/
view-certificate-b.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
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bwire Jobs - View Certificate</title>
<link rel="shortcut icon" href="images/ico/favicon.png">
<link href="css/main.css" rel="stylesheet">
</head>
<body>
<?php
require 'constants/db_config.php';
$file_id = $_GET['id'];
try {
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $conn->prepare("SELECT * FROM tbl_training WHERE id = :fileid");
$stmt->bindParam(':fileid', $file_id);
$stmt->execute();
$result = $stmt->fetchAll();
foreach($result as $row)
{
$certificate = $row['certificate'];
$course = $row['training'];
?>
<iframe style="border:none;" src="ViewerJS/?title=<?php echo "$course"; ?>#<?php echo 'data:application/pdf;base64,'.base64_encode($certificate).'' ?>" height="100%" width="100%"></iframe>
<?php
}
}catch(PDOException $e)
{
}
?>
</body>
</html>