Beispiel #1
0
function resume_one($id)
{
    global $db;
    $id = intval($id);
    if (intval($_SESSION['uid']) > 0 && intval($_SESSION['utype']) == 1) {
        $check = check_view_log(intval($_SESSION['uid']), $id);
        if (!$check) {
            add_view_log(intval($_SESSION['uid']), $id);
        }
    }
    $db->query("update " . table('resume') . " set click=click+1 WHERE id='{$id}'  LIMIT 1");
    $wheresql = " WHERE id='{$id}'";
    $sql = "select * from " . table('resume') . $wheresql . " LIMIT 1";
    $val = $db->getone($sql);
    if ($val['display_name'] == "2") {
        $val['fullname'] = "N" . str_pad($val['id'], 7, "0", STR_PAD_LEFT);
        $val['fullname_'] = $val['fullname'];
    } elseif ($val['display_name'] == "3") {
        if ($val['sex'] == 1) {
            $val['fullname'] = cut_str($val['fullname'], 1, 0, "先生");
        } elseif ($val['sex'] == 2) {
            $val['fullname'] = cut_str($val['fullname'], 1, 0, "女士");
        }
        $val['fullname_'] = $val['fullname'];
    } else {
        $val['fullname_'] = $val['fullname'];
        $val['fullname'] = $val['fullname'];
    }
    if ($val['talent'] == 1) {
        $val['talent_'] = "1";
        $val['talent'] = "普通";
    } elseif ($val['talent'] == 2) {
        $val['talent_'] = "2";
        $val['talent'] = "高级";
    }
    $val['fullname_3'] = cut_str($val['fullname'], 1, 0, "先生/女士");
    $val['age'] = date("Y") - $val['birthdate'];
    $val['education_list'] = get_this_education_all($val['uid'], $val['id']);
    //统计教育经历数
    $education_num = 0;
    foreach ($val['education_list'] as $key => $value) {
        $education_num++;
    }
    $val['education_num'] = $education_num;
    $val['work_list'] = get_this_work_all($val['uid'], $val['id']);
    //统计工作经历数 和 每份工作时间
    $work_num = 0;
    foreach ($val['work_list'] as $key => $value) {
        $work_num++;
        if ($value['todate'] == 1) {
            $value['work_time'] = intval((time() - strtotime($value['startyear'] . "-" . $value['startmonth'] . "-" . "01")) / 2592000);
        } else {
            $value['work_time'] = intval((strtotime($value['endyear'] . "-" . $value['endmonth'] . "-" . "01") - strtotime($value['startyear'] . "-" . $value['startmonth'] . "-" . "01")) / 2592000);
        }
        $val['work_list'][$key] = $value;
    }
    $val['work_num'] = $work_num;
    $val['training_list'] = get_this_training_all($val['uid'], $val['id']);
    //统计培训经历数
    $training_num = 0;
    foreach ($val['training_list'] as $key => $value) {
        $training_num++;
    }
    $val['training_num'] = $training_num;
    if ($val['tag_cn']) {
        $tag_cn = explode(',', $val['tag_cn']);
        $val['tag_cn'] = $tag_cn;
        foreach ($val['tag_cn'] as $key => $value) {
            $tag_one['cn'] = $value;
            $tag_one['key'] = $key + 1;
            $val['tag_cn_list'][] = $tag_one;
        }
    } else {
        $val['tag_cn'] = array();
    }
    $two_week_time = strtotime("-2 week");
    //两周内被浏览的次数
    $val['click_num'] = $db->get_total("SELECT COUNT(*) AS num FROM " . table('view_resume') . " WHERE resumeid=" . $val['id'] . " and addtime > " . $two_week_time);
    //两周内被下载的次数
    $val['down_num'] = $db->get_total("SELECT COUNT(*) AS num FROM " . table('company_down_resume') . " WHERE resume_id=" . $val['id'] . " and down_addtime > " . $two_week_time);
    //两周内投递的次数
    $val['apply_num'] = $db->get_total("SELECT COUNT(*) AS num FROM " . table('personal_jobs_apply') . " WHERE resume_id=" . $val['id'] . " and apply_addtime > " . $two_week_time);
    //该简历会员信息
    $sql = "select mobile_audit from " . table("members") . " where uid={$val['uid']} ";
    $members_info = $db->getone($sql);
    $val['mobile_audit'] = $members_info['mobile_audit'];
    //判断是否是自己预览
    //个人自己预览
    if ($_SESSION['utype'] == '2' && $_SESSION['uid'] == $val['uid']) {
        $val['isminesee'] = '1';
    }
    return $val;
}
Beispiel #2
0
function resume_one($id)
{
    global $db;
    $id = intval($id);
    $db->query("update " . table('resume') . " set click=click+1 WHERE id='{$id}'  LIMIT 1");
    $wheresql = " WHERE id='{$id}'";
    $sql = "select * from " . table('resume') . $wheresql . " LIMIT 1";
    $val = $db->getone($sql);
    if ($val['display_name'] == "2") {
        $val['fullname'] = "N" . str_pad($val['id'], 7, "0", STR_PAD_LEFT);
        $val['fullname_'] = $val['fullname'];
    } elseif ($val['display_name'] == "3") {
        if ($val['sex'] == 1) {
            $val['fullname'] = cut_str($val['fullname'], 1, 0, "先生");
        } elseif ($val['sex'] == 2) {
            $val['fullname'] = cut_str($val['fullname'], 1, 0, "女士");
        }
        $val['fullname_'] = $val['fullname'];
    } else {
        $val['fullname_'] = $val['fullname'];
        $val['fullname'] = $val['fullname'];
    }
    if ($val['talent'] == 1) {
        $val['talent_'] = "1";
        $val['talent'] = "普通";
    } elseif ($val['talent'] == 2) {
        $val['talent_'] = "2";
        $val['talent'] = "高级";
    }
    $val['fullname_3'] = cut_str($val['fullname'], 1, 0, "先生/女士");
    $val['age'] = date("Y") - $val['birthdate'];
    $val['education_list'] = get_this_education_all($val['uid'], $val['id']);
    $val['work_list'] = get_this_work_all($val['uid'], $val['id']);
    $val['training_list'] = get_this_training_all($val['uid'], $val['id']);
    if ($val['tag_cn']) {
        $tag_cn = explode(',', $val['tag_cn']);
        $val['tag_cn'] = $tag_cn;
    } else {
        $val['tag_cn'] = array();
    }
    return $val;
}