本文整理匯總了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');
}