本文整理汇总了PHP中Jobs::showJobDetails方法的典型用法代码示例。如果您正苦于以下问题:PHP Jobs::showJobDetails方法的具体用法?PHP Jobs::showJobDetails怎么用?PHP Jobs::showJobDetails使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Jobs
的用法示例。
在下文中一共展示了Jobs::showJobDetails方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
$app->get('/:id/deactivate/:token', 'validateUser', function ($id, $token) use($app) {
$j = new Jobs($id);
if ($j->deactivateJob($token)) {
$job = $j->showJobDetails();
$title = $j->getSlugTitle();
$app->flash('success', "Job {$id} has been deactivated successfully.");
$app->redirect(ADMIN_URL . "jobs/{$job->id}/{$title}");
} else {
$app->flash('danger', "Job {$id} could not be deactivated.");
$app->redirect(ADMIN_URL . "jobs/{$id}");
}
});
// show job information
$app->get('/:id(/:title)', 'validateUser', function ($id, $title = null) use($app) {
$j = new Jobs($id);
$job = $j->showJobDetails();
$city = $j->getJobCity($job->city);
$category = $j->getJobCategory($job->category);
$applications = $j->countJobApplications();
if (isset($job) && $job->id) {
$app->render(ADMIN_THEME . 'job.show.php', array('job' => $job, 'id' => $id, 'applications' => $applications, 'category' => $category, 'city' => $city));
} else {
$app->flash('danger', 'Job could not be found.');
$app->redirect(ADMIN_MANAGE);
}
});
});
/*
* Categories group
* Admin job categories routes
*/
示例2: accessToken
function accessToken($id)
{
$j = new Jobs($id);
$job = $j->showJobDetails();
return sha1($job->id . $job->created);
}
示例3: sendEmailsToSubscribersMail
public function sendEmailsToSubscribersMail($job_id)
{
global $categories, $cities;
$message = '';
$content = '';
// get job information
$j = new Jobs($job_id);
$job = $j->showJobDetails();
$title = $j->getSlugTitle();
$category_name = $categories[$job->category]['name'];
$city_name = $cities[$job->city]['name'];
$job_link = BASE_URL . "jobs/{$job->id}/{$title}";
$description = Parsedown::instance()->parse($job->description);
$content .= "<p>Job Details</p>";
$content .= "<p>-----------</p>";
$content .= "<p><a href={$job_link}>{$job_link}</a></p>";
$content .= "<p>Title: <strong>{$job->title}</strong></p>";
$content .= "<p>Description: {$description}</p>";
if ($job->perks != '') {
$content .= "<p>Perks: {$job->perks}</p>";
}
$content .= "<p>How to apply: {$job->how_to_apply}</p>";
$content .= "<p>-----------</p>";
// get all users subscribed to the job
$users = R::findAll('subscriptions', " is_confirmed=1 AND (category_id=:category_id OR city_id=:city_id) ", array(':category_id' => $job->category, ':city_id' => $job->city));
foreach ($users as $user) {
$link = BASE_URL . "subscribe/{$user->id}/delete/{$user->token}";
$name = $user->category_id > 0 ? $category_name : $city_name;
$subject = "A new {$name} job was posted at {$this->app_name}";
$message .= "<p>You subcribed to receive {$name} jobs on {$this->app_name}.</p>";
$message .= $content;
$message .= "<p>To unsubscribe, click this link to stop receiving alerts.</p>";
$message .= "<p><a href={$link}>{$link}</a></p>";
if ($this->sendNotification($subject, $message, $user->email)) {
$update = R::load('subscriptions', $user->id);
$update->last_sent = R::isoDateTime();
R::store($update);
}
}
}