column=$column; Doo::loadModel('Article'); $article=new Article(); $cid=$this->column['COMPANY']; $this->comart=$article->getArticleByCid($cid,4); } function index() { Doo::loadModel('Column'); Doo::loadModel('Product'); $article=new Article(); $product=new Product(); $column=new Column(); $cid=$this->column['SOFTAPP'].",".$this->column['WEBAPP']; $data['WEBAPP']=$this->column['WEBAPP']; $col=$column->getColumnByIdList($cid); //foreach ($col as $key=>$value){ $pro=$product->getProductByCid($col[0]['cid']); $col[0]['product']=$pro; //} $cid=$this->column['TRAINC']; $train=$article->getArticleByTrain(2); $end=$doing=$apply=array(); foreach ($train as $key=>$value){ $type=getTrainTimeByStatus($value['enroll_time']); $date=explode(":", $value['enroll_time']); if($type=="end"){ $train[$key]['timeStuts']="

结束 ".$date[1]."

"; array_push($end, $train[$key]); }elseif ($type=="doing"){ $train[$key]['timeStuts']="进行中"; array_push($doing, $train[$key]); }elseif ($type=="apply"){ $time = strtotime($date[0]) - 60*60*24; $train[$key]['timeStuts']="报名中

截止".date('Y-m-d',$time)."

"; array_push($apply, $train[$key]); } } $ta=$apply+$doing+$end; //print_r($ta);die; //$type=="apply"; //$article->find ( array ('desc' => 'time', 'limit'=>4 , 'where' => 'cid=4 and ', 'asArray' => TRUE ) ); //$art=$article->getArticleByCid($cid,4); $art=array_slice($ta,0,4); foreach ($art as $key=>$value){ $art[$key]['timeStuts']=getTrainTime2($value['enroll_time']); $art[$key]['timeStuts3']=getTrainTime3($value['enroll_time']); $art[$key]['Stuts']=strlen($art[$key]['timeStuts']); } $list1=$article->getArticleByCid2($this->column['COMPANY'],5); foreach ($list1 as $key=>$value){ $list1[$key]['title']=$this->cut_str($value['title'], 45); } $list2=$article->getArticleByCid($this->column['INDUSTRY'],5); foreach ($list2 as $key=>$value){ $list2[$key]['title']=$this->cut_str($value['title'], 45); } Doo::loadModel('Product'); $product=new Product(); $data['product']=$product->getProductByCidAll($this->column['SOFTAPP']); $data['article']=$art; $data['comart']=$this->comart; $data['column']=$col; $data['map']='index'; $data['companyNews']=$list1; $data['industryNews']=$list2; $this->render ( "/index3", $data ); } function softDown2(){ Doo::loadModel('Product'); Doo::loadModel('Down'); $down=new Down(); $product=new Product(); $data['product']=$product->getProductByCidAll($this->column['SOFTAPP']); $html=""; foreach ($data['product'] as $key=>$value){ $data['product'][$key]['down']=array(); if(!empty($value['did'])) $data['product'][$key]['down']=$down->getDownByIdList($value['did']); foreach ($data['product'][$key]['down'] as $keys=>$values){ $t=explode("{b}", $values['down_url']); $i=2; foreach ($t as $k=>$v){ if($i==2) $html.='点击下载'; // elseif($i==1) // $html.='联通线路'; $i--; } $data['product'][$key]['down'][$keys]['html']=$html; $i=2;$html=""; } } $data['comart']=$this->comart; $data['map']='softDown'; $this->render ( "/softDown2", $data ); } function softDown(){ Doo::loadModel('Product'); $product=new Product(); $data['product']=$product->getProductByCidAll($this->column['SOFTAPP']); $data['comart']=$this->comart; $data['map']='softDown'; $this->render ( "/softDown", $data ); } function ajaxSoftDown(){ Doo::loadModel('Down'); Doo::loadModel('Product'); Doo::loadModel('Animation'); $animation=new Animation(); $product=new Product(); $down=new Down(); $did=$this->get_args('did'); $pid=$this->get_args('pid'); if(!empty($did)) $do['dot']=$down->getDownByIdList($did); $info=$product->getProductById($pid); $MyAnimation=array(); if(!empty($info[0]['anid'])) $MyAnimation=$animation->getAnimationByIdList($info[0]['anid']); $belongAnimation=$animation->getAnimationByBelong(); $uc='
'; if (empty($MyAnimation) ){ $uc.='该软件无专属教程,您可观看通用教程'; }else{ $uc.='

专属教程

'; } $uc.='

通用教程

'; $html='
'.$info[0]['title'].'
'.$info[0]['edition'].'
'; if($info[0]['p_type']!=2) $do['info']=$html; else $do['info']=""; $show=json_encode($do); echo $show; } function product(){ $pid=$this->params['pid']; $tab = $this->get_args ( 'tab' ) ? $this->get_args ( 'tab' ) : 'down'; $pid=is_numeric($pid)?$pid:0; Doo::loadModel('Product'); Doo::loadModel('Down'); Doo::loadModel('DownVersion'); $down=new Down(); $product=new Product(); $downversion=new DownVersion(); Doo::loadModel('Animation'); $animation=new Animation(); Doo::loadModel( 'Course' ); $course = new Course(); $data['product']=$product->getProductByCid($this->column['SOFTAPP']); if (empty($pid)) $pid=$data['product'][0]['pid']; //获取下载内容 $data['productInfo']=$product->getProductById($pid); if(isset($data['productInfo'][0]['isstartup']) && $data['productInfo'][0]['isstartup'] == 1) { Doo::loadModel('Startup'); $startup = new Startup(); $data['down_url'] = $startup->getDownUrlById(); } if(empty($data['productInfo'][0]['did'])) $data['productInfo'][0]['did']=0; $do=$down->getDownByIdList($data['productInfo'][0]['did']); foreach ($do as $key=>$value){ $url=explode("{b}", $value['down_url']); $do[$key]['down_url']=$url; $down_version_msg = $downversion->getVersionByDidAnd2($value['did']); $do[$key]['version_msg'] = !empty($down_version_msg) ? $down_version_msg['version_msg'] : ''; } $data['productInfo'][0]['down']=$do; //获得教程 $courseList=$course->getCourseAllLikePid($pid); $data['courseList']=$courseList; // $data['MyAnimation']=array(); // if(!empty($data['productInfo'][0]['anid'])) // $data['MyAnimation']=$animation->getAnimationByIdList($data['productInfo'][0]['anid']); // // $data['belongAnimation']=$animation->getAnimationByBelong(); $data['tab']=$tab; $data['comart']=$this->comart; $data['map']='product'; $data['title']=$data['productInfo'][0]['title']; $this->render ( "/product", $data ); } /* *教程 */ function course(){ $idKey=isset($this->params ['idKey'])?$this->params['idKey']:''; $p = $this->get_args ( 'p' ) && is_numeric ( $this->get_args ( 'p' ) ) ? $this->get_args ( 'p' ) : ''; Doo::loadClass ( 'XDeode' ); $XDeode = new XDeode ( 5 ); $id = $XDeode->decode ( $idKey ); if (! is_numeric ( $id )) die ( 'illegal request' ); Doo::loadModel( 'Course' ); $course = new Course(); Doo::loadModel('Animation'); $animation=new Animation(); $courseDetail=$course->getCourseById($id); $courseDetail['videoHtml']=''; foreach ($courseDetail['animationList'] as $key=>$value){ /* preg_match_all("/]+>/isU",$courseDetail['animationList'][$key]['url'],$matches); $courseDetail['animationList'][$key]['videoSrc']=$matches[2][0];*/ if (empty($p)){ $courseDetail['animationList'][0]['url']=str_replace("render ( "/coursePlay", $data ); } function aboutUs(){ $k=isset($this->params ['k'])?$this->params['k']:''; $data['comart']=$this->comart; $data['map']='aboutUs'; if (empty($k)){ $this->render ( "/aboutUsAbout", $data ); }else{ Doo::loadModel('Article'); $article=new Article(); //$s=strtotime(date('Y')."-01-01"); $s=strtotime("2015-01-01"); $list=$article->find(array ( 'where' => 'cid= 7 and time>='.$s,'desc'=>'time','asArray' => TRUE )); foreach ($list as $key=>$value){ $list[$key]['year']=date('Y',$value['time']); $list[$key]['month']=date('m',$value['time']); if(empty($value['thum'])) $list[$key]['thum']='/global/img/2.png'; } $data['list']=$list; $data['year']=date('Y'); $this->render ( "/".$k, $data ); } } function contact(){ $data['comart']=$this->comart; $data['map']='contact'; $data['iscontact'] = 1; $this->render ( "/contact", $data ); } function contact4(){ $data['comart']=$this->comart; $data['map']='contact'; $data['iscontact'] = 1; Doo::loadModel('Contact'); Doo::loadModel('ContactProvince'); $contact = new Contact(); $contactProvince = new ContactProvince(); $area = array('华东', '华南', '华中', '华北', '西北', '西南', '东北'); $list = array(); foreach ($area as $k => $v) { $provinceList = $contactProvince->getListByArea($k); foreach ($provinceList as $pk => $pv) { $staffList = $contact->getRowByProvince($pv['id']); $provinceList[$pk]['staffList'] = $staffList; array_push($list, $provinceList[$pk]); } } $data['list'] = $list; $this->render ( "/contact4", $data ); } function contact2(){ $data['iscontact'] = 1; $this->render ( "/contact2", $data ); } function contact3(){ $data['iscontact'] = 1; Doo::loadModel('Contact'); Doo::loadModel('ContactProvince'); $contact = new Contact(); $contactProvince = new ContactProvince(); $area = array('华东', '华南', '华中', '华北', '西北', '西南', '东北'); $data['area'] = $area; $list = array(); foreach ($area as $k => $v) { $provinceList = $contactProvince->getListByArea($k); foreach ($provinceList as $pk => $pv) { $staffList = $contact->getRowByProvince($pv['id']); $provinceList[$pk]['staffList'] = $staffList; } $list[$k]['provinceList'] = $provinceList; } $data['list'] = $list; $this->render ( "/contact3", $data ); } function train(){ // $article=new Article(); // $train=$article->getArticleByTrain(2); // $end=$doing=$apply=array(); // // foreach ($train as $key=>$value){ // $type=getTrainTimeByStatus($value['enroll_time']); // $date=explode(":", $value['enroll_time']); // // if($type=="end"){ // // $train[$key]['timeStuts']="

结束 ".$date[1]."

"; // array_push($end, $train[$key]); // }elseif ($type=="doing"){ // // $train[$key]['timeStuts']="进行中"; // array_push($doing, $train[$key]); // }elseif ($type=="apply"){ // // $time = strtotime($date[0]) - 60*60*24; // $train[$key]['timeStuts']="报名中

截止".date('Y-m-d',$time)."

"; // array_push($apply, $train[$key]); // } // } // // $train=$article->getArticleByTrain(1); // $end1=$doing1=$apply1=array(); // // foreach ($train as $key=>$value){ // $type=getTrainTimeByStatus($value['enroll_time']); // $date=explode(":", $value['enroll_time']); // // if($type=="end"){ // // $train[$key]['timeStuts']="

结束 ".$date[1]."

"; // array_push($end1, $train[$key]); // }elseif ($type=="doing"){ // // $train[$key]['timeStuts']="进行中"; // array_push($doing1, $train[$key]); // }elseif ($type=="apply"){ // // $time = strtotime($date[0]) - 60*60*24; // $train[$key]['timeStuts']="报名中

截止".date('Y-m-d',$time)."

"; // array_push($apply1, $train[$key]); // } // } // // $data['end1']=$end1; // $data['doing1']=$doing1; // $data['apply1']=$apply1; // // $data['end']=$end; // $data['doing']=$doing; // $data['apply']=$apply; // $data['comart']=$this->comart; // $data['map']='trainI'; // $this->render ( "/train2", $data ); //新培训班页 $article=new Article(); $trainType = isset($_GET['trainType']) && is_numeric($_GET['trainType']) ? $_GET['trainType'] : ''; //列出11个地区培训班数量 $areaArr = array('广东', '山东', '内蒙古', '广西', '重庆', '新疆', '江西', '安徽', '四川', '浙江', '甘肃', '湖南', '贵州'); $area = isset($_GET['area']) && in_array($_GET['area'], $areaArr) ? $_GET['area'] : ''; $train= !isset($_GET['trainType']) && !isset($_GET['area']) ? $article->getArticleByTrain3() : $article->getArticleByTrain2($trainType,$area); $end=$doing=$apply=$areatrainnum=array(); foreach($areaArr as $k => $v){ $trainnum = $article->getArticleNumByTrain2($trainType,$v); array_push($areatrainnum,$trainnum); } foreach ($train as $key=>$value){ $type=getTrainTimeByStatus($value['enroll_time']); $date=explode(":", $value['enroll_time']); if($type=="end"){ $train[$key]['timeStuts']="

结束 ".$date[1]."

"; array_push($end, $train[$key]); }elseif ($type=="doing"){ $train[$key]['timeStuts']="进行中"; array_push($doing, $train[$key]); }elseif ($type=="apply"){ $time = strtotime($date[0]) - 60*60*24; $train[$key]['timeStuts']="报名中

截止".date('Y-m-d',$time)."

"; array_push($apply, $train[$key]); } } $data['end']=$end; $data['doing']=$doing; $data['apply']=$apply; $data['areatrainnum']=$areatrainnum; $data['area'] = $area; $data['trainType'] = $trainType; $data['comart']=$this->comart; $data['map']='trainI'; $this->render ( "/train2", $data ); } function trainPage(){ $aid=$this->params['aid']; $aid=is_numeric($aid)?$aid:0; if(empty($aid)){ return "/train"; } $article=new Article(); $trainPage=$article->getArticleByTrainAid($aid); $trainPage[0]['timeStuts']=getTrainTime($trainPage[0]['enroll_time']); $trainPage[0]['class']=getTrainTimeByStatus($trainPage[0]['enroll_time']); $data['trainPage']=$trainPage[0]; $data['comart']=$this->comart; $data['map']='train'; $this->render ( "/trainPage", $data ); } function searchNews(){ $kind = $this->get_args('kind') ? $this->get_args('kind') : 1; $k = $this->get_args('k') ? $this->get_args('k') : ""; $onPage =$this->get_args('onPage')&&is_numeric ( $this->get_args('onPage') ) ? $this->get_args('onPage') : 1; $list=array();$next=0;$previous=0; if (!empty($k)){ Doo::loadModel('Down'); $down=new Down(); $article=new Article(); if ($onPage <= 0) $onPage = 1; $pageSize = 20; $o=$onPage; $lower = (-- $o) * $pageSize; $previous = $onPage != 0 ? $onPage - 1 : $onPage; if ($kind==2){ $list=$down->getDownByAnyWhere($k); //$list=$down->find(array('where'=>'title like "%'.$k.'%" or key_number like "%'.$k.'%"','limit'=>$lower.','.$pageSize ,'asArray' => TRUE)); $totalCount = $down->count(array('where'=>'title like "%'.$k.'%" or key_number like "%'.$k.'%"','limit'=>$lower.','.$pageSize ,'asArray' => TRUE)); $total = intval ( $totalCount / $pageSize ); $totalPage = ($totalCount % $pageSize) == 0 ? $total : $total + 1; $next = $onPage == $totalPage ? $totalPage : $onPage + 1; foreach ($list as $key=>$value){ $url=explode("{b}", $value['down_url']); $list[$key]['down_url']=$url; } }elseif($kind==3){ Doo::loadModel('ArticleDao'); $ArticleDao=new ArticleDao(); $list=$ArticleDao->find(array('select'=>'title,aid,cid,time','where'=>'title like "%'.$k.'%" ', 'limit'=>$lower.','.$pageSize ,'asArray' => TRUE)); $totalCount = $ArticleDao->count(array('where'=>'title like "%'.$k.'%" ','asArray' => TRUE)); $total = intval ( $totalCount / $pageSize ); $totalPage = ($totalCount % $pageSize) == 0 ? $total : $total + 1; $next = $onPage == $totalPage ? $totalPage : $onPage + 1; }else{//or content like "%'.$k.'%" $list=$article->find(array('select'=>'title,aid,cid,time','where'=>'title like "%'.$k.'%" and ( cid=4 or cid=5 or cid=3 or cid=7)', 'limit'=>$lower.','.$pageSize ,'asArray' => TRUE)); $totalCount = $article->count(array('where'=>'title like "%'.$k.'%" and ( cid=4 or cid=5 or cid=3 or cid=7)','asArray' => TRUE)); $total = intval ( $totalCount / $pageSize ); $totalPage = ($totalCount % $pageSize) == 0 ? $total : $total + 1; $next = $onPage == $totalPage ? $totalPage : $onPage + 1; foreach ($list as $key=>$value){ if($value['cid']==4) $list[$key]['c']='公司新闻'; elseif ($value['cid']==5) $list[$key]['c']='行业新闻'; elseif ($value['cid']==3) $list[$key]['c']='培训教育'; elseif ($value['cid']==7) $list[$key]['c']='软件更新'; } } } $data['next']=$next; $data['previous']=$previous; $data['k']=$k; $data['onPage']=$onPage; $data['list']=$list; $data['kind']=$kind; $data['map']='sNews'; $this->render ( "/search", $data ); } function news(){ $n = ""; $cid=isset($this->params ['cid'])&&is_numeric($this->params['cid'])?$this->params['cid']:$this->column['COMPANY']; $aid=isset($this->params ['aid'])&&is_numeric($this->params['aid'])?$this->params['aid']:0; $on_page = isset($this->params ['page'])&&is_numeric ( $this->params ['page'] ) ? $this->params ['page'] : 1; // if ($on_page <= 0) $on_page = 1; $page_size = 10; // //检索条件 if($cid==$this->column['TRAINC']) $n = " and a_type=2 and cid =" . $cid .' and title!=""'; else $n = " and a_type=1 and cid =" . $cid .' and title!=""'; $condition=$n; $action = "/news/"; Load::logic ( 'Admin' ); $this->adminlogic = new AdminLogic (); //获取分页相关数据 $page = $this->adminlogic->get_page ( "sc_article", $condition, $on_page, $page_size, $action ); $limit = " order by update_time desc limit " . $page ['lower'] . " , " . $page_size . " "; Doo::loadModel('Article'); $article=new Article(); // $k=$article->getOne(array ('where' => 'aid=721' , 'asArray' => TRUE )); // // print_r(); //echo $condition; $page ['article_list'] = $article->getArticleList ( array (), $condition, $limit ); $data['articleInfo']=array(); if(empty($aid)){ if(!empty($page ['article_list'])) $data['articleInfo']=$page ['article_list'][0]; }else{ $a=$article->getArticleById($aid); $data['articleInfo']=$a[0]; } foreach ($page ['article_list'] as $key=>$value){ if(empty($value['thum'])) $page ['article_list'][$key]['thum']='/global/img/2.png'; } $data ['article'] = $page; $k=""; for ($i=1;$i<=$page['total_page'];$i++){ if($on_page==$i) $k.=""; else $k.=""; } $data['page']=$page; $data['comart']=$this->comart; $data['onpage']=$on_page; $data['cid']=$cid; $data['aid']=$aid; $data['column']=$this->column; $data['map']='news'; $this->render ( "/news2", $data ); } function newsPage(){ $aid=isset($this->params ['aid'])&&is_numeric($this->params['aid'])?$this->params['aid']:0; Doo::loadModel('Article'); $article=new Article(); $a=$article->getArticleById($aid); $list=$article->find(array ( 'where' => 'aid !=' . $a[0]['aid'].' and cid='.$a[0]['cid'], 'limit'=>'5','desc'=>'aid' ,'asArray' => TRUE )); $data['list']=$list; $data['cid']=$a[0]['cid']; $data['articleInfo']=$a[0]; $data['comart']=$this->comart; $data['aid']=$aid; $data['column']=$this->column; $data['map']='news'; $this->render ( "/newsContent", $data ); } function video(){ Doo::loadModel('Animation'); $animation=new Animation(); $data['comart']=$this->comart; $data['map']='video'; if(isset($this->params['aid'])){ $data['nimationInfo']=$animation->getAnimationById($this->params['aid']); $this->render ( "/videoPage", $data ); }else{ $data['nimation']=$animation->getAnimationList(array(), "", "order by aid asc"); $this->render ( "/video", $data ); } } function sdown(){ $url=isset($this->params ['url'])?$this->params['url']:0; if(!empty($url)){ $url=base64_decode($url); if(!empty($url)) return $url; }else{ return "/"; } } function getInfo(){ $article=new Article(); $info=$article->getArticleByCid($this->column['COMPANY'],2); $k=array(); foreach ($info as $key=>$value){ array_push($k, array('aid'=>$value['aid'],'title'=>$value['title'])); } $pa['company']=$k; $cid=$this->column['TRAINC']; $art=$article->getArticleByCid($cid,3); $k=array();//,'timeStuts'=>getTrainTimeTk($value['enroll_time']) foreach ($art as $key=>$value){ array_push($k, array('aid'=>$value['aid'],'title'=>$value['enroll_title'])); } $pa['trainc']=$k; echo json_encode($pa); } function getInfo2(){ $article=new Article(); $info=$article->getArticleByCid($this->column['COMPANY'],6); $k=array(); foreach ($info as $key=>$value){ array_push($k, array('aid'=>$value['aid'],'title'=>$value['title'])); } $pa['company']=$k; $cid=$this->column['TRAINC']; $art=$article->getArticleByCid($cid,3); $k=array();//,'timeStuts'=>getTrainTimeTk($value['enroll_time']) foreach ($art as $key=>$value){ array_push($k, array('aid'=>$value['aid'],'title'=>$value['enroll_title'])); } $pa['trainc']=$k; echo json_encode($pa); } function newsHttp(){ $updateTime = $this->get_args('updateTime')&&is_numeric($this->get_args('updateTime')) ? $this->get_args('updateTime') : 0; $page = $this->get_args('page')&&is_numeric($this->get_args('page')) ? $this->get_args('page') : 1; $size = $this->get_args('size')&&is_numeric($this->get_args('size')) ? $this->get_args('size') : 10; Doo::loadModel('Article'); $article=new Article(); if ($page!=1) $page=$page*$size-1; else $page--; $count=$article->count(array('where'=>'title!="" and (update_time>'.$updateTime.')','limit'=>$page.','.$size,'asArray'=>true)); $list=$article->find(array('where'=>'title!="" and (update_time>'.$updateTime.')','limit'=>$page.','.$size,'desc'=>'update_time','asArray'=>true)); echo json_encode(array('status'=>1,'articleList'=>$list,'count'=>$count)); } function authentication(){ $data=array(); $this->render ( "/productSecurity", $data ); } function doAuthentication(){ $key = $this->get_args('key')? $this->get_args('key') :""; $data['comart']=$this->comart; if (!empty($key)){ require_once (SITE_PATH . '/protected/class/client.php'); $client = new client ( 'http://cld.smartcost.com.cn/' ); $list = $client->zhsso_getSerialNumber ( $key ); $list=json_decode($list,true); if (empty($list['list'])){ $this->render ( "/productSecurityPiracy", $data );die; } $data['list']=$list['list']; $this->render ( "/productSecurityGenuine", $data ); }else $this->render ( "/productSecurityPiracy", $data );die; } function authenticationHttp(){ $SerialNumber = $this->get_args('SerialNumber')? $this->get_args('SerialNumber') :""; $data['comart']=$this->comart; if (!empty($SerialNumber)){ require_once (SITE_PATH . '/protected/class/client.php'); $client = new client ( 'http://cld.smartcost.com.cn/' ); $list = $client->zhsso_getSerialNumber2 ( $SerialNumber ); $list=json_decode($list,true); if (empty($list['list'])){ $this->render ( "/productSecurityPiracy", $data );die; } $data['list']=$list['list']; $this->render ( "/productSecurityGenuine2", $data ); }else{ $this->render ( "/productSecurityPiracy", $data );die; } } function cut_str($string, $length, $dot = ' ...'){ if(strlen($string) <= $length) { return $string; } $strcut = ''; $sys_config = 'utf-8'; if($sys_config == 'utf-8'){ $n = $tn = $noc = 0; while($n < strlen($string)) { $t = ord($string[$n]); if($t == 9 || $t == 10 || (32 <= $t && $t <= 126)) { $tn = 1; $n++; $noc++; } elseif(194 <= $t && $t <= 223) { $tn = 2; $n += 2; $noc += 2; } elseif(224 <= $t && $t < 239) { $tn = 3; $n += 3; $noc += 2; } elseif(240 <= $t && $t <= 247) { $tn = 4; $n += 4; $noc += 2; } elseif(248 <= $t && $t <= 251) { $tn = 5; $n += 5; $noc += 2; } elseif($t == 252 || $t == 253) { $tn = 6; $n += 6; $noc += 2; } else { $n++; } if($noc >= $length) { break; } } if($noc > $length) { $n -= $tn; } $strcut = mb_substr($string, 0, $n); } else { for($i = 0; $i < $length; $i++) { $strcut .= ord($string[$i]) > 127 ? $string[$i].$string[++$i] : $string[$i]; } } return $strcut.$dot; } /** * 获取get或者POST值 * @param string $name 属性名称 * @return fixed 值 */ function get_args($name) { if (isset ( $_GET [$name] )) { if (is_array ( $_GET [$name] )) return $_GET [$name]; else return addslashes ( $_GET [$name] ); } elseif (isset ( $_POST [$name] )) { if (is_array ( $_POST [$name] )) return $_POST [$name]; else return addslashes ( $_POST [$name] ); } else { return false; } } } ?>