Example #1
0
    $searchtab['district'] = $setsqlarr['district'];
    $searchtab['sdistrict'] = $setsqlarr['sdistrict'];
    $searchtab['education'] = $setsqlarr['education'];
    $searchtab['experience'] = $setsqlarr['experience'];
    $searchtab['wage'] = $setsqlarr['wage'];
    //
    updatetable(table('jobs_search_wage'), $searchtab, " id='{$id}'");
    updatetable(table('jobs_search_rtime'), $searchtab, " id='{$id}'");
    updatetable(table('jobs_search_stickrtime'), $searchtab, " id='{$id}'");
    updatetable(table('jobs_search_hot'), $searchtab, " id='{$id}'");
    updatetable(table('jobs_search_scale'), $searchtab, " id='{$id}'");
    $searchtab['key'] = $setsqlarr['key'];
    $searchtab['likekey'] = $setsqlarr['jobs_name'] . ',' . $company_profile['companyname'];
    updatetable(table('jobs_search_key'), $searchtab, " id='{$id}' ");
    unset($setsqlarr_contact, $setsqlarr);
    distribution_jobs($id);
    $link[0]['text'] = "返回职位列表";
    $link[0]['href'] = $_POST['url'];
    adminmsg("修改成功!", 2, $link);
} elseif ($act == 'company_list') {
    get_token();
    check_permissions($_SESSION['admin_purview'], "com_show");
    require_once QISHI_ROOT_PATH . 'include/page.class.php';
    $oederbysql = " order BY c.id DESC ";
    $key = isset($_GET['key']) ? trim($_GET['key']) : "";
    $key_type = isset($_GET['key_type']) ? intval($_GET['key_type']) : "";
    if ($key && $key_type > 0) {
        if ($key_type === 1) {
            $wheresql = " WHERE c.companyname like '%{$key}%'";
        } elseif ($key_type === 2) {
            $wheresql = " WHERE c.id ='" . intval($key) . "'";
Example #2
0
function delay_jobs($sqlin, $uid, $days, $mode = 1)
{
    global $db;
    $days = intval($days);
    $uid = intval($uid);
    $mode = intval($mode);
    $return = 0;
    if (empty($days)) {
        return false;
    }
    $time = time();
    if (preg_match("/^(\\d{1,10},)*(\\d{1,10})\$/", $sqlin)) {
        $result = $db->query("SELECT id,deadline FROM " . table('jobs') . " WHERE id IN ({$sqlin}) UNION ALL SELECT id,deadline FROM " . table('jobs_tmp') . " WHERE id IN ({$sqlin})");
        while ($row = $db->fetch_array($result)) {
            if ($row['deadline'] > $time) {
                $deadline = strtotime("+{$days} day", $row['deadline']);
            } else {
                $deadline = strtotime("+{$days} day");
            }
            if ($mode == 1) {
                if (!$db->query("update  " . table('jobs') . " SET deadline='{$deadline}'  WHERE id='{$row['id']}'  LIMIT 1")) {
                    return false;
                }
                if (!$db->query("update  " . table('jobs_tmp') . " SET deadline='{$deadline}'  WHERE id='{$row['id']}'  LIMIT 1")) {
                    return false;
                }
            } else {
                if (!$db->query("update  " . table('jobs') . " SET deadline='{$deadline}',setmeal_deadline=0  WHERE id='{$row['id']}'  LIMIT 1")) {
                    return false;
                }
                if (!$db->query("update  " . table('jobs_tmp') . " SET deadline='{$deadline}',setmeal_deadline=0  WHERE id='{$row['id']}'  LIMIT 1")) {
                    return false;
                }
            }
            distribution_jobs($row['id'], $uid);
        }
    }
    return true;
}
Example #3
0
    $searchtab['education'] = $setsqlarr['education'];
    $searchtab['experience'] = $setsqlarr['experience'];
    $searchtab['wage'] = $setsqlarr['wage'];
    $searchtab['graduate'] = $setsqlarr['graduate'];
    //
    $db->updatetable(table('jobs_search_wage'), $searchtab, " id='{$id}' AND uid='{$_SESSION['uid']}' ");
    $db->updatetable(table('jobs_search_rtime'), $searchtab, " id='{$id}' AND uid='{$_SESSION['uid']}' ");
    $db->updatetable(table('jobs_search_stickrtime'), $searchtab, " id='{$id}' AND uid='{$_SESSION['uid']}' ");
    $db->updatetable(table('jobs_search_hot'), $searchtab, " id='{$id}' AND uid='{$_SESSION['uid']}' ");
    $db->updatetable(table('jobs_search_scale'), $searchtab, " id='{$id}' AND uid='{$_SESSION['uid']}'");
    $searchtab['key'] = $setsqlarr['key'];
    $searchtab['likekey'] = $setsqlarr['jobs_name'] . ',' . $company_profile['companyname'];
    $db->updatetable(table('jobs_search_key'), $searchtab, " id='{$id}' AND uid='{$_SESSION['uid']}' ");
    unset($searchtab);
    add_jobs_tag(intval($_POST['id']), $_SESSION['uid'], $_POST['tag']) ? "" : showmsg('保存失败!', 0);
    distribution_jobs($id, $_SESSION['uid']);
    write_memberslog($_SESSION['uid'], $_SESSION['utype'], 2002, $_SESSION['username'], "修改了职位:{$setsqlarr['jobs_name']},职位ID:{$id}");
    showmsg("修改成功!", 2, $link);
} elseif ($act == "ajax_save_jobs_templates") {
    foreach ($_POST as $key => $value) {
        $_POST[$key] = utf8_to_gbk($value);
    }
    $setsqlarr['title'] = !empty($_POST['jobs_name']) ? trim($_POST['jobs_name']) . "的模板" : exit('-1');
    $setsqlarr['uid'] = intval($_SESSION['uid']);
    $setsqlarr['contents'] = !empty($_POST['contents']) ? trim($_POST['contents']) : exit('-1');
    $setsqlarr['nature'] = intval($_POST['nature']);
    $setsqlarr['nature_cn'] = trim($_POST['nature_cn']);
    $setsqlarr['sex'] = intval($_POST['sex']);
    $setsqlarr['sex_cn'] = trim($_POST['sex_cn']);
    $setsqlarr['amount'] = intval($_POST['amount']);
    $setsqlarr['topclass'] = intval($_POST['topclass']);
function locoyspider_addjobs($companyinfo)
{
    global $locoyspider, $db;
    $jobssetsqlarr['uid'] = $companyinfo['uid'];
    $jobssetsqlarr['companyname'] = $companyinfo['companyname'];
    $jobssetsqlarr['company_id'] = $companyinfo['id'];
    $jobssetsqlarr['company_addtime'] = $companyinfo['addtime'];
    $jobssetsqlarr['jobs_name'] = trim($_POST['jobs_name']);
    if (empty($jobssetsqlarr['jobs_name'])) {
        exit("职位名称丢失");
    }
    if (ck_jobs_name($jobssetsqlarr['jobs_name'], $jobssetsqlarr['uid'])) {
        exit("职位名称有重复");
    }
    $jobssetsqlarr['contents'] = html2text($_POST['jobs_contents']);
    $nature = locoyspider_jobs_nature(trim($_POST['jobs_nature']));
    $jobssetsqlarr['nature'] = $nature['id'];
    $jobssetsqlarr['nature_cn'] = $nature['cn'];
    $sex = locoyspider_jobs_sex(trim($_POST['jobs_sex']));
    $jobssetsqlarr['sex'] = $sex['id'];
    $jobssetsqlarr['sex_cn'] = $sex['cn'];
    //年龄要求
    $jobssetsqlarr['age'] = trim($_POST['jobs_age']);
    $jobssetsqlarr['amount'] = locoyspider_jobs_amount(trim($_POST['jobs_amount']));
    $jobs_category = trim($_POST['jobs_category']) ? trim($_POST['jobs_category']) : $jobssetsqlarr['jobs_name'];
    $category = locoyspider_jobs_category($jobs_category);
    //$_POST['jobs_category']
    //一级
    $jobssetsqlarr['topclass'] = $category['topclass'];
    $jobssetsqlarr['category'] = $category['category'];
    $jobssetsqlarr['subclass'] = $category['subclass'];
    $jobssetsqlarr['category_cn'] = $category['category_cn'];
    $jobssetsqlarr['trade'] = $companyinfo['trade'];
    $jobssetsqlarr['trade_cn'] = $companyinfo['trade_cn'];
    $district = locoyspider_jobs_district(trim($_POST['jobs_district']));
    $jobssetsqlarr['scale'] = $companyinfo['scale'];
    $jobssetsqlarr['scale_cn'] = $companyinfo['scale_cn'];
    $jobssetsqlarr['district'] = $district['district'];
    $jobssetsqlarr['sdistrict'] = $district['sdistrict'];
    $jobssetsqlarr['district_cn'] = $district['district_cn'];
    //街道id 和 街道
    $jobssetsqlarr['street'] = $companyinfo['street'];
    $jobssetsqlarr['street_cn'] = $companyinfo['street_cn'];
    $education = locoyspider_jobs_education(trim($_POST['jobs_education']));
    $jobssetsqlarr['education'] = $education['id'];
    $jobssetsqlarr['education_cn'] = $education['cn'];
    $experience = get_experience(trim($_POST['jobs_experience']));
    $jobssetsqlarr['experience'] = $experience['id'];
    $jobssetsqlarr['experience_cn'] = $experience['cn'];
    $wage = locoyspider_jobs_wage(trim($_POST['jobs_wage']));
    $jobssetsqlarr['wage'] = $wage['id'];
    $jobssetsqlarr['wage_cn'] = $wage['cn'];
    $jobssetsqlarr['addtime'] = time();
    $jobssetsqlarr['deadline'] = locoyspider_jobs_deadline();
    $jobssetsqlarr['refreshtime'] = time();
    $jobssetsqlarr['key'] = $jobssetsqlarr['jobs_name'] . $companyinfo['companyname'] . $jobssetsqlarr['category_cn'] . $jobssetsqlarr['district_cn'] . $jobssetsqlarr['contents'];
    require_once QISHI_ROOT_PATH . 'include/splitword.class.php';
    $sp = new SPWord();
    $jobssetsqlarr['key'] = "{$jobssetsqlarr['jobs_name']} {$companyinfo['companyname']} " . $sp->extracttag($jobssetsqlarr['key']);
    $jobssetsqlarr['key'] = $sp->pad($jobssetsqlarr['key']);
    $jobssetsqlarr['audit'] = $locoyspider['jobs_audit'];
    $jobssetsqlarr['display'] = $locoyspider['jobs_display'];
    $jobssetsqlarr['robot'] = 1;
    $pid = $db->inserttable(table('jobs'), $jobssetsqlarr, true);
    if (!$pid) {
        exit("添加招聘信息失败");
    }
    //职位联系方式
    $setsqlarr_contact['contact'] = trim($_POST['contact']);
    //QQ
    $setsqlarr_contact['qq'] = trim($_POST['qq']);
    $setsqlarr_contact['telephone'] = trim($_POST['telephone']);
    $setsqlarr_contact['address'] = trim($_POST['address']);
    $setsqlarr_contact['email'] = check_email(trim($_POST['email']));
    //3.4新增字段,3.5也有
    $setsqlarr_contact['contact_show'] = 1;
    $setsqlarr_contact['telephone_show'] = 1;
    $setsqlarr_contact['email_show'] = 1;
    $setsqlarr_contact['address_show'] = 1;
    $setsqlarr_contact['qq_show'] = 1;
    $setsqlarr_contact['notify'] = $locoyspider['jobs_notify'];
    $setsqlarr_contact['pid'] = $pid;
    if (!$db->inserttable(table('jobs_contact'), $setsqlarr_contact)) {
        exit("添加招聘联系方式失败");
    }
    //------
    $searchtab['id'] = $pid;
    $searchtab['uid'] = $jobssetsqlarr['uid'];
    $searchtab['recommend'] = $jobssetsqlarr['recommend'];
    $searchtab['emergency'] = $jobssetsqlarr['emergency'];
    $searchtab['nature'] = $jobssetsqlarr['nature'];
    $searchtab['sex'] = $jobssetsqlarr['sex'];
    $searchtab['topclass'] = $jobssetsqlarr['topclass'];
    $searchtab['category'] = $jobssetsqlarr['category'];
    $searchtab['subclass'] = $jobssetsqlarr['subclass'];
    $searchtab['trade'] = $jobssetsqlarr['trade'];
    $searchtab['district'] = $jobssetsqlarr['district'];
    $searchtab['sdistrict'] = $jobssetsqlarr['sdistrict'];
    $searchtab['street'] = $companyinfo['street'];
    $searchtab['education'] = $jobssetsqlarr['education'];
    $searchtab['experience'] = $jobssetsqlarr['experience'];
    $searchtab['wage'] = $jobssetsqlarr['wage'];
    $searchtab['refreshtime'] = $jobssetsqlarr['refreshtime'];
    $searchtab['scale'] = $jobssetsqlarr['scale'];
    //
    $db->inserttable(table('jobs_search_wage'), $searchtab);
    $db->inserttable(table('jobs_search_scale'), $searchtab);
    $db->inserttable(table('jobs_search_rtime'), $searchtab);
    //
    $searchtab['stick'] = $jobssetsqlarr['stick'];
    $db->inserttable(table('jobs_search_stickrtime'), $searchtab);
    unset($searchtab['stick']);
    //
    $searchtab['click'] = $jobssetsqlarr['click'];
    $db->inserttable(table('jobs_search_hot'), $searchtab);
    unset($searchtab['click']);
    //
    $searchtab['likekey'] = $jobssetsqlarr['jobs_name'] . ',' . $jobssetsqlarr['companyname'];
    $searchtab['key'] = $jobssetsqlarr['key'];
    $db->inserttable(table('jobs_search_key'), $searchtab);
    require_once ADMIN_ROOT_PATH . 'include/admin_company_fun.php';
    distribution_jobs($pid);
    exit("添加成功");
}
Example #5
0
function edit_jobs_display($id, $display)
{
    global $db;
    $display = intval($display);
    if (!is_array($id)) {
        $id = array($id);
    }
    $sqlin = implode(",", $id);
    if (preg_match("/^(\\d{1,10},)*(\\d{1,10})\$/", $sqlin)) {
        if (!$db->query("update  " . table('jobs') . " SET display='{$display}'  WHERE id IN ({$sqlin})")) {
            return false;
        }
        distribution_jobs($id);
        return true;
    }
    return false;
}
function distribution_jobs_uid($uid)
{
    global $db;
    $uid = intval($uid);
    $result = $db->query("select id from " . table('jobs') . " where uid={$uid} UNION ALL select id from " . table('jobs_tmp') . " where uid={$uid} ");
    while ($row = $db->fetch_array($result)) {
        $id[] = $row['id'];
    }
    if (!empty($id)) {
        return distribution_jobs($id, $uid);
    }
}