-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjob_detail.php
More file actions
169 lines (150 loc) · 6.92 KB
/
Copy pathjob_detail.php
File metadata and controls
169 lines (150 loc) · 6.92 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
<?php
/**
* ikaiCMS - 招聘详情页
*
* PHP 8.0+
*/
declare(strict_types=1);
require_once __DIR__ . '/includes/init.php';
HtmlCache::start(600);
$id = getInt('id');
if (!$id) {
header('Location: /');
exit;
}
// 获取职位
$job = jobModel()->find($id);
if (!$job || (int)$job['status'] !== 1) {
header('HTTP/1.1 404 Not Found');
exit('求人が見つかりません');
}
// 更新浏览量
jobModel()->incrementViews($id);
// 获取招聘栏目
$channel = null;
$channels = channelModel()->where(['type' => 'job', 'status' => 1]);
if (!empty($channels)) {
$channel = $channels[0];
}
// 页面信息
$pageTitle = $job['title'];
$pageKeywords = $channel['seo_keywords'] ?? config('site_keywords');
$pageDescription = $job['summary'] ?: cutStr(strip_tags($job['content'] ?? ''), 150);
$currentChannelId = $channel ? (int)$channel['id'] : 0;
// 获取导航
$navChannels = getNavChannels();
// 引入头部
require_once theme_path('layouts/header.php');
?>
<!-- Breadcrumb -->
<div class="bg-gray-100 py-4">
<div class="container mx-auto px-4">
<div class="flex items-center gap-2 text-sm text-gray-600">
<a href="/" class="hover:text-primary"><?php echo __('breadcrumb_home'); ?></a>
<?php if ($channel): ?>
<span>/</span>
<a href="<?php echo channelUrl($channel); ?>" class="hover:text-primary"><?php echo e($channel['name']); ?></a>
<?php endif; ?>
<span>/</span>
<span class="text-gray-400 truncate max-w-xs"><?php echo e($job['title']); ?></span>
</div>
</div>
</div>
<section class="py-12">
<div class="container mx-auto px-4">
<div class="max-w-4xl mx-auto">
<article class="bg-white rounded-lg shadow overflow-hidden">
<!-- Title area -->
<div class="p-6 md:p-8 border-b">
<h1 class="text-2xl md:text-3xl font-bold text-dark leading-tight">
<?php echo e($job['title']); ?>
</h1>
<div class="mt-4 flex flex-wrap items-center gap-3">
<?php if ($job['salary']): ?>
<span class="text-primary font-bold text-xl"><?php echo e($job['salary']); ?></span>
<?php endif; ?>
<?php if ($job['location']): ?>
<span class="flex items-center gap-1 text-gray-500">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"></path>
</svg>
<?php echo e($job['location']); ?>
</span>
<?php endif; ?>
<span class="text-sm text-gray-400"><?php echo friendlyTime((int)$job['publish_time']); ?></span>
</div>
</div>
<!-- Job info -->
<div class="p-6 md:p-8 border-b bg-blue-50">
<div class="grid grid-cols-2 md:grid-cols-3 gap-4">
<?php if ($job['salary']): ?>
<div>
<div class="text-xs text-gray-500 mb-1">給与</div>
<div class="text-primary font-bold"><?php echo e($job['salary']); ?></div>
</div>
<?php endif; ?>
<?php if ($job['location']): ?>
<div>
<div class="text-xs text-gray-500 mb-1">勤務地</div>
<div class="font-medium"><?php echo e($job['location']); ?></div>
</div>
<?php endif; ?>
<?php if ($job['job_type']): ?>
<div>
<div class="text-xs text-gray-500 mb-1">雇用形態</div>
<div class="font-medium"><?php echo e($job['job_type']); ?></div>
</div>
<?php endif; ?>
<?php if ($job['headcount']): ?>
<div>
<div class="text-xs text-gray-500 mb-1">募集人数</div>
<div class="font-medium"><?php echo e($job['headcount']); ?></div>
</div>
<?php endif; ?>
<?php if ($job['education']): ?>
<div>
<div class="text-xs text-gray-500 mb-1">学歴</div>
<div class="font-medium"><?php echo e($job['education']); ?></div>
</div>
<?php endif; ?>
<?php if ($job['experience']): ?>
<div>
<div class="text-xs text-gray-500 mb-1">経験</div>
<div class="font-medium"><?php echo e($job['experience']); ?></div>
</div>
<?php endif; ?>
<div>
<div class="text-xs text-gray-500 mb-1">掲載日</div>
<div class="font-medium"><?php echo date('Y-m-d', (int)$job['publish_time']); ?></div>
</div>
</div>
</div>
<!-- Job requirements -->
<?php if ($job['requirements']): ?>
<div class="p-6 md:p-8 border-b">
<h2 class="text-lg font-bold text-dark mb-4">応募条件</h2>
<div class="prose max-w-none text-gray-700"><?php echo sanitizeHtml($job['requirements']); ?></div>
</div>
<?php endif; ?>
<!-- Job detail -->
<?php if ($job['content']): ?>
<div class="p-6 md:p-8 prose prose-lg max-w-none">
<?php echo sanitizeHtml($job['content']); ?>
</div>
<?php endif; ?>
<!-- Back to list -->
<div class="p-6 md:p-8 border-t bg-gray-50 text-center">
<?php if ($channel): ?>
<a href="<?php echo channelUrl($channel); ?>" class="inline-flex items-center gap-2 text-primary hover:underline">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"></path>
</svg>
採用情報一覧に戻る
</a>
<?php endif; ?>
</div>
</article>
</div>
</div>
</section>
<?php require_once theme_path('layouts/footer.php'); ?>