function edit_resume_audit($id, $audit, $reason, $pms_notice) { global $db, $_CFG; $audit = intval($audit); 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('resume') . " SET audit='{$audit}' WHERE id IN ({$sqlin}) ")) { return false; } if (!$db->query("update " . table('resume_search_key') . " SET audit='{$audit}' WHERE id IN ({$sqlin}) ")) { return false; } if (!$db->query("update " . table('resume_search_rtime') . " SET audit='{$audit}' WHERE id IN ({$sqlin}) ")) { return false; } if (!$db->query("update " . table('resume_search_tag') . " SET audit='{$audit}' WHERE id IN ({$sqlin}) ")) { return false; } foreach ($id as $key => $value) { set_resume_entrust($value); } // distribution_resume($id); //发送站内信 if ($pms_notice == '1') { $result = $db->query("SELECT fullname,title,uid FROM " . table('resume') . " WHERE id IN ({$sqlin})"); $reason = $reason == '' ? '原因:未知' : '原因:' . $reason; while ($list = $db->fetch_array($result)) { $user_info = get_user($list['uid']); $setsqlarr['message'] = $audit == '1' ? "您创建的简历:{$list['title']},真实姓名:{$list['fullname']},成功通过网站管理员审核!" : "您创建的简历:{$list['title']},真实姓名:{$list['fullname']},未通过网站管理员审核,{$reason}"; $setsqlarr['msgtype'] = 1; $setsqlarr['msgtouid'] = $user_info['uid']; $setsqlarr['msgtoname'] = $user_info['username']; $setsqlarr['dateline'] = time(); $setsqlarr['replytime'] = time(); $setsqlarr['new'] = 1; inserttable(table('pms'), $setsqlarr); } } //审核未通过增加原因 if ($audit == '3') { foreach ($id as $list) { $auditsqlarr['resume_id'] = $list; $auditsqlarr['reason'] = $reason; $auditsqlarr['addtime'] = time(); inserttable(table('audit_reason'), $auditsqlarr); } } //发送邮件 $mailconfig = get_cache('mailconfig'); //获取邮件规则 $sms = get_cache('sms_config'); if ($audit == "1" && $mailconfig['set_resumeallow'] == "1") { $result = $db->query("SELECT * FROM " . table('resume') . " WHERE id IN ({$sqlin}) "); while ($list = $db->fetch_array($result)) { dfopen($_CFG['site_domain'] . $_CFG['site_dir'] . "plus/asyn_mail.php?uid=" . $list['uid'] . "&key=" . asyn_userkey($list['uid']) . "&act=set_resumeallow"); } } if ($audit == "3" && $mailconfig['set_resumenotallow'] == "1") { $result = $db->query("SELECT * FROM " . table('resume') . " WHERE id IN ({$sqlin}) "); while ($list = $db->fetch_array($result)) { dfopen($_CFG['site_domain'] . $_CFG['site_dir'] . "plus/asyn_mail.php?uid=" . $list['uid'] . "&key=" . asyn_userkey($list['uid']) . "&act=set_resumenotallow"); } } //sms if ($audit == "1" && $sms['open'] == "1" && $sms['set_resumeallow'] == "1") { $result = $db->query("SELECT * FROM " . table('resume') . " WHERE id IN ({$sqlin}) "); while ($list = $db->fetch_array($result)) { $user_info = get_user($list['uid']); if ($user_info['mobile_audit'] == "1") { dfopen($_CFG['site_domain'] . $_CFG['site_dir'] . "plus/asyn_sms.php?uid=" . $list['uid'] . "&key=" . asyn_userkey($list['uid']) . "&act=set_resumeallow"); } } } //sms if ($audit == "3" && $sms['open'] == "1" && $sms['set_resumenotallow'] == "1") { $result = $db->query("SELECT * FROM " . table('resume') . " WHERE id IN ({$sqlin}) "); while ($list = $db->fetch_array($result)) { $user_info = get_user($list['uid']); if ($user_info['mobile_audit'] == "1") { dfopen($_CFG['site_domain'] . $_CFG['site_dir'] . "plus/asyn_sms.php?uid=" . $list['uid'] . "&key=" . asyn_userkey($list['uid']) . "&act=set_resumenotallow"); } } } //sms //发送邮件 return true; } return false; }
} elseif ($act == "set_entrust") { $uid = intval($_SESSION['uid']); $pid = intval($_REQUEST['pid']); $setsqlarr['entrust'] = intval($_POST['entrust']); $ensetsqlarr['entrust'] = $setsqlarr['entrust']; $setsqlarr['entrust_start'] = intval(time()); if ($setsqlarr['entrust'] == 1) { $setsqlarr['entrust_end'] = strtotime("+7 day"); } elseif ($setsqlarr['entrust'] == 2) { $setsqlarr['entrust_end'] = strtotime("+14 day"); } else { $setsqlarr['entrust_end'] = strtotime("+30 day"); } $setsqlarr['isshield'] = intval($_POST['isshield']); //设置简历委托 if (set_resume_entrust($pid, $setsqlarr)) { $db->updatetable(table('resume'), $ensetsqlarr, " id='" . $pid . "' AND uid='" . $uid . "'"); exit("委托成功"); } else { exit("委托失败"); } } elseif ($act == "set_entrust_del") { if (intval($_GET['pid']) == 0) { showmsg('参数错误!', 1); } $db->updatetable(table('resume'), array("entrust" => 0), " id='" . intval($_GET['pid']) . "' AND uid='" . intval($_SESSION['uid']) . "'"); $db->query("delete from " . table("resume_entrust") . " where id=" . intval($_GET['pid']) . ""); showmsg("取消委托成功!", 2); } elseif ($act == 'save_education') { $id = intval($_POST['id']); $setsqlarr['uid'] = intval($_SESSION['uid']);
$setsqlarr['sex'] = trim($_POST['sex']) ? trim($_POST['sex']) : exit("请选择性别"); $setsqlarr['sex_cn'] = trim($_POST['sex_cn']) ? trim($_POST['sex_cn']) : exit("请选择性别"); $setsqlarr['birthdate'] = intval($_POST['birthdate']) ? intval($_POST['birthdate']) : exit("请选择出生年份"); $setsqlarr['residence'] = trim($_POST['residence']) ? trim($_POST['residence']) : exit("请选择现居住地"); $setsqlarr['residence'] = trim($_POST['residence']) ? trim($_POST['residence']) : exit("请选择现居住地"); $setsqlarr['education'] = intval($_POST['education']) ? intval($_POST['education']) : exit("请选择获得学历"); $setsqlarr['education_cn'] = trim($_POST['education_cn']) ? trim($_POST['education_cn']) : exit("请选择获得学历"); $setsqlarr['experience'] = intval($_POST['experience']) ? intval($_POST['experience']) : exit("请选择工作经验"); $setsqlarr['experience_cn'] = trim($_POST['experience_cn']) ? trim($_POST['experience_cn']) : exit("请选择工作经验"); $setsqlarr['email'] = trim($_POST['email']) ? trim($_POST['email']) : exit("请填写邮箱"); $setsqlarr['email_notify'] = $_POST['email_notify'] == "1" ? 1 : 0; $setsqlarr['telephone'] = trim($_POST['telephone']) ? trim($_POST['telephone']) : exit("请填写手机"); $db->updatetable(table('resume'), $setsqlarr, " id='" . intval($_POST['pid']) . "' AND uid='{$setsqlarr['uid']}'"); check_resume($_SESSION['uid'], intval($_REQUEST['pid'])); if ($_CFG['audit_edit_resume'] != "-1") { set_resume_entrust(intval($_REQUEST['pid'])); } write_memberslog($_SESSION['uid'], 2, 1105, $_SESSION['username'], "修改了简历({$_POST['title']})"); $infoarr['realname'] = $setsqlarr['fullname']; $infoarr['sex'] = $setsqlarr['sex']; $infoarr['sex_cn'] = $setsqlarr['sex_cn']; $infoarr['birthday'] = $setsqlarr['birthdate']; $infoarr['residence'] = $setsqlarr['residence']; $infoarr['residence'] = $setsqlarr['residence']; $infoarr['education'] = $setsqlarr['education']; $infoarr['education_cn'] = $setsqlarr['education_cn']; $infoarr['experience'] = $setsqlarr['experience']; $infoarr['experience_cn'] = $setsqlarr['experience_cn']; $infoarr['phone'] = $setsqlarr['telephone']; $infoarr['email'] = $setsqlarr['email']; $infoarr['uid'] = intval($_SESSION['uid']);