session_start();
?>
include("./function/connectdb.php");
include("./function/config.php");
?>
$sql1="select forumgroup_ID,forumtitle from labforumgroup";
$result1=mysqli_query($link,$sql1);
?>
if( (isset($_GET['menu']))&&($_GET['menu']!="") ){
$menu1=$_GET['menu'];
$sql3="select forum,forumcontent,ispublic from labforum where forum_ID='".$menu1."'";
$result3=mysqli_query($link,$sql3);
$list3=mysqli_fetch_array($result3);
if($list3[ispublic]==1){
?>
echo $list3[forum]; ?>
echo $list3[forumcontent]; ?>
}
if($list3[ispublic]==0){
include("./function/sessioncheck2.php");
?>
echo $list3[forum]; ?>
echo $list3[forumcontent]; ?>
}
}else{
$sql4="select news_ID,username,releasedate,releasetime,invaliddate,invalidtime,newsgroup,newstitle from labnews order by news_ID desc limit 0,5";
$result4=mysqli_query($link,$sql4);
?>
公告發布者
公告類別
公告標題
生效時間
失效時間
while($list4=mysqli_fetch_array($result4)){
echo "";
echo "".$list4[username]." ";
$sql5="select newsgroup_ID,grouptitle from labnewsgroup";
$result5=mysqli_query($link,$sql5);
while($list5=mysqli_fetch_array($result5)){
if($list5[newsgroup_ID]==$list4[newsgroup]){
echo "".$list5[grouptitle]." ";
}
}
echo "".$list4[newstitle]." ";
echo "".$list4[releasedate]." - ".$list4[releasetime]." ";
echo "".$list4[invaliddate]." - ".$list4[invalidtime]." ";
echo " ";
}
?>
更多公告
}
?>
mysqli_free_result($result1);
mysqli_free_result($result2);
mysqli_free_result($result3);
mysqli_free_result($result4);
mysqli_free_result($result5);
mysqli_free_result($result6);
mysqli_close($link);
?>