MODEL("special"); if(trim($_GET['keyword'])){ $where['title'] = array('like',trim($_GET['keyword'])); } //分页链接 $urlarr = $_GET; $urlarr['page'] = '{{page}}'; $urlarr['c'] = $_GET['c']; $pageurl = Url($_GET['m'],$urlarr,'admin'); //排序 if($_GET['order']){ $where['orderby'] = $_GET['t'].','.$_GET['order']; $urlarr['order'] = $_GET['order']; $urlarr['t'] = $_GET['t']; }else{ $where['orderby'] = 'id,desc'; } //提取分页 $pageM = $this -> MODEL('page'); $pages = $pageM -> pageList('special',$where,$pageurl,$_GET['page']); //分页数大于0的情况下 执行列表查询 if($pages['total'] > 0){ $where['limit'] = $pages['limit']; $List = $specialM->getSpecialList($where,array('utype'=>'admin')); $this->yunset("rows",$List['list']); } $this->yuntpl(array('admin/admin_special')); } function add_action(){ $specialM = $this->MODEL("special"); $ratingM = $this->MODEL("rating"); if($_GET['id']){ $row = $specialM->getSpecialOne(array('id'=>$_GET['id'])); $row['rating'] = @explode(',',$row['rating']); $this->yunset("row",$row); } $qy_rows = $ratingM->getList(array('category'=>1,'orderby'=>'sort,desc')); $publicdir = "../app/template/".$this->config['style']."/special/"; $filesnames = @scandir($publicdir); if(is_array($filesnames)){ foreach($filesnames as $key=>$value){ if($value!='.' && $value!='..' ){ $typearr = explode('.', $value); if(in_array(end($typearr),array('htm'))) { if($value!="index.htm"){ $file[] = $value; } } } } } $this->yunset("file",$file); $this->yunset("qy_rows",$qy_rows); $this->yuntpl(array('admin/admin_special_add')); } function save_action(){ $specialM = $this->MODEL("special"); $id = (int)$_POST['id']; $data['title'] = $_POST['title']; $data['tpl'] = $_POST['tpl']; $data['display'] = (int)$_POST['display']; $data['integral'] = (int)$_POST['integral']; $data['com_bm'] = (int)$_POST['com_bm']; $data['sort'] = (int)$_POST['sort']; $data['limit'] = (int)$_POST['limit']; $data['etime'] = strtotime($_POST['etime']); $data['ctime'] = time(); $data['intro'] = str_replace(array("&","background-color:#ffffff","background-color:#fff","white-space:nowrap;"),array("&",'','',''),$_POST["intro"]); if($_POST['rating'] && is_array($_POST['rating'])){ $data['rating'] = implode(',',$_POST['rating']); }else{ $data['rating'] = ''; } if(!empty($_FILES)){ if($_FILES['sl']['tmp_name']){ $upArrSl = array( 'file' => $_FILES['sl'], 'dir' => 'special', ); } if($_FILES['bg']['tmp_name']){ $upArrBg = array( 'file' => $_FILES['bg'], 'dir' => 'special', ); } if($_FILES['wapsl']['tmp_name']){ $upArrWapsl = array( 'file' => $_FILES['wapsl'], 'dir' => 'special', ); } if($_FILES['wapbg']['tmp_name']){ $upArrWapbg = array( 'file' => $_FILES['wapbg'], 'dir' => 'special', ); } //缩率图参数 $uploadM = $this->MODEL('upload'); if(isset($upArrSl)){ $picSl = $uploadM->newUpload($upArrSl);//缩略图 } if(isset($upArrBg)){ $picBg = $uploadM->newUpload($upArrBg);//背景图 } if(isset($upArrWapsl)){ $wapSl = $uploadM->newUpload($upArrWapsl);//移动端缩略图 } if(isset($upArrWapbg)){ $wapBg = $uploadM->newUpload($upArrWapbg);//移动端背景图 } if (isset($picSl) && !empty($picSl['msg'])){ $this->ACT_layer_msg($picSl['msg'],8); }elseif (isset($picBg) && !empty($picBg['msg'])){ $this->ACT_layer_msg($picBg['msg'],8); }elseif (isset($wapSl) && !empty($wapSl['msg'])){ $this->ACT_layer_msg($wapSl['msg'],8); }elseif (isset($wapBg) && !empty($wapBg['msg'])){ $this->ACT_layer_msg($wapBg['msg'],8); }else{ if (!empty($picSl['picurl'])){ $data['pic'] = $picSl['picurl']; } if (!empty($picBg['picurl'])){ $data['background'] = $picBg['picurl']; } if (!empty($wapSl['picurl'])){ $data['wappic'] = $wapSl['picurl']; } if (!empty($wapBg['picurl'])){ $data['wapback'] = $wapBg['picurl']; } } } if(!$id){ $nid = $specialM->addSpecial($data); $name = "专题招聘(ID:".$nid.")添加"; }else{ $nid = $specialM->upSpecial(array('id'=>$id),$data); $name = "专题招聘(ID:".$id.")更新"; } $nid?$this->ACT_layer_msg($name."成功!",9,"index.php?m=special",2,1):$this->ACT_layer_msg($name."失败!",8,"index.php?m=special"); } function com_action(){ $specialM = $this->MODEL("special"); $where['sid'] = (int)$_GET['id']; if (!empty($_GET['keyword'])){ $companyM = $this->MODEL('company'); $comlist= $companyM -> getChCompanyList(array('name'=>array('like',$_GET['keyword'])), array('field'=>'uid')); if (!empty($comlist)){ $uids = array(); foreach ($comlist as $v){ $uids[] = $v['uid']; } $where['uid'] = array('in', pylode(',', $uids)); } } //排序 if($_GET['order']){ $where['orderby'] = $_GET['t'].','.$_GET['order']; $urlarr['order'] = $_GET['order']; $urlarr['t'] = $_GET['t']; }else{ $where['orderby'] = array('status,asc','uid,desc'); } // 分页链接 $urlarr = $_GET; $urlarr['page'] = '{{page}}'; $urlarr['c'] = $_GET['c']; $urlarr['id'] = $_GET['id']; $pageurl = Url($_GET['m'],$urlarr,'admin'); // 提取分页 $pageM = $this -> MODEL('page'); $pages = $pageM -> pageList('special_com',$where,$pageurl,$_GET['page']); // 分页数大于0的情况下 执行列表查询 if($pages['total'] > 0){ $where['limit'] = $pages['limit']; $List = $specialM->getSpecialComList($where,array('utype'=>'admin')); $this->yunset("rows",$List['list']); } $special = $specialM->getSpecialOne(array('id'=>(int)$_GET['id']),array('field'=>'`title`,`limit`,`tpl`')); $applynum = $specialM->getSpecialComNum(array("sid"=>(int)$_GET['id'],'status'=>'1')); if($special['limit']>$applynum){ $this->yunset("applyman",'1'); } $this->yunset("special",$special); $this->yunset("sid",$_GET['id']); $this->yuntpl(array('admin/admin_special_com')); } function comxls_action(){ $specialM = $this->MODEL("special"); $CompanyM = $this -> MODEL('company'); $JobM = $this -> MODEL('job'); if($_POST['zid']){ if($_POST['cid']){ $zcwhere = array('id'=>array('in',$_POST['cid'])); }else{ $zcwhere = array('sid'=>$_POST['zid']); } $rows = $specialM -> getSpecialComList($zcwhere); if(!empty($rows['list'])){ $cacheM = $this->MODEL('cache'); $cache = $cacheM->getCache(array('com')); $comclass_name = $cache['comclass_name']; $jobids = $jobuids = $comids = array(); foreach ($rows['list'] as $key=>$val){ $comids[] = $val['uid']; $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`,`number`,`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 .= '