-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetDocs.php
More file actions
52 lines (50 loc) · 2.71 KB
/
getDocs.php
File metadata and controls
52 lines (50 loc) · 2.71 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
45
46
47
48
49
50
51
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Get Your Docs</title>
<link rel="stylesheet" type="text/css" href="newcss.css" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="icon" type="image/png" href="/favicon-32x32.png"/>
<link rel="icon" type="image/png" href="/favicon-16x16.png"/>
<link rel="manifest" href="/manifest.json" />
<link rel="mask-icon" href="/safari-pinned-tab.svg"/>
</head>
<body>
<?php
require_once 'vendor/autoload.php';
$hfapi = 0; //set to zero for standard, 1 for hfapi subscription
include('auth.php');
// $client_id = '3e3f283135002d1993a92124341193df';
echo '<br /><a href="index.php">ARE YOU TOO GOOD FOR YOUR HOME?</a><br />';
if (isset($_SESSION['signature_request_id'])) {
try {
$filename = "downloaded_files/".$_SESSION['signature_request_id'].".pdf";
$client = new HelloSign\Client($api_key);
$file = $client->getFiles($_SESSION['signature_request_id'], $filename , HelloSign\SignatureRequest::FILE_TYPE_PDF);
echo "<iframe src=\"$filename\" width=\"100%\" style=\"height:880px\"></iframe>";
} catch (Exception $e) {
$message = $e->getMessage();
print_r($message);
echo("<br />Looks like there was an error - please wait while I try again...");
?><script>location.reload(true);</script><?php
}
} elseif (isset($_GET['signature_request_id'])) {
// $filename = "downloaded_files/".$_GET['signature_request_id'].".pdf";
$filename = $_GET['signature_request_id'];
$client = new HelloSign\Client($api_key_1);
try {
$file = $client->getFiles($_GET['signature_request_id'], $filename , HelloSign\SignatureRequest::FILE_TYPE_PDF);
echo "<iframe src=\"$filename\" width=\"100%\" style=\"height:880px\"></iframe>";
// $file = $client->getFiles($filename);
// $file_url = $file->file_url;
echo "<a href=$file_url>Click here for your docs</a>";
} catch (Exception $err) {
if ($err->getMessage() == "Not found") {
echo("The signature request id that you're looking for was not found. Time to go home little buddy.");
}
}
} else {
echo("What are you doing here? You're missing the stuff needed to make this page work, so you need to...<br />");
echo '<a href="index.php">GO HOME YOU ARE DRUNK</a>';
}