This repository was archived by the owner on Jan 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtoken_responses.php
67 lines (62 loc) · 2.32 KB
/
token_responses.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
use \Sizzle\Bacon\Database\RecruitingTokenResponse;
date_default_timezone_set('America/Chicago');
if (!logged_in()) {
login_then_redirect_back_here();
}
$user_id = $_SESSION['user_id'] ?? '';
define('TITLE', 'S!zzle - Token Responses');
require __DIR__.'/header.php';
?>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/s/dt/jszip-2.5.0,pdfmake-0.1.18,dt-1.10.10,b-1.1.0,b-flash-1.1.0,b-html5-1.1.0,b-print-1.1.0/datatables.min.css"/>
<link rel="stylesheet" type="text/css" href="/css/datatables.min.css"/>
</head>
<body id="token-responses">
<div>
<?php require __DIR__.'/navbar.php';?>
</div>
<div class="row" id="datatable-div">
<div class="col-sm-offset-2 col-sm-8">
<h2>Token Responses</h2>
<table id="responsive-table" class="table table-striped table-hover">
<thead>
<th>Token</th>
<th>Email</th>
<th>Response</th>
<th>Date & Time (CST)</th>
</thead>
<tbody>
<?php
$RecruitingTokenResponse = new RecruitingTokenResponse();
$responses = $RecruitingTokenResponse->get((int) $user_id);
foreach ($responses as $response) {
echo '<tr>';
echo "<td><a href=\"/token/recruiting/{$response['long_id']}\">{$response['job_title']}</a><i hidden>{$response['long_id']}</i></td>";
echo "<td>{$response['email']}</td>";
echo "<td>{$response['response']}</td>";
echo "<td>".date('m/d/Y g:i a', strtotime($response['created']))."</td>";
echo '</tr>';
}?>
</tbody>
</table>
</div>
</div>
<?php require __DIR__.'/footer.php';?>
<script type="text/javascript" src="https://cdn.datatables.net/s/dt/jszip-2.5.0,pdfmake-0.1.18,dt-1.10.10,b-1.1.0,b-flash-1.1.0,b-html5-1.1.0,b-print-1.1.0/datatables.min.js"></script>
<script>
$(document).ready(function() {
var table = $('#responsive-table').DataTable({
dom: 'B<"clear">lfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf','print'
]
});
<?php if (isset($_GET['id'])) { ?>
$('input').val("<?php echo $_GET['id'];?>");
$('input').focus();
table.search("<?php echo $_GET['id'];?>").draw();
<?php }?>
});
</script>
</body>
</html>