-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViewApplicationFile.php
More file actions
44 lines (33 loc) · 1.05 KB
/
ViewApplicationFile.php
File metadata and controls
44 lines (33 loc) · 1.05 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
<?php
/**
* User: rhmiller
* Date: 12/8/12
*/
#Include functions
include_once "Header.php";
# If you're already authenticated, go to index.php
if ((!hasPermission("E")) && (!hasPermission("B"))) {
header(redirect('index.php', '?warning=' . urlencode("Sorry but you are not allowed access to that page")));
exit;
}
if(!isset($_GET['resourceType'])){
header(redirect('Application.php', '?warning=' . urlencode("Sorry but this link appears to be broken")));
exit;
}
if ($_GET['resourceType'] == "cv"){
$type = "CV";
} else if ($_GET['resourceType'] == "coverLetter"){
$type = "COVER_LETTER";
} else {
$type = "RESEARCH_STATEMENT";
}
if(!isset($_GET['appId'])){
$sql = "select $type from APPLICATION where NON_UI_PERSON_ID = '" . getPersonId() . "'";
} else {
$sql = "select $type from APPLICATION where APP_ID = '" . $_GET['appId'] . "'";
}
$result = nextRow(queryDB($sql));
$file = stripslashes($result[$type]);
header('Content-disposition: inline; filename="letter.pdf"');
header('Content-type: application/pdf');
echo $file;