'status','name' => '状态','value' => array('3' => '未开始','1' => '已开始','2' => '已结束')); $this -> yunset('search_list',$search_list); } function index_action(){ $this -> set_search(); if($_GET['keyword']){ $where['title'] = array('like',trim($_GET['keyword'])); $urlarr['keyword'] = $_GET['keyword']; } if($_GET['status'] == '3'){ $where['starttime'] = array('unixtime','>',time()); $urlarr['status'] = $_GET['status']; }elseif($_GET['status'] == '1'){ $where['starttime'] = array('unixtime','<',time()); $where['endtime'] = array('unixtime','>',time()); $urlarr['status']=$_GET['status']; }elseif($_GET['status'] == '2'){ $where['endtime'] = array('unixtime','<',time()); $urlarr['status'] = $_GET['status']; } //排序 if($_GET['order']){ $where['orderby'] = $_GET['t'].','.$_GET['order']; $urlarr['order'] = $_GET['order']; $urlarr['t'] = $_GET['t']; }else{ $where['orderby'] = 'id'; } $urlarr = $_GET; $urlarr['page'] = '{{page}}'; $pageurl = Url($_GET['m'],$urlarr,'admin'); $pageM = $this -> MODEL('page'); $pages = $pageM -> pageList('zphnet',$where,$pageurl,$_GET['page']); if($pages['total'] > 0){ $where['limit'] = $pages['limit']; $zphnetM = $this->MODEL('zphnet'); $rows = $zphnetM -> getList($where,array('utype'=>'admin')); $class = $zphnetM->getClassList(array('keyid'=>0)); foreach ($class as $v){ $area[$v['id']] = $v['name']; } $this->yunset('area',$area); } //提取分站内容 $cacheM = $this -> MODEL('cache'); $domain = $cacheM -> GetCache('domain'); $this -> yunset('Dname', $domain['Dname']); $this -> yunset('rows',$rows); $this -> yuntpl(array('admin/admin_zphnet_list')); } function add_action(){ //提取分站内容 $cacheM = $this -> MODEL('cache'); $domain = $cacheM -> GetCache('domain'); $this -> yunset('Dname', $domain['Dname']); $zphnetM = $this->MODEL('zphnet'); if(intval($_GET['id'])){ $info = $zphnetM -> getInfo(array('id' => intval($_GET['id']))); $this -> yunset('info',$info); $this -> yunset('lasturl',$_SERVER['HTTP_REFERER']); } $class = $zphnetM->getClassList(array('keyid'=>0)); $this->yunset('class',$class); $this -> yuntpl(array('admin/admin_zphnet_add')); } function save_action(){ $zphnetM = $this -> MODEL('zphnet'); if($_FILES){ $upData = []; foreach ($_FILES as $key => $value) { if ($value['tmp_name']) { $upData[$key]['file'] = $_FILES[$key]; $upData[$key]['dir'] = 'zhaopinhui'; } } $arr = [ 'sl' => 'pic', 'hf' => 'banner', 'wapsl' => 'pic_wap', 'waphf' => 'banner_wap', ]; if ($upData) { $uploadM = $this->MODEL('upload'); foreach ($upData as $key => $value) { $upRes = $uploadM->newUpload($value); if ($upRes && !empty($upRes['msg'])) { $return['msg'] = $upRes['msg'] ? $upRes['msg'] : $upRes['msg']; $this -> ACT_layer_msg($return['msg'],8); } else { $_POST[$arr[$key]] = $upRes['picurl']; } } } } if($_POST['time']){ $times = @explode('~',$_POST['time']); $_POST['starttime'] = trim($times[0]); $_POST['endtime'] = trim($times[1]); if(strtotime($_POST['starttime'])>strtotime($_POST['endtime'])){ $this -> ACT_layer_msg('开始时间不得大于结束时间',8); } unset($_POST['time']); } $_POST['body'] = str_replace("&","&",$_POST['body']); if($_POST['id']){ $nbid = $zphnetM -> upInfo(array('id'=>intval($_POST['id'])),$_POST); isset($nbid)?$this->ACT_layer_msg("网络招聘会(ID:".$_POST['id'].")修改成功!",9,"index.php?m=admin_zphnet",2,1):$this->ACT_layer_msg("网络招聘会(ID:".$_POST['id'].")修改失败!",8,"index.php?m=admin_zphnet"); }else{ $nbid = $zphnetM -> addInfo($_POST); isset($nbid)?$this->ACT_layer_msg("网络招聘会(ID:$nbid)添加成功!",9,"index.php?m=admin_zphnet",2,1):$this->ACT_layer_msg("网络招聘会(ID:$nbid)添加失败!",8,"index.php?m=admin_zphnet"); } } function del_action(){ if($_GET['id']){ $this -> check_token(); $delID = intval($_GET['id']); }elseif($_POST['del']){ $delID = $_POST['del']; } $zphnetM = $this -> MODEL('zphnet'); $return = $zphnetM -> delZph($delID); $this -> layer_msg($return['msg'],$return['errcode'],$return['layertype'],$_SERVER['HTTP_REFERER']); } /** * @desc 报名企业,高级搜索功能 */ function set_searchs(){ $search_list[] = array("param"=>"status","name"=>'审核状态',"value"=>array("3"=>"未审核","1"=>"已通过","2"=>"未通过")); $this -> yunset("search_list",$search_list); } function user_action(){ $zphnetM = $this->MODEL('zphnet'); if($_GET['id']){ $where['zid'] = intval($_GET['id']); $urlarr['id'] = $_GET['id']; } if (trim($_GET['keyword'])){ $resumeM = $this->MODEL('resume'); $resume = $resumeM->getResumeInfo(array('name'=>array('like',trim($_GET['keyword']))),array('field'=>'uid')); if($resume){ foreach($resume as $v){ $uid[] = $v['uid']; } $where['uid'] = array('in',pylode(',', $uid)); } $urlarr["keyword"] = $_GET["keyword"]; } $urlarr['c'] = $_GET['c']; $urlarr = $_GET; $urlarr['page'] = "{{page}}"; $where['usertype'] = 1; $pageurl = Url($_GET['m'],$urlarr,'admin'); $pageM = $this -> MODEL('page'); $pages = $pageM -> pageList('zphnet_user',$where,$pageurl,$_GET['page']); if($pages['total'] > 0){ $where['limit'] = $pages['limit']; $rows = $zphnetM -> getZphnetUser($where,array('resume'=>$where['limit'],'keyword'=>$urlarr['keyword'],'utype'=>'admin')); $this -> yunset("rows",$rows); } $this -> yuntpl(array('admin/admin_zphnet_user')); } function com_action(){ $this->set_searchs(); $zphnetM = $this->MODEL('zphnet'); $type = array('1'=>'招聘会名称','2'=>'企业名称'); $this -> yunset('type',$type); if($_GET['id']){ $where['zid'] = intval($_GET['id']); $urlarr['id'] = $_GET['id']; } if($_GET['status']){ if($_GET['status']=="3"){ $where['status'] = 0; }elseif($_GET['status']=="1"){ $where['status'] = 1; }elseif($_GET['status']=="2"){ $where['status'] = 2; } $urlarr['status'] = $_GET['status']; } if (trim($_GET['keyword'])){ $companyM = $this->MODEL('company'); $company = $companyM->getChCompanyList(array('name'=>array('like',trim($_GET['keyword']))),array('field'=>'uid')); if($company){ foreach($company as $v){ $uid[] = $v['uid']; } $where['uid'] = array('in',pylode(',', $uid)); } $urlarr["keyword"] = $_GET["keyword"]; } $urlarr['c'] = $_GET['c']; $urlarr = $_GET; $urlarr['page'] = "{{page}}"; $pageurl = Url($_GET['m'],$urlarr,'admin'); $pageM = $this -> MODEL('page'); $pages = $pageM -> pageList('zphnet_com',$where,$pageurl,$_GET['page']); if($pages['total'] > 0){ $where['orderby'] = array('status,asc','id,desc'); $where['limit'] = $pages['limit']; $rows = $zphnetM -> getZphnetComList($where,array('utype'=>'admin')); session_start(); $_SESSION['zphXLs'] = $where; $zphnet = $zphnetM->getInfo(array('id'=>intval($_GET['id'])),array('field'=>'`zw`')); $noarea = 0; if (!empty($zphnet['zw'])){ $class = $zphnetM->getClassList(array('keyid'=>$zphnet['zw'])); $area = array(); foreach ($class as $v){ $area[$v['id']] = $v['name']; } if(!empty($area)){ $this->yunset('area',$area); }else{ $noarea = 2; } }else{ $noarea = 1; } $this->yunset('noarea',$noarea); } $this -> yunset("rows",$rows); $this -> yuntpl(array('admin/admin_zphnet_com')); } function sbody_action(){ $zphnetM = $this -> MODEL('zphnet'); $com = $zphnetM->getZphnetCom(array('id'=>intval($_POST['id'])),array('field'=>'statusbody')); echo $com['statusbody'];die; } function status_action(){ $zphnetM = $this -> MODEL('zphnet'); $data['status'] = $_POST['status']; $data['statusbody'] = trim($_POST['statusbody']); $id = @explode(",",$_POST['pid']); $nid = $zphnetM -> zphnetComStatus($id,$data, array('utype' => 'admin')); $nid?$this->ACT_layer_msg("网络招聘会报名企业(ID:".$_POST['pid'].")审核设置成功!",9,$_SERVER['HTTP_REFERER'],2,1):$this->ACT_layer_msg("设置失败!",8,$_SERVER['HTTP_REFERER']); } function userxls_action(){ if($_POST['zid']&&$_POST['cid']) { $resumeM = $this->MODEL('resume'); $where['usertype'] = 1; $rwhere = array('uid' => array('in', $_POST['cid']),'defaults' => 1); $rows = $resumeM->getList($rwhere,array('utype'=>'zphnet')); $this->yunset('list', $rows['list']); $this->MODEL('log')->addAdminLog('导出参与网络招聘会个人信息'); header('Content-Type: application/vnd.ms-excel'); header('Content-Disposition: attachment; filename=zphnetuser.xls'); $this->yuntpl(array('admin/admin_zphnet_userxls')); }else{ $this->ACT_layer_msg('没有可以导出的参会个人信息!',8,$_SERVER['HTTP_REFERER']); } } function comxls_action(){ $zphnetM = $this -> MODEL('zphnet'); $CompanyM = $this -> MODEL('company'); $JobM = $this -> MODEL('job'); if($_POST['zid']){ if($_POST['cid']){ $zcwhere = array('id'=>array('in',$_POST['cid'])); }else{ $zcwhere = array('zid'=>$_POST['zid']); } $rows = $zphnetM -> getZphnetComList($zcwhere); if(!empty($rows)){ $cacheM = $this->MODEL('cache'); $cache = $cacheM->getCache(array('com')); $comclass_name = $cache['comclass_name']; $jobids = $jobuids = $comids = array(); foreach ($rows as $key=>$val){ $comids[] = $val['uid']; if ($val['jobid']){ $jobids[] = $val['jobid']; }else{ $jobuids[] = $val['uid']; } } $comField = '`uid`,`name`,`mun`,`content`,`address`,`linktel`,`linkman`,`linkphone`,`welfare`,`money`,`moneytype`'; $companys = $CompanyM -> getChCompanyList(array('uid'=>array('in',@implode(',',$comids))),array('field'=>$comField)); $jobField = '`id`,`uid`,`name`,`zp_num`,`minsalary`,`maxsalary`,`exp`,`edu`,`provinceid`,`cityid`,`three_cityid`'; $jobWhere['state'] = 1; $jobWhere['status'] = 0; $jobWhere['r_status'] = 1; $jobWhere['PHPYUNBTWSTART'] = ''; $jobWhere['uid'] = array('in',pylode(',',$jobuids)); $jobWhere['id'] = array('in',pylode(',',$jobids), 'OR'); $jobWhere['PHPYUNBTWEND'] = ''; $jobsA = $JobM -> getList($jobWhere,array('field'=>$jobField)); $jobs = $jobsA['list']; foreach($companys as $k=>$va){ $companys[$k]['content'] = trim(strip_tags($va['content'])); $companys[$k]['mun'] = $comclass_name[$va['mun']]; foreach($jobs as $val){ if ($va['uid'] == $val['uid']){ $companys[$k]['jobs'][] = $val; } } } $maxJobNum = 1; foreach ($companys as $v){ $jobnum = count($v['jobs']); if ($jobnum > $maxJobNum){ $maxJobNum = $jobnum; } } $jobTr = $jobSonTr = ''; for($i=1;$i<=$maxJobNum;$i++){ $jobTr .= '