<!--#include file="inc/conn.asp"-->
<!--#include file="inc/safe.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/const.asp"-->
<%
if MemberName="" then
  response.Redirect("userlogin.asp")
  response.end
end if
%>
<%
if request.QueryString("action")="save" then
dim errmsg
errmsg=""

if ChkPost=false then
  errmsg=errmsg+"<li>错误，不允许外部提交数据！"  
end if

dim title,content,weather,classid,artid

title=trim(ReplaceBadChar(request.Form("title")))
weather=request.Form("weather")
classid=request.Form("classid")
content=request.Form("content")
artid=request.Form("artid")
tj=request.Form("tj")


if tj<>1 then tj=0
'on error resume next

if title="" then errmsg=errmsg+"<br>"+"<li>文章的标题不能为空！"
if invalidch(title) or instr(title,"，")>0  then errmsg=errmsg+"<br>"+"<li>您的标题可能含特殊符号，请检查！"

if errmsg<>"" then 
 response.Write "错误信息：<br>"
 response.write("　　　"+ errmsg)
 response.Write "<input type='button' value='返回修改' onClick='javascript:window.history.back();'>"
 response.Write "<input type='button' value='关闭窗口' onClick='javascript:window.close();'>"
 response.end
end if

set rst=server.CreateObject("adodb.recordset")   '添加交友帐号
sql1="select * from article where id ="& artid &""
rst.open sql1,conn,1,3
rst("title")=title
rst("classid")=classid
rst("weather")=weather
rst("content")=content
rst("tj")=tj
rst.update
rst.close
set rst=nothing

conn.close
set conn=nothing

BackInfo("rg.asp")
response.end
end if
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>红嫂视屏交友网</title>
<meta name="keywords" content="情感,在线,新新,照片,动感影片,诗歌,爱情,纯洁,心连心">
<meta name="description" content="红嫂视屏交友情缘 情感在线">
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	background-image: url();
}
.STYLE8 {
	color: #CC0099;
	font-size: 12px;
	font-weight: bold;
}
.STYLE31 {color: #666666; font-size: 12px;}
-->
</style>
<script language="javascript">
<!--
function checklog(){
if(document.frmlog.title.value.length==0){
alert("请填写文章标题！");
document.frmlog.title.focus();
return false;
}
if(document.frmlog.classid.value.length==0){
alert("请选择文章类别！");
document.frmlog.classid.focus();
return false;
}
return true;
}
//-->
</script>
</head>
<%
dim id
id=request.QueryString("id")
ChkNumber(id)
%>
<body>
<table width="1002" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><!--#include file="top.asp"--></td>
  </tr>
</table>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="204" height="328" valign="top"><!--#include file="memberleft.asp"-->
</td>
    <td width="583" valign="top"><table width="565" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td><TABLE width="100%" border=0 
            cellPadding=0 cellSpacing=0 bgColor=white class="STYLE4" style="BORDER-BOTTOM: #9DCCF6 1px solid">
              <TBODY>
                <TR>
                  <TD align=center width="2%"><img src="image/tiao_3.gif" width="10" height="31"></TD>
                  <TD width="14%" align=center background="image/tiao_4.gif"><table width="86" height="25" border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td align="center" class="pgd">编辑修改</td>
                      </tr>
                  </table></TD>
                  <TD width="50%" height="20" align="center" background="image/tiao_4.gif">&nbsp;</TD>
                  <TD width="32%" align="center" background="image/tiao_4.gif">&nbsp;</TD>
                  <TD width="2%" align="center"><img src="image/tiao_2.gif" width="10" height="31"></TD>
                </TR>
              </TBODY>
          </TABLE></td>
        </tr>
        <tr>
          <td height="556" valign="top" style="border-left:#C7C8CC 1px solid;border-right:#C7C8CC 1px solid;border-bottom:#C7C8CC 1px solid"><br>
            <%
set rs=server.CreateObject("adodb.recordset")
sql="select * from article where id="& id &""
rs.open sql,conn,1
if not (rs.eof or rs.bof) then
if rs("userid")<>userid then
  response.Write "<p align='center' class='style30'><br>此信息不是你提交，你没有修改权限</p>"
  response.end
end if
%>
            <table width="540" border="0" align="center" cellpadding="0" cellspacing="0" class="STYLE31">
              <form name="frmlog" method="post" action="editdiary.asp?action=save" onSubmit="return checklog();">
                <tr>
                  <td width="52" height="30" align="center" class="STYLE4">标题：</td>
                  <td height="30" colspan="4" class="STYLE4"><input name="title" type="text" id="title" size="50" maxlength="100" value="<%=rs("title")%>"></td>
                </tr>
                
                <tr>
                  <td width="52" height="30" align="center" class="STYLE4">类型：</td>
                  <td width="178" height="30" class="STYLE4"><select name="classid" id="classid">
                      <%
					  set rst=server.CreateObject("adodb.recordset")
					  sql="select * from art_class"
					  rst.open sql,conn,1
					  do while not rst.eof
					   response.Write "<option value="""& rst("classid") &""""
					   if rs("classid")=rst("classid") then
					     response.Write " selected"
					   end if
					   response.Write ">"& rst("classname") &"</option>"
					  rst.movenext
					  loop
					  rst.close
					  set rst=nothing
					  %>
                    </select>                  </td>
                  <td width="70" class="STYLE4">天气情况：</td>
                  <td width="118" class="STYLE4"><select name="weather" id="weather">
                      <option value="sun2.gif"<%if rs("weather")="sun2.gif" then response.Write " selected"%>>晴</option>
                      <option value="yin.gif"<%if rs("weather")="yin.gif" then response.Write " selected"%>>阴</option>
                      <option value="yinyu.gif"<%if rs("weather")="yinyu.gif" then response.Write " selected"%>>雨</option>
                      <option value="xue.gif"<%if rs("weather")="xue.gif" then response.Write " selected"%>>雪</option>
                    </select>                  </td>
                  <td width="132" class="STYLE4"><input name="tj" type="checkbox" id="tj" value="1" <%if rs("tj")=1 then response.Write "checked"%>>
        推荐文章</td>
                </tr>
                <tr>
                  <td width="52" height="20" align="center" class="STYLE4">内容：</td>
                  <td colspan="4" class="STYLE4">&nbsp;</td>
                </tr>
                <tr>
                  <td colspan="5" align="center" class="STYLE4"><iframe id="eWebEditor1" src="editor/ewebeditor.asp?id=content&style=standard" frameborder="0" scrolling="no" width="99%" height="350"></iframe></td>
                </tr>
                <tr>
                  <td height="40" colspan="5" align="center" class="STYLE4"><input type="image" name="imageField" src="image/button_qd.gif"></td>
                  <input type="hidden" name="artid" value="<%=id%>">
                  <input type="hidden" name="content" id="content" value="<%=server.HTMLEncode(rs("content"))%>">
                </tr>
              </form>
            </table>
          <%end if
  rs.close
  set rs=nothing
  %>                        </td>
        </tr>
    </table></td>
    <td width="163" valign="top"><!--#include file="fenlei.asp"-->
</td>
  </tr>
</table>
<table width="1002" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><!--#include file="root.asp"--></td>
  </tr>
</table>
</body>
</html>
<%
conn.close
set conn=nothing
%>
