本文整理汇总了PHP中field::filterField方法的典型用法代码示例。如果您正苦于以下问题:PHP field::filterField方法的具体用法?PHP field::filterField怎么用?PHP field::filterField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类field
的用法示例。
在下文中一共展示了field::filterField方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createResumeEdu
/**
* 教育和工作
*/
function createResumeEdu()
{
$db = M('resume_edu');
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$field = new field(7);
$_POST = $field->filterField($_POST);
$field = new field(12);
$_POST = $field->filterField($_POST);
parse_str($_POST['resume_edu'], $_POST['resume_edu']);
$_POST['uid'] = $_SESSION['uid'];
$_POST['job_desc'] = strip_tags($_POST['job_desc']);
$_POST['job_start'] = strtotime($_POST['job_start']);
$_POST['job_end'] = strtotime($_POST['job_end']);
$resume_edu = $_POST['resume_edu'];
$resume_edu['edu_start'] = strtotime($resume_edu['edu_start']);
$resume_edu['edu_end'] = strtotime($resume_edu['edu_end']);
$resume_edu['resume_id'] = $_POST['resume_id'];
$resume_edu['uid'] = $_SESSION['uid'];
$db->insert($resume_edu);
unset($_POST['resume_edu']);
$result = $db->table('work_exp')->insert($_POST);
if ($result) {
go(__CONTROL__ . '/createResumeAppend/resume_id/' . $_POST['resume_id']);
}
}
$this->display('profile/createResumeEdu');
}
示例2: issueRecruit
/**
* 企业发布招聘信息
*/
function issueRecruit()
{
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$_POST['uid'] = $_SESSION['uid'];
/* 发布时间 */
if ($_POST['issue_type'] == '1') {
$_POST['start_time'] = time();
} else {
$_POST['start_time'] = strtotime($_POST['start_time']);
}
/* 计算到期时间 */
$_POST['expiration_time'] = $_POST['start_time'] + $_POST['effective_time'] * 24 * 60 * 60;
if (C('VERIFY_RECRUIT')) {
//如果开启了审核职位:0未通过,1通过,2审核中
$_POST['verify'] = 2;
} else {
$_POST['verify'] = 1;
}
if (empty($_POST['seo_desc'])) {
//职位简要
$_POST['seo_desc'] = mb_substr(strip_tags($_POST['job_desc']), 0, 80, 'UTF-8');
}
$field = new field(5);
$_POST = $field->filterField($_POST);
$_POST['created'] = time();
//添加时间
//处理SEO关键字(截取职位名称)
$_POST['seo_keywords'] = implode(',', array_keys(string::split_word($_POST['recruit_name'])));
$_POST['refresh_date'] = $_POST['start_time'];
$point = abs(getPointRule('issueRecruit'));
//获得应扣取积分
$point *= $_POST['effective_time'];
if ($_SESSION['point'] < $point) {
$this->error('亲爱的用户,你的积分不够啦。请联系管理员充值');
}
$result = $this->recruit->addRecruit($_POST);
if ($result) {
deductPoint(-$point);
//扣取积分
$con = '发布一个职位信息--<a href="' . __APP__ . '/search/jobs/id/' . $result . '" target="_blank">' . $_POST['recruit_name'] . '</a> 有效期:' . $_POST['effective_time'] . '天,共花费:' . $point . '积分。';
writeOptLog($con, -$point);
//写入日志
$this->success('发布招聘成功', 'index');
} else {
$this->error('发布招聘失败');
}
}
$this->display('company/issueRecruit');
}