本文整理汇总了PHP中Jobs::jobCreateUpdate方法的典型用法代码示例。如果您正苦于以下问题:PHP Jobs::jobCreateUpdate方法的具体用法?PHP Jobs::jobCreateUpdate怎么用?PHP Jobs::jobCreateUpdate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Jobs
的用法示例。
在下文中一共展示了Jobs::jobCreateUpdate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: time
$file = $_FILES['logo'];
$path = IMAGE_PATH;
$data['logo'] = time() . '_' . $file['name'];
$data['logo_type'] = $file['type'];
$data['logo_size'] = $file['size'];
$ext = strtolower(pathinfo($data['logo'], PATHINFO_EXTENSION));
if (move_uploaded_file($file['tmp_name'], "{$path}{$data['logo']}") && isValidImageExt($ext)) {
$resize = new ResizeImage("{$path}{$data['logo']}");
$resize->resizeTo(LOGO_H, LOGO_W);
$resize->saveImage("{$path}thumb_{$data['logo']}");
}
} else {
$data['logo'] = $job->logo;
}
$data['step'] = 3;
$j->jobCreateUpdate($data, ACTIVE);
$app->redirect(ADMIN_URL . "jobs/{$id}/publish/{$token}");
});
// get publish job details
$app->get('/:id/publish/:token', 'validateUser', function ($id, $token) use($app) {
$j = new Jobs($id);
$job = $j->getJobFromToken($token);
$title = $j->getSlugTitle();
$city = $j->getJobCity($job->city);
$category = $j->getJobCategory($job->category);
if (isset($job) && $job->id) {
$app->render(ADMIN_THEME . 'job.publish.php', array('job' => $job, 'city' => $city, 'category' => $category));
} else {
$app->redirect(ADMIN_URL . "jobs/{$id}/{$title}");
}
});
示例2: time
$data['logo'] = time() . '_' . $file['name'];
$data['logo_type'] = $file['type'];
$data['logo_size'] = $file['size'];
$ext = strtolower(pathinfo($data['logo'], PATHINFO_EXTENSION));
if (move_uploaded_file($file['tmp_name'], "{$path}{$data['logo']}") && isValidImageExt($ext)) {
$resize = new ResizeImage("{$path}{$data['logo']}");
$resize->resizeTo(LOGO_H, LOGO_W);
$resize->saveImage("{$path}thumb_{$data['logo']}");
} else {
$data['logo'] = '';
}
} else {
$data['logo'] = $job->logo;
}
$data['step'] = 3;
$j->jobCreateUpdate($data);
if (!$j->getStatus()) {
$app->flash('success', $lang->t('alert|activation_email', $job->email));
} else {
$app->flash('success', $lang->t('alert|edit_successful'));
}
$app->redirect(BASE_URL . "jobs/{$id}/publish/{$token}");
});
// get publish job details
$app->get('/:id/publish/:token', 'isJobPostAllowed', 'isBanned', 'isValidReferrer', function ($id, $token) use($app) {
global $lang;
$j = new Jobs($id);
$job = $j->getJobFromToken($token);
$title = $j->getSlugTitle();
$city = $j->getJobCity($job->city);
$category = $j->getJobCategory($job->category);