"status","name" => '审核状态',"value" => array("3" => "未开始","1" => "已开始","2" => "已结束")); $this -> yunset("search_list",$search_list); } function index_action(){ $this -> set_search(); if($_GET['news_search']){ if ($_GET['type'] == '2'){ $where['address'] = array('like',trim($_GET['keyword'])); }else{ $where['title'] = array('like',trim($_GET['keyword'])); } $urlarr['type'] = $_GET['type']; $urlarr['keyword'] = $_GET['keyword']; $urlarr['news_search'] = $_GET['news_search']; } 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('zhaopinhui',$where,$pageurl,$_GET['page']); if($pages['total'] > 0){ $where['limit'] = $pages['limit']; $ZphM = $this->MODEL('zph'); $rows = $ZphM -> getList($where,array('utype'=>'admin')); } //提取分站内容 $cacheM = $this -> MODEL('cache'); $domain = $cacheM -> GetCache('domain'); $this -> yunset('Dname', $domain['Dname']); $this -> yunset("get_type", $_GET); $this -> yunset("rows",$rows); $this -> yuntpl(array('admin/admin_zhaopinhui_list')); } function add_action(){ //提取分站内容 $cacheM = $this -> MODEL('cache'); $domain = $cacheM -> GetCache('domain'); $this -> yunset('Dname', $domain['Dname']); $ZphM = $this->MODEL('zph'); if(intval($_GET['id'])){ $info = $ZphM -> getInfo(array('id' => intval($_GET['id'])),array('pic'=>1,'banner'=>1)); $this -> yunset("lasturl",$_SERVER['HTTP_REFERER']); } $space = $ZphM -> getZphSpaceList(array('keyid'=>'0')); $this -> yunset("info",$info); $this -> yunset("space",$space); $this -> yuntpl(array('admin/admin_zhaopinhui_add')); } function save_action(){ $ZphM = $this -> MODEL('zph'); if($_FILES){ $upData = []; foreach ($_FILES as $key => $value) { if ($value['tmp_name']) { $upData[$key]['file'] = $_FILES[$key]; $upData[$key]['dir'] = 'zhaopinhui'; } } $arr = [ 'sl' => 'is_themb', 'hf' => 'banner', 'wapsl' => 'is_themb_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']; } } } } $_POST['body'] = str_replace("&","&",$_POST['body']); $_POST['media'] = str_replace("&","&",$_POST['media']); $_POST['packages'] = str_replace("&","&",$_POST['packages']); $_POST['booth'] = str_replace("&","&",$_POST['booth']); $_POST['participate'] = str_replace("&","&",$_POST['participate']); if($_POST['time']){ $times = @explode('~',$_POST['time']); $_POST['starttime'] = trim($times[0]); $_POST['endtime'] = trim($times[1]); unset($_POST['time']); } if(strtotime($_POST['starttime'])>strtotime($_POST['endtime'])){ $this -> ACT_layer_msg('开始时间不得大于结束时间',8); } if($_POST['id']){ $nbid = $ZphM -> upInfo(array('id'=>intval($_POST['id'])),$_POST); isset($nbid)?$this->ACT_layer_msg("招聘会(ID:".$_POST['id'].")修改成功!",9,"index.php?m=zhaopinhui",2,1):$this->ACT_layer_msg("招聘会(ID:".$_POST['id'].")修改失败!",8,"index.php?m=zhaopinhui"); }else{ $nbid = $ZphM -> addInfo($_POST); isset($nbid)?$this->ACT_layer_msg("招聘会(ID:$nbid)添加成功!",9,"index.php?m=zhaopinhui",2,1):$this->ACT_layer_msg("招聘会(ID:$nbid)添加失败!",8,"index.php?m=zhaopinhui"); } } function del_action(){ if($_GET['id']){ $this -> check_token(); $delID = intval($_GET['id']); }elseif($_POST['del']){ $delID = $_POST['del']; } $ZphM = $this -> MODEL('zph'); $return = $ZphM -> delZph($delID); $this -> layer_msg($return['msg'],$return['errcode'],$return['layertype'],$_SERVER['HTTP_REFERER']); } function upload_action(){ $ZphM = $this->MODEL('zph'); if($_GET['editid']){ $editrow = $ZphM -> getZphPicInfo(array('id'=>$_GET['editid'])); $this -> yunset("pic",substr($editrow['pic'],(strrpos($editrow['pic'],'/')+1))); $this -> yunset("editrow",$editrow); $id = $editrow['zid']; } $row = $ZphM -> getInfo(array('id'=>$_GET['id'])); $this -> yunset("row",$row); $where['zid'] = $_GET['id']; $urlarr['c'] = $_GET['c']; $urlarr = $_GET; $urlarr['page'] = "{{page}}"; $pageurl = Url($_GET['m'],$urlarr,'admin'); $pageM = $this -> MODEL('page'); $pages = $pageM -> pageList('zhaopinhui_pic',$where,$pageurl,$_GET['page']); if($pages['total'] > 0){ $where['limit'] = $pages['limit']; $rows = $ZphM -> getZphPicList($where); } $this -> yunset("rows",$rows); $this -> yuntpl(array('admin/admin_zhaopinhui_upload')); } function uploadsave_action(){ $ZphM = $this->MODEL('zph'); $_POST = $this->post_trim($_POST); $id = $_POST['id']; if($_FILES['file']['tmp_name']!=''){ // pc端上传 $upArr = array( 'file' => $_FILES['file'], 'dir' => 'zhaopinhui' ); $uploadM = $this->MODEL('upload'); $pic = $uploadM->newUpload($upArr); if (!empty($pic['msg'])){ $this -> ACT_layer_msg($pic['msg'],8); }elseif (!empty($pic['picurl'])){ $_POST['pic'] = $pic['picurl']; } } if($_POST['add']){ $row = $ZphM -> getInfo(array('id'=>$id)); $_POST['did'] = $row['did']; $nbid = $ZphM -> addZphPicInfo($_POST); isset($nbid)?$this->ACT_layer_msg("招聘会图片(ID:".$nbid.")添加成功!",9,$_SERVER['HTTP_REFERER'],2,1):$this->ACT_layer_msg("添加失败!",8,$_SERVER['HTTP_REFERER']); } if($_POST['update']){ $nbid = $ZphM -> upZphPicInfo(array('id'=>$id),$_POST); isset($nbid)?$this->ACT_layer_msg("招聘会图片(ID:".$id.")修改成功!",9,"index.php?m=zhaopinhui&c=upload&id=".intval($_POST['zid'])."",2,1):$this->ACT_layer_msg("修改失败!",8,"index.php?m=zhaopinhui&c=upload&id=".intval($_POST['zid']).""); } } function setthemb_action(){ $ZphM = $this -> MODEL('zph'); $row = $ZphM -> getSetThembInfo(array('id'=>$_POST['id'])); echo Url('zhaopinhui',array('c'=>'upload','id'=>$row['zid']),'admin'); } function pic_action(){ $ZphM = $this->MODEL('zph'); $id = $_GET['delid']; if($id){ $this -> check_token(); $delid = $ZphM -> delZphPic(array('id'=>$id)); $delid?$this->layer_msg("招聘会图片(ID:".$_GET['delid'].")删除成功!",9,0,$_SERVER['HTTP_REFERER']):$this->layer_msg('删除失败!',8,0,$_SERVER['HTTP_REFERER']); } } //设置高级搜索功能 function set_searchs(){ $search_list[] = array("param"=>"status","name"=>'审核状态',"value"=>array("3"=>"未审核","1"=>"已通过","2"=>"未通过")); $this -> yunset("search_list",$search_list); } function com_action(){ $this->set_searchs(); $ZphM = $this->MODEL('zph'); $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 ($_GET['type']){ if($_GET['type']==1){ if (trim($_GET['keyword'])){ $zph = $ZphM -> getList(array('title'=>array('like',trim($_GET['keyword']))),array('field'=>'id')); if($zph){ foreach($zph as $v){ $zid[] = $v['id']; } $where['zid'] = array('in',pylode(',', $zid)); } } }elseif($_GET['type']==2){ 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["type"] = $_GET["type"]; } $urlarr['c'] = $_GET['c']; //排序 if($_GET['order']){ if($_GET['t'] == 'id') { $where['orderby'] = $_GET['t'] . ',' . $_GET['order']; $urlarr['order'] = $_GET['order']; $urlarr['t'] = $_GET['t']; }elseif ($_GET['t']=='sid'){ $where['orderby'] = array($_GET['t'] . ',' . $_GET['order'],'cid,'.$_GET['order'],'bid,'.$_GET['order']); $urlarr['order'] = $_GET['order']; $urlarr['t'] = $_GET['t']; }elseif($_GET['t'] == 'sort'){ $where['orderby'] = $_GET['t'] . ',' . $_GET['order']; $urlarr['order'] = $_GET['order']; $urlarr['t'] = $_GET['t']; } }else{ $where['orderby'] = array('status,asc','id,desc'); } $urlarr = $_GET; $urlarr['page'] = "{{page}}"; $pageurl=Url($_GET['m'],$urlarr,'admin'); $pageM = $this -> MODEL('page'); $pages = $pageM -> pageList('zhaopinhui_com',$where,$pageurl,$_GET['page']); if($pages['total'] > 0){ $where['limit'] = $pages['limit']; $rows = $ZphM -> getZphCompanyList($where); if($rows){ $space = $ZphM -> getZphSpaceList(); $spacearr = array(); foreach($space as $val){ $spacearr[$val['id']] = $val['name']; } } session_start(); $_SESSION['zphXLs'] = $where; } $this -> yunset("spacearr",$spacearr); $this -> yunset("rows",$rows); $this -> yuntpl(array('admin/admin_zhaopinhui_com')); } function sbody_action(){ $ZphM = $this -> MODEL('zph'); $zhaopinhui_com = $ZphM->getZphComInfo(array('id'=>intval($_POST['id'])),array('field'=>'statusbody')); echo $zhaopinhui_com['statusbody'];die; } function status_action(){ $ZphM = $this -> MODEL('zph'); $data['status'] = $_POST['status']; $data['statusbody'] = trim($_POST['statusbody']); $id = @explode(",",$_POST['pid']); $nid = $ZphM -> upZphCom($id,$data); $nid?$this->ACT_layer_msg("招聘会(ID:".$_POST['pid'].")设置成功!",9,$_SERVER['HTTP_REFERER'],2,1):$this->ACT_layer_msg("设置失败!",8,$_SERVER['HTTP_REFERER']); } function comxls_action(){ $ZphM = $this -> MODEL('zph'); $CompanyM = $this -> MODEL('company'); $JobM = $this -> MODEL('job'); if($_POST['zid']){ $space = $ZphM -> getZphSpaceList(); $spacearr = array(); foreach($space as $val){ $spacearr[$val['id']] = $val['name']; } $this -> yunset("spacearr",$spacearr); if($_POST['cid']){ $zcwhere = array('id'=>array('in',$_POST['cid'])); }else{ $zcwhere = array('zid'=>$_POST['zid']); } $rows = $ZphM -> getZphCompanyList($zcwhere); if(!empty($rows)){ $cacheM = $this->MODEL('cache'); $cache = $cacheM->getCache(array('com')); $comclass_name = $cache['comclass_name']; foreach ($rows as $val){ $comids[] = $val['uid']; $comSpace[$val['uid']] = array('sid'=>$val['sid'],'cid'=>$val['cid'],'bid'=>$val['bid']); } $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`,`number`,`minsalary`,`maxsalary`,`exp`,`edu`,`provinceid`,`cityid`,`three_cityid`,`description`,`zp_num`'; $jobsA = $JobM -> getList(array('uid'=>array('in',@implode(',',$comids)),'state'=>1,'status'=>0,'r_status'=>1),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']]; $companys[$k]['space'] = $comSpace[$va['uid']]; 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 .= '
'.$v[name].' | |||||
'.$val[name].' | '; if(($key+1)%6==0){ $html.='|||||