Пример #1
0
<?php

$j = new Job($_POST['job_id']);
$activator = $j->Activate();
$vali = new Postman();
$vali->MailPostActivatedToUser($j->GetInfo(), BASE_URL_ORIG);
Subscriber::sendJob($_POST['job_id']);
echo 1;
exit;
Пример #2
0
    // no errors
    if (empty($errors)) {
        if ($_POST['show_preview'] == 'true') {
            $smarty->assign('show_preview', true);
        } else {
            escape($_POST, array('description'));
            $data = array('company' => $company, 'url' => $url, 'title' => $title, 'summary' => $summary, 'city_id' => $city_id, 'category_id' => $category_id, 'type_id' => $type_id, 'description' => $description, 'location_outside_ro_where' => $isCitySelected ? '' : $location_outside_ro_where, 'apply' => '', 'poster_email' => $poster_email, 'apply_online' => $apply_online);
            if ($id != 0) {
                $job->Edit($data);
            } else {
                // a job posted by the admin is active from the beginning
                $data['is_temp'] = 0;
                $data['is_active'] = 1;
                $data['spotlight'] = 0;
                if ($jobId = $job->Create($data)) {
                    Subscriber::sendJob($jobId);
                }
            }
            $category = get_category_by_id($category_id);
            redirect_to(BASE_URL . URL_JOBS . '/' . $category['var_name'] . '/');
            exit;
        }
    } else {
        $smarty->assign('errors', $errors);
    }
}
$smarty->assign('job', $jobToEdit);
$smarty->assign('categories', get_categories());
$smarty->assign('types', get_types());
$smarty->assign('cities', get_cities());
$html_title = $translations['jobs']['title_edit'] . ' / ' . SITE_NAME;
Пример #3
0
<?php

$job = new Job($id);
$isNewPost = $job->mIsTemp;
$postRequiresModeration = !$job->IsApprovedPosterEmail() && ENABLE_NEW_POST_MODERATION;
if ($isNewPost) {
    $job->Publish();
}
$postMan = new Postman();
$jobInfo = $job->GetInfo();
$jobInfo['isNewPost'] = $isNewPost;
$jobInfo['postRequiresModeration'] = $postRequiresModeration;
$postMan->MailPublishToAdmin($jobInfo);
if ($postRequiresModeration) {
    if ($isNewPost) {
        $postMan->MailPublishPendingToUser($job->mPosterEmail);
    }
    $html_title = $translations['jobs']['add_success'] . ' / ' . SITE_NAME;
} else {
    if (!$job->mIsActive) {
        $job->Activate();
    }
    if ($isNewPost) {
        $postMan->MailPublishToUser($jobInfo);
        Subscriber::sendJob($id);
    }
    $html_title = $translations['jobs']['publish_success'] . ' / ' . SITE_NAME;
}
$smarty->assign('postRequiresModeration', $postRequiresModeration);
redirect_to(BASE_URL . 'confirm/' . $job->mId . '/' . ($postRequiresModeration ? 1 : 0) . '/');
exit;