Excel 내보내기 데이터

2366 단어
function in_export () {
		require admin_ROOT.adminfile.'/include/skintitle/skintitle_member.php';
		require admin_ROOT.adminfile.'/include/inc_member.php';
		require admin_ROOT.adminfile.'/include/systemlist.php';
		parent::start_template();
		//$projectid=$this->accept('ecisp_member_project_id','C');
		header("Content-type:application/vnd.ms-excel");  
		header("Content-Disposition: attachment; filename=Email.xls");   
		header("Pragma: no-cache");   
		header("Expires: 0"); 	
		
		$this->ectemplates->caching=false;
		/*$lng=$this->accept('lng','R');
		$lng=empty($lng) ? $SL['lng'] : $lng;*/
		
		$ec_member_username_id=$this->accept('ecisp_member_username_id','C');
		$ec_member_project_id=$this->accept('ecisp_member_project_id','C');
		$db_table=db_prefix.'email';
		$db_table2=db_prefix.'email_status';
		$db_where="$db_table.userid=$ec_member_username_id and $db_table.projectid=$ec_member_project_id ";

		$sql="SELECT $db_table.*,$db_table2.status as status_name from $db_table LEFT JOIN $db_table2 ON $db_table.status = $db_table2.id where $db_where";
		
		$rs=$this->db->query($sql);	
		
		echo ' '.chr(9); 
		echo ' '.chr(9); 
		echo ' '.chr(9); 	
		echo ' '.chr(9); 		
		echo ' '.chr(9); 
		echo ' '.chr(9); 
		echo ' '.chr(9); 
		echo ' '.chr(9); 
		echo ' '.chr(9); 	
		echo ' '.chr(9); 		
		echo chr(10);
		while ($rsList=$this->db->fetch_array($rs)) {
			echo $this->htmldecode($rsList['id']).chr(9); 
			echo $this->htmldecode($rsList['lng']).chr(9); 
			echo $this->htmldecode($rsList['send_title']).chr(9); 
			echo $this->htmldecode($rsList['send_memo']).chr(9); 
			echo $this->htmldecode($rsList['company']).chr(9); 
			echo $this->htmldecode($rsList['linkman']).chr(9); 
			echo $this->htmldecode($rsList['email']).chr(9); 
			echo $this->htmldecode($rsList['sys_sn']).chr(9); 
			echo $this->formatdate(3,$rsList[addtime]).chr(9); 		
			echo $this->htmldecode($rsList['status']==1?' ':' ').chr(9); 
			echo chr(10);
		}

	}

좋은 웹페이지 즐겨찾기