function do_import_resume($info, $uid) { global $db, $_CFG, $timestamp; if ($info && $uid) { require_once QISHI_ROOT_PATH . '/include/fun_import.php'; if (empty($info['basicinfo'])) { return false; } $info['basicinfo']['fullname'] = unicode_decode($info['basicinfo']['fullname']); $setsqlarr = iconv_to_gbk($info['basicinfo']); $setsqlarr['uid'] = intval($uid); $setsqlarr['title'] = "未命名简历"; $setsqlarr['display_name'] = 1; $setsqlarr['sex'] = $setsqlarr['sex_cn'] == '男' ? 1 : 2; $experience = match_experience($setsqlarr['experience_cn']); $setsqlarr['experience_cn'] = $experience[1]; $setsqlarr['experience'] = $experience[0]; $setsqlarr['email_notify'] = 1; $setsqlarr['marriage'] = $setsqlarr['marriage_cn'] == '已婚' ? 2 : 1; $intentionjobsarr = explode('、', $setsqlarr['intention_jobs']); $match_jobs_id_arr = array(); $match_jobs_cn_arr = array(); foreach ($intentionjobsarr as $key => $value) { $match_jobs_arr = match_jobs_category($value); if ($match_jobs_arr) { $match_jobs_id_arr[] = $match_jobs_arr['topclass'] . '.' . $match_jobs_arr['category'] . '.' . $match_jobs_arr['subclass']; $match_jobs_cn_arr[] = $match_jobs_arr['category_cn']; } } $setsqlarr['intention_jobs'] = !empty($match_jobs_cn_arr) ? implode(',', $match_jobs_cn_arr) : ''; $intention_jobs_id = !empty($match_jobs_id_arr) ? implode(',', $match_jobs_id_arr) : ''; $tradearr = explode('、', $setsqlarr['trade_cn']); $match_trade_id_arr = array(); foreach ($tradearr as $key => $value) { $match_trade_arr = match_trade($value); if ($match_trade_arr) { $match_trade_id_arr[] = $match_jobs_arr['id']; } } $intentiontrade = !empty($match_trade_id_arr) ? implode(',', $match_trade_id_arr) : ''; $districtarr = explode('、', $setsqlarr['district_cn']); $match_district_id_arr = array(); foreach ($districtarr as $key => $value) { $match_district_arr = match_district($value); if ($match_district_arr) { $match_district_id_arr[] = $match_district_arr['district'] . '.' . $match_district_arr['sdistrict']; } } $intentiondistrict = !empty($match_district_id_arr) ? implode(',', $match_district_id_arr) : ''; $match_current_arr = match_current($setsqlarr['current_cn']); if ($match_current_arr) { $setsqlarr['current'] = $match_current_arr['id']; $setsqlarr['current_cn'] = $match_current_arr['cn']; } $match_nature_arr = match_nature($setsqlarr['nature_cn']); if ($match_nature_arr) { $setsqlarr['nature'] = $match_nature_arr['id']; $setsqlarr['nature_cn'] = $match_nature_arr['cn']; } $match_wage_arr = match_wage($setsqlarr['wage_cn']); if ($match_wage_arr) { $setsqlarr['wage'] = $match_wage_arr['id']; $setsqlarr['wage_cn'] = $match_wage_arr['cn']; } $setsqlarr['refreshtime'] = $timestamp; $setsqlarr['audit'] = intval($_CFG['audit_resume']); $setsqlarr['resume_from_pc'] = 1; $setsqlarr['addtime'] = $timestamp; $pid = $db->inserttable(table('resume'), $setsqlarr, 1); if ($pid) { $searchtab['id'] = $pid; $searchtab['uid'] = $uid; $db->inserttable(table('resume_search_key'), $searchtab); $db->inserttable(table('resume_search_rtime'), $searchtab); add_resume_jobs($pid, $uid, $intention_jobs_id) ? "" : showmsg('保存失败!', 0); add_resume_district($pid, $uid, $intentiondistrict) ? "" : showmsg('保存失败!', 0); add_resume_trade($pid, $uid, $intentiontrade) ? "" : showmsg('保存失败!', 0); if (!get_userprofile($uid)) { $infoarr['realname'] = $setsqlarr['fullname']; $infoarr['sex'] = $setsqlarr['sex']; $infoarr['sex_cn'] = $setsqlarr['sex_cn']; $infoarr['birthday'] = $setsqlarr['birthdate']; $infoarr['residence'] = $setsqlarr['residence']; $infoarr['experience'] = $setsqlarr['experience']; $infoarr['experience_cn'] = $setsqlarr['experience_cn']; $infoarr['householdaddress'] = $setsqlarr['householdaddress']; $infoarr['marriage'] = $setsqlarr['marriage']; $infoarr['marriage_cn'] = $setsqlarr['marriage_cn']; $infoarr['phone'] = $setsqlarr['telephone']; $infoarr['email'] = $setsqlarr['email']; $infoarr['uid'] = intval($uid); $db->inserttable(table('members_info'), $infoarr); } //教育经历 if (!empty($info['eduinfo'])) { foreach ($info['eduinfo'] as $key => $value) { $eduarrsql = iconv_to_gbk($value); $eduarrsql['pid'] = $pid; $eduarrsql['uid'] = $uid; $match_education_arr = match_education($eduarrsql['education_cn']); if ($match_education_arr) { $eduarrsql['education'] = $match_education_arr['id']; $eduarrsql['education_cn'] = $match_education_arr['cn']; } $db->inserttable(table("resume_education"), $eduarrsql); } } //工作经历 if (!empty($info['workinfo'])) { foreach ($info['workinfo'] as $key => $value) { $workarrsql = iconv_to_gbk($value); $workarrsql['pid'] = $pid; $workarrsql['uid'] = $uid; $db->inserttable(table("resume_work"), $workarrsql); } } //培训经历 if (!empty($info['traininginfo'])) { foreach ($info['traininginfo'] as $key => $value) { $trainingarrsql = iconv_to_gbk($value); $trainingarrsql['pid'] = $pid; $trainingarrsql['uid'] = $uid; $db->inserttable(table("resume_training"), $trainingarrsql); } } //语言能力 if (!empty($info['languageinfo'])) { foreach ($info['languageinfo'] as $key => $value) { $languagearrsql = iconv_to_gbk($value); $languagearrsql['pid'] = $pid; $languagearrsql['uid'] = $uid; $match_language_arr = match_language($languagearrsql['language_cn']); if ($match_language_arr) { $languagearrsql['language'] = $match_language_arr['id']; $languagearrsql['language_cn'] = $match_language_arr['cn']; } $match_language_level_arr = match_language_level($languagearrsql['level_cn']); if ($match_language_level_arr) { $languagearrsql['level'] = $match_language_level_arr['id']; $languagearrsql['level_cn'] = $match_language_level_arr['cn']; } $db->inserttable(table("resume_language"), $languagearrsql); } } //证书 if (!empty($info['credentinfo'])) { foreach ($info['credentinfo'] as $key => $value) { $credentarrsql = iconv_to_gbk($value); $credentarrsql['pid'] = $pid; $credentarrsql['uid'] = $uid; $db->inserttable(table("resume_credent"), $credentarrsql); } } check_resume($uid, $pid); write_memberslog($uid, 2, 1101, $_SESSION['username'], "导入了简历"); return true; } else { return false; } } else { return false; } }
$setsqlarr['subsite_id'] = !empty($_POST['subsite_id']) ? intval($_POST['subsite_id']) : exit('请选择期望工作地区!'); $setsqlarr['district'] = intval($_POST['district']); $setsqlarr['sdistrict'] = intval($_POST['sdistrict']); $setsqlarr['district_cn'] = !utf8_to_gbk(trim($_POST['district_cn'])) ? utf8_to_gbk(trim($_POST['subsite_name'])) : utf8_to_gbk(trim($_POST['subsite_name'])) . '/' . utf8_to_gbk(trim($_POST['district_cn'])); $setsqlarr['nature'] = intval($_POST['nature']) ? intval($_POST['nature']) : exit('请选择期望岗位性质!'); $setsqlarr['nature_cn'] = utf8_to_gbk(trim($_POST['nature_cn'])); //目前状态 $setsqlarr['current'] = intval($_POST['current']) ? intval($_POST['current']) : exit('请选择目前状态!'); $setsqlarr['current_cn'] = utf8_to_gbk(trim($_POST['current_cn'])); $setsqlarr['wage'] = intval($_POST['wage']) ? intval($_POST['wage']) : exit('请选择期望薪资!'); $setsqlarr['wage_cn'] = utf8_to_gbk(trim($_POST['wage_cn'])); $setsqlarr['refreshtime'] = $timestamp; $_CFG['audit_edit_resume'] != "-1" ? $setsqlarr['audit'] = intval($_CFG['audit_edit_resume']) : ""; $db->updatetable(table('resume'), $setsqlarr, " id='" . intval($_REQUEST['pid']) . "' AND uid='{$setsqlarr['uid']}'"); add_resume_jobs(intval($_REQUEST['pid']), $_SESSION['uid'], $_POST['intention_jobs_id']) ? "" : showmsg('保存失败!', 0); add_resume_trade(intval($_REQUEST['pid']), $_SESSION['uid'], $_POST['trade']) ? "" : showmsg('保存失败!', 0); check_resume($_SESSION['uid'], intval($_REQUEST['pid'])); if ($_CFG['audit_edit_resume'] != "-1") { set_resume_entrust(intval($_REQUEST['pid'])); } $title = utf8_to_gbk(trim($_POST['title'])); write_memberslog($_SESSION['uid'], 2, 1105, $_SESSION['username'], "修改了简历({$title})"); exit("success"); } elseif ($act == 'resume_logo_save') { $resume_basic = get_resume_basic(intval($_SESSION['uid']), intval($_REQUEST['param1'])); if ($resume_basic['photo_img']) { @unlink("../../data/" . $_CFG['_resume_photo_dir'] . "/" . $resume_basic['photo_img']); @unlink("../../data/" . $_CFG['_resume_photo_dir_thumb'] . "/" . $resume_basic['photo_img']); } $updir = date('Y/m/d'); $savePath = "../../data/" . $_CFG['_resume_photo_dir'] . "/" . $updir;
$user_info['education'] = $setsqlarr['education']; $user_info['education_cn'] = $setsqlarr['education_cn']; $user_info['experience'] = $setsqlarr['experience']; $user_info['experience_cn'] = $setsqlarr['experience_cn']; $user_info['phone'] = $setsqlarr['telephone']; $db->inserttable(table('members_info'), $user_info); // 创建 简历 $setsqlarr['uid'] = $insert_id; $pid = $db->inserttable(table('resume'), $setsqlarr, 1); $searchtab['id'] = $pid; $searchtab['uid'] = $insert_id; $db->inserttable(table('resume_search_key'), $searchtab); $db->inserttable(table('resume_search_rtime'), $searchtab); add_resume_jobs($pid, $insert_id, $_POST['intention_jobs_id']); add_resume_district($pid, $_SESSION['uid'], $_POST['district']); add_resume_trade($pid, $_SESSION['uid'], $_POST['trade']); check_resume($_SESSION['uid'], $pid); // 直接投递简历 $jobsarr = app_get_jobs($_POST['jobsid']); foreach ($jobsarr as $jobs) { $jobs = array_map("addslashes", $jobs); $addarr['resume_id'] = $pid; $addarr['resume_name'] = $setsqlarr['fullname']; $addarr['personal_uid'] = $insert_id; $addarr['jobs_id'] = $jobs['id']; $addarr['jobs_name'] = $jobs['jobs_name']; $addarr['company_id'] = $jobs['company_id']; $addarr['company_name'] = $jobs['companyname']; $addarr['company_uid'] = $jobs['uid']; $addarr['apply_addtime'] = time(); $addarr['personal_look'] = 1;