require_once("header.php"); //个档引用 require_once("../Mod/Msg/Func/Basic.inc.php"); require_once("../Pub/Func/Auth.inc.php"); if ($_GET['typeserial'] == "7"){ $newsTit = "经销活动"; $pciTitName = "contit_distribution.jpg"; }else if($_GET['typeserial'] == "5"){ $newsTit = "业界新闻"; $pciTitName = "contit_news.jpg"; } //经销活动的分类ID为7,业界新闻的分类ID为5 if ($_GET['typeserial'] == "7" || $_GET['typeserial'] == "5") { if ($_GET['state'] == "") { $Sql="select count(l.TargetId) as Times, t.Serial as TypeSerial, t.Name as TypeName, m.Serial as MsgSerial, m.Title as MsgTitle, m.Source, convert(char(10),m.STime,120) as STime, convert(char(10),m.ETime,120) as ETime, v.IdvName as Creator, convert(char(10),m.Created,120) as Created from CCBU.dbo.TB_MsgType t inner join CCBU.dbo.TB_Msg m on t.Serial=m.MsgTypeSerial left join dbo.VW_Idv v on m.Creator=v.user_id left join CCBU.dbo.TB_UserLog l on m.Serial=l.TargetId and l.Type='1' where t.Active='true' and m.Active='true' and t.Serial='".$_GET['typeserial']."' and convert(char(8),m.STime,112)<=convert(char(8),getdate(),112) and convert(char(8),m.ETime,112)>=convert(char(8),getdate(),112) group by t.Serial, t.Name, m.Serial, m.Title, m.Source, convert(char(10),m.STime,120), convert(char(10),m.ETime,120), v.IdvName, convert(char(10),m.Created,120) order by STime DESC"; //分页 $result = mssql_query($Sql); $numrows = mssql_num_rows($result); $page_size=10;//单页N笔 $offset = $_REQUEST['offset'] == "" ? 0 : $_REQUEST['offset'];//第N笔 $page_select = pages($numrows, $offset, $page_size,"typeserial=".$_GET['typeserial'],"manu", 2); //(总笔数,第N页,单页N笔,URL,CSS,显示模式) //列表 $news_list = getValueList($Sql,$_GET['page'],$page_size); //print '
'. print_r($news_list, TRUE) .''; $smarty->assign('PAGE_SELECT', $page_select); $smarty->assign('getValue', $news_list); }elseif ($_GET['state'] == "view" && $_GET['no'] !=""){ $news_content = getMsgContent($_GET['no']); //print '
'. print_r($news_content, TRUE) .''; //$Http=($_SERVER["SERVER_ADDR"]=='10.1.2.198'||$_SERVER["SERVER_ADDR"]=='')?'channel.wpgcnc.com':$_SERVER['HTTP_HOST']; if(isRealIpInternal()){ $Http='channel.wpgcnc.com'; }else{ $Http=$_SERVER['HTTP_HOST']; } $news_content['MsgContent']=str_replace('src="/channel/File','src="http://'.$Http.'/channel/File',$news_content['MsgContent']); $smarty->assign('MSGTITLE', $news_content['MsgTitle']); $smarty->assign('CREATED', $news_content['Created']); $smarty->assign('STIME', $news_content['STime']); $smarty->assign('MSGCONTENT', $news_content['MsgContent']); }else{ } }else{ $smarty->assign('ERROR', "非法访问!"); } $smarty->assign('STATE', $_GET['state']); $smarty->assign('TYPESERIAL', $_GET['typeserial']); $smarty->assign('NEWSTIT', $newsTit); $smarty->assign('PCITITNAME', $pciTitName); $smarty->display('news.tpl'); require_once("footer.php"); ?>