<?php 
if(!defined('IN_DEMOSOSO')) {
	exit('this is wrong page,please back to homepage');
}
$res = array();
 

$act = @htmlentitdm($_GET['act']);
$staffid = @htmlentitdm($_GET['staffid']);

if($act=='') $act='list';

 
if($act=='list') {	
$sql = "SELECT * from  wu_staff      order by staffid desc limit 100";
}
if($act=='staffinfo') {	
$sql = "SELECT * from  wu_staff   where staffid = $staffid   order by staffid desc limit 1";
}

  //echo $sql;
    /*begin page roll*/
     $num_rows = get_numrows($sql);
     if($num_rows>0){
		 $result = getall($sql);
		// pre($result);
		 
		 foreach( $result as  $k=>$v){
			$res['data'][$k]['id'] =  $v['id'];
			$res['data'][$k]['title'] =  $v['title'];
			$res['data'][$k]['kvsm'] =  UPLOADPATHIMAGE.$v['kvsm'];
			$dateedit  = substr($v['dateedit'],0,10);
			$res['data'][$k]['dateedit'] = $dateedit;
	 

		}
		$res['datares'] = 'yes';


	 
		 
	 }
	 else {
		$res['datares'] = '没有查到相关数据。';
	 }

	 $res = $result;

	 
	 if($test=='y') pre($res);

	 		// pre($_SERVER['HTTP_ACCEPT']);
			 $jsonv = json_encode($res,JSON_UNESCAPED_UNICODE);
			 //echo $jsonv;
			  echo api_jsonp_encode($jsonv); 

 

		
?>