public function resumePreview() { if (isset($_REQUEST['userId'])) { $where['user_id'] = $_REQUEST['userId']; } else { if (!empty($_SESSION['user']['id'])) { $where['user_id'] = $_SESSION['user']['id']; } } $personalInfo = D('PersonalInfo')->getPersonalInfo(); $position = M('zhaopin')->where('id=' . $personalInfo['zhaopin_id'])->find(); $educations = D('Education')->getEducation(); $jobs = D('Job')->getJob(); foreach ($jobs as &$j) { $j['jobtitle'] = jobTitleToString($j['jobtitle']); } $practices = D('Practice')->getPractice(); $partTimeJobs = D('PartTimeJob')->getPartTimeJob(); $languages = M('language')->where($where)->select(); $certificates = M('certificate')->where($where)->select(); $papers = D('Paper')->getPaper(); $rewards = D('Rewards')->getRewards(); $accessorys = M('accessory')->where($where)->select(); $tasks = M('task')->where($where)->select(); $this->assign('personalInfo', $personalInfo)->assign('position', $position)->assign('educations', $educations)->assign('jobs', $jobs)->assign('practices', $practices)->assign('partTimeJobs', $partTimeJobs)->assign('languages', $languages)->assign('certificates', $certificates)->assign('papers', $papers)->assign('rewards', $rewards)->assign('accessorys', $accessorys)->assign('tasks', $tasks); $this->selected = '0'; if (is_null($_SESSION['user']) && is_null($_SESSION['admin'])) { $this->display('html/index'); } else { $this->display('html/resume_preview'); } }
public function exportPersonalInfo() { $params = addslashes($_REQUEST['params']); $params = str_replace('&', ',', $params); $params = str_replace('=', ':', $params); $arr = paramsToArr($params); $paramsArr = array(); if (!empty($arr['education'])) { $paramsArr['pi.education'] = urldecode($arr['education']); } if (!empty($arr['depart_code'])) { $paramsArr['depart_code'] = $arr['depart_code']; } if (!empty($arr['name'])) { $paramsArr['name'] = array('like', "%" . $arr['name'] . "%"); } if (!empty($arr['status'])) { $paramsArr['status'] = $arr['status']; if ($arr['status'] == 3) { $paramsArr['status'] = array('in', array(3, 4)); } } else { $paramsArr['status'] = array('gt', 0); } $data = M('personal_information pi')->join('left join zhaopin on zhaopin.id = pi.zhaopin_id')->join('left join education on (pi.user_id = education.user_id and pi.education = education.education)')->join('left join job on pi.user_id = job.user_id')->field('pi.user_id,name,gender,nation,native_place,card_no,position,depart_code,current,max(job.jobtitle) as jobtitle, pi.education,education.major,train,education.school,job.workon,link1,status,pi.remark,pi.submit_time')->group('pi.user_id')->order('null')->where($paramsArr)->select(); for ($i = 0; $i < count($data); $i++) { switch ($data[$i]['status']) { case '1': $data[$i]['status'] = '未审核'; break; case '3': $data[$i]['status'] = '审核通过'; break; case '4': $data[$i]['status'] = '审核通过'; break; case '2': $data[$i]['status'] = '审核不通过'; break; case '5': $data[$i]['status'] = '重新填写待审核'; break; } $data[$i]['native_place'] = str_replace(array('直辖市', '市辖区', '|区|', '|县|', '|市|', '|', '请选择'), '', $data[$i]['native_place']); $data[$i]['card_no'] = $data[$i]['card_no']; $data[$i]['jobtitle'] = jobTitleToString($data[$i]['jobtitle']); if ($data[$i]['submit_time']) { $data[$i]['submit_time'] = date('Y-m-d H:i:s', $data[$i]['submit_time']); } } $ths = '应聘者编号,姓名,性别,民族,籍贯,身份证号码,应聘科室,岗位代码,应/往届,职称,学历学位,专业,培养方式,' . '毕业院校,工作单位,联系方式,审核状态,审核备注,提交时间'; $titles = explode(',', $ths); $filename = '应聘人员信息'; set_time_limit(0); D('Common')->exportExcel($data, $titles, $filename); }