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

$userid=intval(get_cookie('clubuser_id'));
$id=intval($_GET["id"]);
$page=$_GET["page"];
if ($page==""){
$page=1;
}
include_once("memberinfo.php");

if ($_POST["act"]=="y"){
$id=intval($_POST["id"]);
$title=ftbbs_request(trim($_POST["title"]));
$content=ftbbs_request(trim($_POST["content"]));
$content=ubb($content);
$content=nojs($content);
$sql="update {$tablepre}sms set title='".$title."',content='".$content."' where id='".$id."'";
mysql_query($sql);
header("Location:blogsms.php?page=".$page);
}
?>
<html><head><meta http-equiv=content-type content="text/html; charset=utf-8>">
</head>
<script language="javascript">
<!--
	function check(form)
	{
    if (form.title.value=="")
    	{
    		alert("请填写标题！");
    		form.title.focus();
    		return false;
  	}
    if (form.content.value=="")
    	{
    		alert("请填写内容！");
    		form.content.focus();
    		return false;
  	}
return true;
	}
//-->
</script>
<body>
<center>
<title><?=$username?>的短信管理中心</title>
<link rel="stylesheet" type="text/css" href="<?=$cssfile?>">
<?
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="95%"  border="0" align="center" cellpadding="0" cellspacing="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>
<?
$sql="select * from {$tablepre}sms where id=".$id;
$rs=mysql_query($sql);
$myrow = mysql_fetch_array($rs);		  
?>
                <form name="form2" method="post" action="" style="MARGIN-BOTTOM: 0px" onsubmit="return check(this)">
                  <tr> 
                    <td width="10%" height="35"> <div align="left">标题：</div></td>
                    <td width="90%"><input name="title" type="text" id="title" value="<?=$myrow["title"]?>" size="35"></td>
                  </tr>
                  <tr> 
                    <td height="15" valign="top">内容: </td>
                    <td height="15" valign="top"><textarea name="content" cols="50" rows="20" id="content"><?=htmltocode($myrow["content"])?></textarea></td>
                  </tr>
                  <tr>
                    <td height="35" valign="top">&nbsp;</td>
                    <td height="15" valign="middle">
                    <input name="act" type="hidden" id="act" value="y">
                    <input name="id" type="hidden" id="id" value="<?=$id?>">
					<input type="submit" name="Submit" value="确认修改"></td>
                  </tr>
                </form>
              </table>
              <br>
            </div>

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