-
Notifications
You must be signed in to change notification settings - Fork 0
/
careers.php
109 lines (95 loc) · 2.58 KB
/
careers.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
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
<!doctype html>
<html class="no-js" lang="en">
<?php
$pageName = 'careers';
$customClass = 'careers';
include_once('inc/template.head.php');
// Helper function for infinite array walk
function loopListItems($content) {
if (is_array($content)) {
foreach ($content as $parent => $child) {
$children = loopListItems($child);
// Don't let array indexes print as their own array
if (!is_numeric($parent)) {
$result .= "
<li>{$parent}
<ul>
{$children}
</ul>
</li>";
} else {
$result .= $children;
}
}
} else {
$result = "<li>{$content}</li>";
}
return $result;
}
$jobsData = getData('vacancies');
if ($jobsData['status'] == 'error') {
$errors[] = $jobsData['content'];
} else {
$jobList = [];
$jobContent = '';
foreach ($jobsData['content'] as $id => $content) {
if (!$content['visible'])
continue;
$jobList[] = "<li><a href='#job{$id}'>{$content['title']}</a></li>";
$title = "<h2>{$content['title']}</h2>";
$lists = '';
$description = '';
if (!empty($content['description']))
$description = "<p>{$content['description']}</p>";
if (!empty($content['lists'])) {
foreach ($content['lists'] as $category => $content) {
$category = ucwords(str_replace('_', ' ', $category));
$lists .= "<h4>{$category}</h4>";
$items = loopListItems($content);
$lists .= "
<ul>
{$items}
</ul>";
}
}
$jobContent .= "
<div id='job{$id}' class='item'>
{$title}
{$description}
{$lists}
</div>";
}
}
?>
<body>
<?php include_once('inc/template.header.php'); ?>
<div id="content" class="gradient-helper <?php echo $customClass; ?>">
<div class="right-shape"></div>
<div class="container">
<h1>Working with BetterBetting</h1>
<p class="main">Be part of this new future in the sports betting industry. We are seeking top tier professionals to join our existing and growing team of leading industry experts. See the available positions below and feel free to apply.</p>
<div class="row register">
<div class="col-xs-12 text-center">
<a href="<?php echo $headerPageList['Contact']; ?>" class="button buy-now">Apply Now!</a>
</div>
</div>
<div>
<?php if (!$errors): ?>
<?php if (count($jobList) > 1): ?>
<p>Available jobs:</p>
<ol>
<?php echo implode('', $jobList); ?>
</ol>
<?php endif; ?>
<div class="jobs">
<?php echo $jobContent; ?>
</div>
<?php else: ?>
<p><?php echo implode('</p><p>', $errors); ?></p>
<?php endif; ?>
</div>
</div>
</div>
<?php include_once('inc/template.footer.php'); ?>
</body>
</html>