<?php
@require("../../class/connect.php");
if(!defined('InEmpireCMS'))
{
	exit();
}
include("../../class/db_sql.php");
include("../../class/config.php");
include("../../class/q_functions.php");
include "../".LoadLang("pub/fun.php");
$link=db_connect();
$empire=new mysqlquery();
$editor=1;
//分类id
$bid=(int)$_GET['bid'];
$gbr=$empire->fetch1("select bid,bname,groupid from {$dbtbpre}enewsgbookclass where bid='$bid'");
if(empty($gbr['bid']))
{
	printerror("EmptyGbook","",1);
}
//权限
if($gbr['groupid'])
{
	include("../../class/user.php");
	$user=islogin();
	include("../../class/MemberLevel.php");
	if($level_r[$gbr[groupid]][level]>$level_r[$user[groupid]][level])
	{
		echo"<script>alert('您的会员级别不足(".$level_r[$gbr[groupid]][groupname].")，没有权限提交信息!');history.go(-1);</script>";
		exit();
	}
}
esetcookie("gbookbid",$bid,0);
$bname=$gbr['bname'];
$search="&bid=$bid";
$page=(int)$_GET['page'];
$start=(int)$_GET['start'];
$line=12;//每页显示条数
$page_line=12;//每页显示链接数
$offset=$start+$page*$line;//总偏移量
$totalnum=(int)$_GET['totalnum'];
if($totalnum)
{
	$num=$totalnum;
}
else
{
	$totalquery="select count(*) as total from {$dbtbpre}enewsgbook where bid='$bid' and checked=0";
	$num=$empire->gettotal($totalquery);//取得总条数
}
$search.="&totalnum=$num";
$query="select lyid,name,email,`call`,lytime,lytext,retext from {$dbtbpre}enewsgbook where bid='$bid' and checked=0";
$query=$query." order by lyid desc limit $offset,$line";
$sql=$empire->query($query);
$listpage=page1($num,$line,$page_line,$start,$page,$search);
$url="<a href=../../../>".$fun_r['index']."</a>&nbsp;>&nbsp;".$fun_r['saygbook'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>留言 - Powered by EmpireCMS</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta content="留言" name="keywords" />
<meta content="留言" name="description" />
<link href="/ecms47/skin/default/css/style.css" rel="stylesheet" type="text/css" />
</head>
<body topmargin="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="top">
 <tr>
  <td>www.phome.net 帝国CMS万能建站工具</td>
  <td align="right"><a href="/ecms47/e/member/cp/">会员中心</a> | <a onclick="window.external.addFavorite('/ecms47/',document.title)" href="#ecms">加入收藏</a> | <a onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('/ecms47/')" href="#ecms">设为首页</a></td>
 </tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="8" id="header">
 <tr>
  <td valign="middle" id="logo"><a href="/ecms47/"><img src="/ecms47/skin/default/images/logo.gif" alt="帝国软件" /></a></td>
  <td><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="480" height="65">
    <param name="movie" value="/ecms47/skin/default/images/empirecms.swf" />
    <param name="quality" value="high" />
    <embed src="/ecms47/skin/default/images/empirecms.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="480" height="65"></embed>
   </object></td>
 </tr>
</table>
<div id="menu">
 <div id="nav">
  <ul>
     <li class="menu"><a href="/ecms47/">网站首页</a></li>
     <li class="menu2"><a href="/ecms47/news/">新闻系统</a></li>
     <li class="menu3"><a href="/ecms47/download/">下载系统</a></li>
     <li class="menu4"><a href="/ecms47/movie/">电影系统</a></li>
     <li class="menu5"><a href="/ecms47/shop/">商城系统</a></li>
     <li class="menu6"><a href="/ecms47/flash/">FLASH系统</a></li>
     <li class="menu7"><a href="/ecms47/photo/">图片系统</a></li>
     <li class="menu8"><a href="/ecms47/article/">文章系统</a></li>
     <li class="menu9"><a href="/ecms47/info/">分类信息</a></li>
  </ul>
 </div>
 <div id="sNav">
  <ul>
     <li class="no">分类信息：</li>
     <li><a href="/ecms47/e/action/ListInfo/?classid=9&ph=1&myarea=东城区">东城区</a></li>
     <li><a href="/ecms47/e/action/ListInfo/?classid=9&ph=1&myarea=西城区">西城区</a></li>
     <li><a href="/ecms47/e/action/ListInfo/?classid=9&ph=1&myarea=崇文区">崇文区</a></li>
     <li><a href="/ecms47/e/action/ListInfo/?classid=9&ph=1&myarea=宣武区">宣武区</a></li>
     <li><a href="/ecms47/e/action/ListInfo/?classid=9&ph=1&myarea=朝阳区">朝阳区</a></li>
     <li><a href="/ecms47/e/action/ListInfo/?classid=9&ph=1&myarea=海淀区">海淀区</a></li>
     <li><a href="/ecms47/e/action/ListInfo/?classid=9&ph=1&myarea=丰台区">丰台区</a></li>
     <li><a href="/ecms47/e/action/ListInfo/?classid=9&ph=1&myarea=石景山区">石景山区</a></li>
     <li><a href="/ecms47/e/action/ListInfo/?classid=9&ph=1&myarea=通州区">通州区</a></li>
     <li><a href="/ecms47/e/action/ListInfo/?classid=9&ph=1&myarea=昌平区">昌平区</a></li>
     <li><a href="/ecms47/e/action/ListInfo/?classid=9&ph=1&myarea=大兴区">大兴区</a></li>
     <li><a href="/ecms47/e/action/ListInfo/?classid=9&ph=1&myarea=其它">其它</a></li>
  </ul>
 </div>
</div>
<table width="100%" border="0" cellpadding="0" cellspacing="4">
 <tr>
  <td>现在的位置：<?=$url?></td>
 </tr>
</table>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#E1EFFB" id="content">
  <tr>
  <td align="center" bgcolor="#E1EFFB"><strong><?=$bname?></strong></td>
 </tr>
 <tr>
  <td align="left" valign="top"><table width="100%" border="0" cellpadding="4" cellspacing="0" bgcolor="#FFFFFF">
        <tr>
          <td height="100%" valign="top" bgcolor="#FFFFFF"> 
<?
while($r=$empire->fetch($sql))
{
	$r['retext']=nl2br($r[retext]);
	$r['lytext']=nl2br($r[lytext]);
?>
 
            <table width="92%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#F4F9FD" class=tableborder>
              <tr class=header>
        <td width="55%" height="23">发布者: <?=$r[name]?> </td>
        <td width="45%">发布时间: <?=$r[lytime]?> </td>
       </tr>
       <tr bgcolor="#FFFFFF">
        <td height="23" colspan="2"><table border=0 width=100% cellspacing=1 cellpadding=8 bgcolor='#cccccc'>
          <tr>
           <td width='100%' bgcolor='#FFFFFF' style='word-break:break-all'> <?=$r[lytext]?> </td>
          </tr>
         </table>
         
<?
if($r[retext])
{
?>

         <table width=100% border=0 align=center cellpadding=3 cellspacing=1>
          <tr>
           <td><img src=../../data/images/regb.gif width=18 height=18><strong><font color=#FF0000>回复:</font></strong> <?=$r[retext]?> </td>
          </tr>
         </table>
         
<?
}
?> </td>
       </tr>
      </table>
            <br>
     
<?
}
db_close();
$empire=null;
?>

            <table width="92%" border="0" align="center" cellpadding="4" cellspacing="1">
              <tr>
       <td>分页:<?=$listpage?></td>
      </tr>
     </table>
     <form name="form1" method="post" action="../../enews/index.php">
              <table width="92%" border="0" align="center" cellpadding="4" cellspacing="1"class=tableborder>
                <tr class=header>
        <td colspan="2" bgcolor="#F4F9FD"><strong>请您留言:</strong></td>
       </tr>
       <tr bgcolor="#FFFFFF">
        <td width="20%">姓名:</td>
        <td width="722" height="23"><input name="name" type="text" id="name">
         *</td>
       </tr>
       <tr bgcolor="#FFFFFF">
        <td>联系邮箱:</td>
        <td height="23"><input name="email" type="text" id="email">
         *</td>
       </tr>
       <tr bgcolor="#FFFFFF">
        <td>联系电话:</td>
        <td height="23"><input name="call" type="text" id="call"></td>
       </tr>
       <tr bgcolor="#FFFFFF">
        <td>留言内容(*):</td>
        <td height="23"><textarea name="lytext" cols="60" rows="12" id="lytext"></textarea></td>
       </tr>
       <tr bgcolor="#FFFFFF">
        <td height="23">&nbsp;</td>
        <td height="23"><input type="submit" name="Submit3" value="提交">
        <input type="reset" name="Submit22" value="重置">
        <input name="enews" type="hidden" id="enews" value="AddGbook"></td>
       </tr>
      </table>
     </form></td>
   </tr>
  </table></td>
 </tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="2" class="marTop" id="footer">
  <tr> 
    <td id="botNav"><a href="#">关于我们</a> | <a href="#">服务条款</a> | <a href="#">广告服务</a> 
      | <a href="#">联系我们</a> | <a href="#">网站地图</a> | <a href="#">免责声明</a></td>
  </tr>
  <tr> 
    <td>Powered by <a href="http://www.phome.net" target="_blank"><strong>EmpireCMS</strong></a> 
        <font color="#FF9900"><strong>4.7</strong></font> &copy; 2007-2008 EmpireSoft 
        Inc.</td>
  </tr>
  <tr> 
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>