-
Notifications
You must be signed in to change notification settings - Fork 1
/
view-certificate.php
49 lines (35 loc) · 1.06 KB
/
view-certificate.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
<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>Nightingale 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_professional_qualification WHERE id = :fileid");
$stmt->bindParam(':fileid', $file_id);
$stmt->execute();
$result = $stmt->fetchAll();
foreach($result as $row)
{
$certificate = $row['certificate'];
?>
<div style="width:100%">
<iframe style="border:none;" src="ViewerJS/?title=CERTIFICATE#<?php echo 'data:application/pdf;base64,'.base64_encode($certificate).'' ?>" height="100%" width="100%"></iframe>
</div>
<?php
}
}catch(PDOException $e)
{
}
?>
</body>
</html>