<?php
include_once("inc/config.php");
include_once("inc/ftbbsdbclass.php");
include_once("inc/pageclass.php");
include_once("inc/publicfun.php");
include_once("conn.php");
include_once("checkuser.php");
include_once("bbsuser.php");

$userid=intval(get_cookie('clubuser_id'));
$searchstr=$_GET["searchstr"];
if ($searchstr!=""){
$typestr=" and title='".$searchstr."'";
}

$query = "SELECT * FROM {$tablepre}ftbbsmb";
$ftbbsmb=makecache('ftbbsmb.html',$query,$expire);
$pagesize=$ftbbsmb[5];

include_once("memberinfo.php");
?>

<html><head><meta http-equiv=Content-Type content="text/html; charset=<?=$charset?>">
</head>
<body>
<center>
<title><?=$username?></title>
<link rel="stylesheet" type="text/css" href="<?=$cssfile?>">
<link rel="stylesheet" type="text/css" href="blogcss/blogpage.css">
<?
include_once("usernav.php");
include_once("bokerhead.php");
?>
<div class="stage">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="layout">
<tr>
<td valign="top" class="c2t3">
<div id="mod_profile" class="mod" rel="drag">
<?
include_once("usercalog.php");
?>
</div>
</td>
<td valign="top" class="c2t1">
<div id="m_blog" class="modbox">
              <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                <tr valign="middle"> 
                  <td height="40" colspan="2" align="left" class="f14"><div class="opt"> 
                      <div align="center"><strong>短信管理中心</strong></div>
                    </div></td>
                </tr>
                <tr> 
                  <td height="1" colspan="2" bgcolor="#336699" class=new14><spacer height="1" type="block"></td>
                </tr>
                <tr> 
                  <td width="77%" height="30"> <div align="left"><strong>&nbsp;&nbsp;标题</strong></div></td>
                  <td width="23%" align="right"> <div align="center">操作</div></td>
                </tr>
                <tr> 
                  <td height="1" colspan="2" background="blogimages/dotbg.gif"><spacer height="1" type="block"></td>
                </tr>
<?
$sql="select * from {$tablepre}sms where accepter='".$username."' ".$typestr." order by isNew asc,indate desc";
$rs=mysql_query($sql);
$myrow = mysql_fetch_array($rs);
$numrows = mysql_num_rows($rs);
$p = new ft_page;

$p->pvar="page"; 
//$p->setvar(array("searchstr" => $searchstr)); 
$p->set($pagesize,$numrows,$psize); 
$rsx=mysql_query($sql." limit ".$p->limit());
if ($numrows!=0){
while ($myrow = mysql_fetch_array($rsx)){		  
?>
                <tr> 
                  <td height="25"><div class="opt"><a href="blogsms_reply.php?id=<?=$myrow["id"]?>&op=Y"><?=$myrow["title"]?></a>(<?=$myrow["indate"]?>)</div></td>
                  <td height="25"><div class="opt"><div align="right">
                      <? if ($myrow["IsNew"]==0){?>
                      (<font color="#FF0000">新</font>) 
                      <? }?>
                      <a href="blogsms_reply.php?id=<?=$myrow["id"]?>&op=N">回复</a> 
                      <a href="blogsms_edit.php?id=<?=$myrow["id"]?>">编辑</a> <a href="delsms.php?id=<?=$myrow["id"]?>">删除</a></div></div></td>
                </tr>
                <tr> 
                  <td height="1" colspan="2" background="blogimages/dotbg.gif"><spacer height="1" type="block"></td>
                </tr>
<?
}
?>
                <tr> 
                  <td height="35" colspan="2" align="right">
<?
$p->output(0);
?>
				  </td>
                </tr>
<?
}
else{
?>
                <tr> 
                  <td colspan="2" height="25"></td>
                </tr>
<? }?>
              </table>
              <br>
            </div>

</td>
</tr></table>
</div>
</div>
<br><center>
<?
include_once("tail.php");
?>
  </center>
</center>
</body>
</html>