<?php
require_once '../service/NewsService.class.php';
require_once '../phpbean/News.class.php';
$newsId = $_GET['newsId'];
$newsService = new NewsService();
$news = $newsService->GetNews($newsId);

/*使用 JSON数据格式返回*/
header('Content-type: text/json;charset=utf-8');
echo "{newsId:".$news->getNewsId();
echo ",newsTitle:\"".$news->getNewsTitle()."\"";
echo ",newsContent:\"".$news->getNewsContent()."\"";
echo ",newsDate:\"".date("Y-m-d",strtotime($news->getNewsDate()))."\"";
echo ",newsPhoto:\"".$news->getNewsPhoto()."\"";
echo "}"; 
?>
