<?php include_once('web_left.php');?>
    <td width="493" align="left"><table border="0" cellpadding="0" cellspacing="0" class="righttable">
<?php
global $db;
	$sql="select * from s_gbook where S_namea='".$chsh_web_name."' order by s_id desc";
		$Arr=getuserpage($sql,"15");//sql,每页显示条数
		$result=$db->query($Arr[2]);
?>
        <tr> 
          <td width="98" class="righttable01"><img src="images/web/dl_01_02.jpg" width="9" height="9" align="absmiddle"> 
            <strong>网友留言</strong></td>
          <td width="388" align="right" class="righttable01"><?php echo $Arr[0];?></td>
        </tr>
        <tr align="left" valign="top"> 
          <td height="150" colspan="2" class="righttable02">
<?php
		if($result){
			while ($row = $db ->fetch_array($result)){
	$us=$db->getrow("select * from S_users where S_name='".$row['S_Nameb']."'");
?>
  <table width="98%" border="0" cellpadding="0" cellspacing="1" class="righttable06">
                    <tr> 
                      <td width="20%" rowspan="3" align="center" valign="top"><a href="<?php echo userlink('index',$row["S_Nameb"])?>" target="_blank"><img src="<?php echo piclink("logo",$us["S_Logo"])?>" onerror="this.onerror=null;this.src='images/avatar/noface_small.gif'" width="92" height="135" border="0"> </a>
                      </td>
                    </tr>
                    <tr> 
                      <td height="40" class="righttable04" style="word-break:break-all"> &nbsp;<?php echo str_decode(facehtml($row['S_Content']))?>
<?php
if($row["S_ReContent"]!=""){
?><br><br><br><font color=red> &nbsp;&nbsp;&nbsp;<?php echo $row["S_Namea"]?>回复：<?php echo str_decode(facehtml($row['S_ReContent']))?></font>
<?php
}
?>
</td>
                    </tr>
                    <tr> 
                      <td align="right" class="righttable04"> 留言人：<a href="<?php echo userlink('index',$row["S_Nameb"])?>" target="_blank"><?php echo $us["S_RealName"]?></a>
                      &nbsp; 留言时间：&nbsp;<?php echo $row["S_AddTime"]?></td>
                    </tr>
                  </table>
	  <br>
<?php
}
}
?>
 
      <table border="0" cellpadding="0" cellspacing="0" class="righttable">
        <tr> 
          <td class="righttable01"><img src="images/web/dl_01_02.jpg" width="9" height="9" align="absmiddle"> 
            <strong>添加留言</strong></td>
          <td align="right" class="righttable01">&nbsp;</td>
        </tr>
        <tr align="left" valign="top"> 
          <td height="150" colspan="2" class="righttable02"><form action="do.php?ac=gbook&op=add" method="post" name="form2" >
            <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="righttable03">
              <tr>
                <td>&nbsp;&nbsp;内容：</td><input name="S_Namea" type="hidden" value="<?php echo $chsh_web_name?>">
                <td height="120"><textarea name="S_Content" onkeyup="textCounter(this, 'maxlimit', 500)" id="message" cols="45" rows="7"></textarea>
                  <span id="maxlimit">*500字符内</span><div id="face_show"></div></td>
              </tr>
              <tr>
                <td height="30" colspan="2" align="center"><input onclick="showFace(this.id, 'message');" type="button"  value="插入表情">&nbsp;&nbsp;<input name="sendbbs"  onClick="checkform()" type="button"  value="发表留言">&nbsp;&nbsp;</td>
                </tr>
            </table>
          </form>
		  <script language="vbscript">
sub checkform()
		if cstr(trim(form2.S_Content.value))="" then
			alert("请输入留言内容")
			exit sub
		elseif len(cstr(trim(form2.S_Content.value)))>500 then
			alert("内容长度超过500字符")
			exit sub
		else
			document.form2.submit
		end if
end sub
</script></td>
        </tr>
      </table>
			
			
		  </td>
        </tr>
      </table>
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td height="8"></td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<table width="756" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="8"></td>
  </tr>
</table>
<table width="756" border="0" align="center" cellpadding="0" cellspacing="0" class="bottomtable">
  <tr> 
    <td><div align="center">
</div></td>
  </tr>
</table>
