-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
425 lines (398 loc) · 21.3 KB
/
index.php
File metadata and controls
425 lines (398 loc) · 21.3 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
<?php
include('auth.php');
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>HelloSign API with PHP</title>
<link rel="stylesheet" type="text/css" href="newcss.css" />
<style type="text/css">
body {
background-color: #aaa;
margin: 0;
padding: 0;
}
div {
width: 815px;
margin: 5em auto;
padding: 10px;
background-color: #f0f0f2;
border-radius: 1em;
box-shadow: 1px 1px 1px #00B3E6;
}
@media (max-width: 800px) {
body {
background-color: #fff;
}
div {
width: auto;
margin: 0 auto;
border-radius: 0;
padding: 0px;
}
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- <script type='text/javascript' src="https://cdn.rawgit.com/jamesallardice/Placeholders.js/master/dist/placeholders.min.js"></script> -->
</head>
<body>
<?php
require_once 'vendor/autoload.php';
if (isset($_SESSION['fromEmbeddedRequesting']) && $_SESSION['fromEmbeddedRequesting'] == true) {
$client = new HelloSign\Client($api_key);
$signature_request_object = $client->getSignatureRequest($_SESSION['signature_request_id']);
// print_r(json_encode($signature_request_object->toArray()));
include('db.php');
$_SESSION['fromEmbeddedRequesting'] = false;
}
// no longer using LaunchDarkly
// $user = new LaunchDarkly\LDUser(hash("md5", time()));
// the selector will match all input controls of type :checkbox
// and attach a click event handler
// $user = new LaunchDarkly\LDUser("[email protected]");
// if ($ld_client->variation("show-name-and-email", $user)) {
if (1 == 0) { //invalidate if you want to remove the requirement for name and email
?>
<div class="entry-content">
<h1>HelloWorks is here at last!</h1>
<!-- this is creating an embedded signature request using text tags -->
<form action="/helloworks.php" method="post" enctype="multipart/form-data">
<fieldset>
<p>Enter your name and email address here to try out the OneLogic Test flow</p>
<p><small>Please use false information - this is for demo purposes only</small></p>
<input type="text" name="hw_name" id="hw_name" placeholder="First and Last Name" required/>
<br />
<input type="email" name="hw_email" id="hw_email" placeholder="Email Address" required/>
<!--<br />-->
<!--Choose either to receive a link, or a code, in the verification email from HelloWorks-->
<!--<br />-->
<!--<input type="checkbox" value="1" name="checkbox[1][]" id="hw_send_link" checked/> Link (default for now)-->
<!--<br />-->
<!--<input type="checkbox" value="1" name="checkbox[1][]" id="hw_send_code"/> Code-->
<br />
<input type="submit" value="Fill out a W-9"/>
<!--<br />-->
<!-- <script>
$("input:checkbox").on('click', function () {
// in the handler, 'this' refers to the box clicked on
var $box = $(this);
if ($box.is(":checked")) {
// the name of the box is retrieved using the .attr() method
// as it is assumed and expected to be immutable
var group = "input:checkbox[name='" + $box.attr("name") + "']";
// the checked state of the group/box on the other hand will change
// and the current value is retrieved using .prop() method
$(group).prop("checked", false);
$box.prop("checked", true);
} else {
$box.prop("checked", false);
}
});</script>-->
</fieldset>
</form>
<br />
<h1>Have a look at these <i>awesome</i> embedded examples!</h1>
<h2> These are mobile or pc friendly</h2>
<!-- this is creating an embedded signature request using text tags -->
<form action="/signatureRequestTextTags.php" method="post" enctype="multipart/form-data">
<fieldset>
<input type ="text" name="signername" id="signername" placeholder="First and Last Name" required/>
<br />
<input type="email" name="signeremail" id="signeremail" placeholder="Email Address" required/>
<br />
<input type="submit" value="Text Tags are cool"/>
<br />
<input type="file" name="uploadedTextTags" id="uploadedTextTags" required/>
<p>Sign a signature request that uses text tags</p>
<p>NOTE - use a text tags pdf with only <b>one</b> signer!</p>
</fieldset>
</form>
<!-- this is a standard sig request with an appended signature page -->
<form action="/AppendedSignaturePage.php" method="post" enctype="multipart/form-data">
<fieldset>
<br />
<input type ="text" name="signername" id="signername" placeholder="First and Last Name" required/>
<br />
<input type="email" name="signeremail" id="signeremail" placeholder="Email Address" required/>
<br />
<input type="submit" value="Easy as easy gets"/>
<br />
<input type="file" name="uploadedfile" id="uploadedfile" required/>
<br />
<p>Sign a signature request that uses an appended signature page</p>
</fieldset>
</form>
<!-- this is a standard sig request with an appended signature page which triggers an email -->
<form action="/AppendedSignaturePage_email.php" method="post" enctype="multipart/form-data">
<fieldset>
<br />
<input type ="text" name="signername" id="signername" placeholder="First and Last Name" required/>
<br />
<input type="email" name="signeremail" id="signeremail" placeholder="Email Address" required/>
<br />
<input type="submit" value="Easy as easy gets with email"/>
<br />
<input type="file" name="uploadedfile" id="uploadedfile" required/>
<br />
<p>Sign a signature request that uses an appended signature page, and triggers an email to the signer</p>
</fieldset>
</form>
<!-- this for embedded signing with template -->
<form action="/signatureRequestFormFields.php">
<fieldset>
<br />
<input type ="text" name="signername" id="signername" placeholder="First and Last Name" required/>
<br />
<input type="email" name="signeremail" id="signeremail" placeholder="Email Address" required/>
<br />
<input type="submit" value="Embedded Signature With Form Fields"/>
<br />
</fieldset>
<p>This uses form_fields_per_document and it's hardcoded, but you're welcome to check it out!<br /></p>
</form>
<!-- this for embedded signing with template -->
<form action="/signatureRequestWithTemplate.php">
<fieldset>
<br />
<input type ="text" name="signername" id="signername" placeholder="First and Last Name" pattern="^([a-zA-Z]+[\'\,\.\-]?[a-zA-Z ]*)+[ ]([a-zA-Z]+[\'\,\.\-]?[a-zA-Z ]+)+$" title="First and Last Name" required/>
<br />
<input type="email" name="signeremail" id="signeremail" placeholder="Email Address" required/>
<br />
<input type="submit" value="Embedded Signature With Template"/>
<br />
</fieldset>
<p>The template's hardcoded and setup to trigger a specific response<br /></p>
<p>but you're welcome to check the template out!<br /></p>
</form>
<h2>These are only pc friendly</h2>
<!-- this is an embedded template page -->
<form action="/embeddedTemplate.php" method="post" enctype="multipart/form-data">
<fieldset>
<input type="submit" value="Template Creation"/>
<br />
<input type="file" name="uploadedTemplateFile" id="uploadedTemplateFile"/>
<p>Create a template</p>
</fieldset>
</form>
<!-- this is an edit template files page -->
<form action="/updateTemplateFiles.php" method="post" enctype="multipart/form-data">
<fieldset>
<br />
<input type="text" name="template_id" id="template_id"/>
<br />
<input type="file" name="newUploadedTemplateFile" id="newUploadedTemplateFile"/>
<input type="submit" value="Update Template Files"/>
<p>Update Template Files</p>
</fieldset>
</form>
<!-- this is an edit embedded template page -->
<form action="/editEmbeddedTemplate.php" method="post" enctype="multipart/form-data">
<fieldset>
<br />
<input type="text" name="templateID" id="templateID"/>
<br />
<input type="submit" value="Edit An Embedded Template"/>
<p>Edit an embedded template</p>
</fieldset>
</form>
<!-- this is an embedded requesting page -->
<form action="/embeddedRequesting.php" method="post" enctype="multipart/form-data">
<fieldset>
<br />
<input type="submit" value="Requesting"/>
<br />
<input type="file" name="requestingFile" id="requestingFile"/>
</fieldset>
<p>Create a signature request that will send a HelloSign email to the signer(s)</p>
</form>
<!-- this is an unclaimed draft requesting - hellosign.com login required to "claim" -->
<form action="/unclaimedDraft.php" method="post" enctype="multipart/form-data">
<fieldset>
<br />
<input type="submit" value="Unclaimed Draft Requesting"/>
<br />
<input type="file" name="unclaimedDraftFile" id="unclaimedDraftFile"/>
</fieldset>
<p>Create a Draft to be claimed by someone with a HelloSign.com Account</p>
</form>
<!-- this is an embedded requesting page with embedded signing -->
<form action="/embeddedRequestingEmbeddedSigning.php" method="post" enctype="multipart/form-data">
<fieldset>
<br />
<input type="submit" value="Requesting for Embedded Signing"/>
<br />
<input type="file" name="requestingFileEmbSig" id="requestingFileEmbSig"/>
</fieldset>
<p>Create a signature request that will be used for embedded signing</p>
</form>
<!-- this for testing bugs -->
<form action="/bugstesting.php" method="post" enctype="multipart/form-data">
<fieldset>
<br />
<input type="submit" value="Bug Testing Only"/>
<br />
<input type="file" name="BugTestingOnly" id="BugTestingOnly"/>
</fieldset>
<p>Use For Bug Testing Only - setup for bug</p>
</form>
</div>
<br /><br /><a href="privacypolicy.htm" style="color: #555">Privacy Policy</a>
<p><small>Thanks for playing!</small></p>
</body>
</html>
<?php
} else {
?>
<div class="entry-content">
<h1>HelloWorks is here at last!</h1>
<!-- this is creating an embedded signature request using text tags -->
<form action="/helloworks.php" method="post" enctype="multipart/form-data">
<fieldset>
<p>Enter your name and email address here to try out the W-9 flow</p>
<p><small>Please use false information - this is for demo purposes only</small></p>
<input type="text" name="hw_name" id="hw_name" placeholder="First and Last Name" required/>
<br />
<input type="email" name="hw_email" id="hw_email" placeholder="Email Address" required/>
<br />
<input type="submit" value="Fill out a W-9"/>
<br />
</fieldset>
</form>
<br />
<h1>Have a look at these <i>awesome</i> embedded examples!</h1>
<h2> These are mobile or pc friendly</h2>
<!-- this is creating an embedded signature request using text tags -->
<form action="/signatureRequestTextTags.php" method="post" enctype="multipart/form-data">
<fieldset>
<input type="submit" value="Text Tags are cool"/>
<br />
<input type="file" name="uploadedTextTags" id="uploadedTextTags" required/>
<p>Sign a signature request that uses text tags</p>
<p>NOTE - use a text tags pdf with only <b>one</b> signer!</p>
</fieldset>
</form>
<!-- this is a standard sig request with an appended signature page -->
<form action="/AppendedSignaturePage.php" method="post" enctype="multipart/form-data">
<fieldset>
<br />
<input type="submit" value="Easy as easy gets"/>
<br />
<input type="file" name="uploadedfile" id="uploadedfile" required/>
<br />
<p>Sign a signature request that uses an appended signature page</p>
</fieldset>
</form>
<!-- this is a standard sig request with an appended signature page which triggers an email -->
<form action="/AppendedSignaturePage_email.php" method="post" enctype="multipart/form-data">
<fieldset>
<br />
<input type ="text" name="signername" id="signername" placeholder="First and Last Name" required/>
<br />
<input type="email" name="signeremail" id="signeremail" placeholder="Email Address" required/>
<br />
<input type="submit" value="Easy as easy gets with email"/>
<br />
<input type="file" name="uploadedfile" id="uploadedfile" required/>
<br />
<p>Sign a signature request that uses an appended signature page, and triggers an email to the signer</p>
</fieldset>
</form>
<!-- this for embedded signing with template -->
<form action="/signatureRequestFormFields.php">
<fieldset>
<br />
<input type="submit" value="Embedded Signature With Form Fields"/>
<br />
</fieldset>
<p>This uses form_fields_per_document and it's hardcoded, but you're welcome to check it out!<br /></p>
</form>
<!-- this for embedded signing with template -->
<form action="/signatureRequestWithTemplate.php">
<fieldset>
<br />
<input type="submit" value="Embedded Signature With Template"/>
<br />
</fieldset>
<p>The template's hardcoded and setup to trigger a specific response<br /></p>
<p>but you're welcome to check the template out!<br /></p>
</form>
<h2>These are only pc friendly</h2>
<!-- this is an embedded template page -->
<form action="/embeddedTemplate.php" method="post" enctype="multipart/form-data">
<fieldset>
<input type="submit" value="Template Creation"/>
<br />
<input type="file" name="uploadedTemplateFile" id="uploadedTemplateFile"/>
<p>Create a template</p>
</fieldset>
</form>
<!-- this is an edit template files page -->
<form action="/updateTemplateFiles.php" method="post" enctype="multipart/form-data">
<fieldset>
<br />
<input type="text" name="template_id" id="template_id" placeholder="Template ID" required="true"/>
<br />
<input type="file" name="newUploadedTemplateFile" id="newUploadedTemplateFile" required="true"/>
<br />
<input type="submit" value="Update Template Files"/>
<p>Update Template Files</p>
</fieldset>
</form>
<!-- this is an edit embedded template page -->
<form action="/editEmbeddedTemplate.php" method="post" enctype="multipart/form-data">
<fieldset>
<br />
<input type="text" name="templateID" id="templateID" placeholder="Template ID" required="true"/>
<br />
<input type="submit" value="Edit An Embedded Template"/>
<p>Edit an embedded template</p>
</fieldset>
</form>
<!-- this is an embedded requesting page -->
<form action="/embeddedRequesting.php" method="post" enctype="multipart/form-data">
<fieldset>
<br />
<input type="submit" value="Requesting"/>
<br />
<input type="file" name="requestingFile" id="requestingFile" required="true"/>
</fieldset>
<p>Create a signature request that will send a HelloSign email to the signer(s)</p>
</form>
<!-- this is an embedded requesting page with embedded signing -->
<form action="/embeddedRequestingEmbeddedSigning.php" method="post" enctype="multipart/form-data">
<fieldset>
<br />
<input type="submit" value="Requesting for Embedded Signing"/>
<br />
<input type="file" name="requestingFileEmbSig" id="requestingFileEmbSig"/>
</fieldset>
<p>Create a signature request that will be used for embedded signing</p>
</form>
<!-- this is an unclaimed draft requesting - hellosign.com login required to "claim" -->
<form action="/unclaimedDraft.php" method="post" enctype="multipart/form-data">
<fieldset>
<br />
<input type="submit" value="Unclaimed Draft Requesting"/>
<br />
<input type="file" name="unclaimedDraftFile" id="unclaimedDraftFile"/>
</fieldset>
<p>Create a Draft to be claimed by someone with a HelloSign.com Account</p>
</form>
<!-- this for testing bugs -->
<form action="/bugstesting.php" method="post" enctype="multipart/form-data">
<fieldset>
<br />
<input type="submit" value="Bug Testing Only"/>
<br />
<input type="file" name="BugTestingOnly" id="BugTestingOnly"/>
</fieldset>
<p>Use For Bug Testing Only - setup for bug</p>
</form>
</div>
<br /><br /><a href="privacypolicy.htm" style="color: #555">Privacy Policy</a>
<p><small>Thanks for playing!</small></p>
</body>
</html>
<?php
}