<!-- #include file="../inc/checkadmin.asp" -->
<!-- #include file="../inc/conn.asp" -->
<!-- #include file="inc/Config.asp" -->

<% 
if request.QueryString("EditArticle")<>"" then

if request.form("w_title")="" then
response.write "<Script language=JavaScript>alert('亲爱的，是不是忘记输入《 文章标题 》了？');history.back();</Script>"
response.end 
end if

if request.form("w_content")="" then
response.write "<Script language=JavaScript>alert('亲爱的，是不是忘记输入《 文章内容 》了？');history.back();</Script>"
response.end 
end if

bjid=request.QueryString("EditArticle")
w_title=request.form("w_title")
w_keywords=request.form("w_keywords")
l_id=request.form("l_id")
w_description=request.form("w_description")
w_author=request.form("w_author")
w_content=request.form("w_content")
view_yes=request.form("view_yes")
w_tuijian=request.form("w_tuijian")
hit=request.form("hit")
Publish_Mode=request.form("Publish_Mode")
w_images=replace(request.form("w_images"),"../../../", "../")

userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR") 
If userip = "" Then 
userip = Request.ServerVariables("REMOTE_ADDR") 
end if

IPArray=Split(userip,".",-1,1)
For i=0 To 3
	tIp = tIp +IPArray(i)*256^(3-i)
Next
IP=tIp

set rs=server.createobject("adodb.recordset")
sql="select * from web_Article where w_id="&bjid&""
rs.open sql,conn,1,3
rs("w_title")=""&w_title&""
rs("w_keywords")=""&w_keywords&""
rs("l_id")=""&l_id&""
rs("w_description")=""&w_description&""
rs("w_author")=""&w_author&""
rs("w_content")=""&w_content&""
rs("view_yes")=""&view_yes&""
rs("w_tuijian")=""&w_tuijian&""
rs("hit")=""&hit&""
rs("Publish_Mode")=""&Publish_Mode&""
rs("w_images")=""&w_images&""
rs("w_zzip")=""&IP&""
rs("edit_time")=now
rs.update
response.write "<script>alert('恭喜，文章已成功修改！');location.href='ArticleList.asp'</script>"
rs.close
set rs=nothing
response.end
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
	
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		
		<title>编辑文章 - <%=admin_name%></title>
		
		<!--                       CSS                       -->
	  
		<!-- Reset Stylesheet -->
		<link rel="stylesheet" href="images/css/reset.css" type="text/css" media="screen" />
	  
		<!-- Main Stylesheet -->
		<link rel="stylesheet" href="images/css/style.css" type="text/css" media="screen" />
		
		<!-- Invalid Stylesheet. This makes stuff look pretty. Remove it if you want the CSS completely valid -->
		<link rel="stylesheet" href="images/css/invalid.css" type="text/css" media="screen" />	
		
		<!-- Colour Schemes
	  
		Default colour scheme is green. Uncomment prefered stylesheet to use it.
		
		<link rel="stylesheet" href="images/css/blue.css" type="text/css" media="screen" />
		
		<link rel="stylesheet" href="images/css/red.css" type="text/css" media="screen" />  
	 
		-->
		
		<!-- Internet Explorer Fixes Stylesheet -->
		
		<!--[if lte IE 7]>
			<link rel="stylesheet" href="images/css/ie.css" type="text/css" media="screen" />
		<![endif]-->
		
		<!--                       Javascripts                       -->
<script charset="utf-8" src="../editor/kindeditor.js"></script>
<script charset="utf-8" src="../editor/lang/zh_CN.js"></script>
<script>
        var editor;
        KindEditor.ready(function(K) {
                editor = K.create('#editor_id');
				filterMode : false
        });
</script>

  
		<!-- jQuery -->
		<script type="text/javascript" src="images/scripts/jquery-1.3.2.min.js"></script>
		
		<!-- jQuery Configuration -->
		<script type="text/javascript" src="images/scripts/simpla.jquery.configuration.js"></script>
		
		<!-- Facebox jQuery Plugin -->
		<script type="text/javascript" src="images/scripts/facebox.js"></script>
		
		<!-- jQuery WYSIWYG Plugin -->
		<script type="text/javascript" src="images/scripts/jquery.wysiwyg.js"></script>
		
		<!-- jQuery Datepicker Plugin -->
		<script type="text/javascript" src="images/scripts/jquery.datePicker.js"></script>
		<script type="text/javascript" src="images/scripts/jquery.date.js"></script>
		<!--[if IE]><script type="text/javascript" src="images/scripts/jquery.bgiframe.js"></script><![endif]-->

		
		<!-- Internet Explorer .png-fix -->
		
		<!--[if IE 6]>
			<script type="text/javascript" src="images/scripts/DD_belatedPNG_0.0.7a.js"></script>
			<script type="text/javascript">
				DD_belatedPNG.fix('.png_bg, img, li');
			</script>
		<![endif]-->
		
	</head>
  
	<body><div id="body-wrapper"> <!-- Wrapper for the radial gradient background -->
		<!-- #include file="Menu.asp" -->
		 <!-- End #sidebar -->
		
		<div id="main-content"> <!-- Main Content Section with everything -->
      			<noscript> <!-- Show a notification if the user has disabled javascript -->
				<div class="notification error png_bg">
					<div>
						亲爱的，你的浏览器不支持。请升级您的浏览器。</div>
				</div>
</noscript>
			
			<!-- Page Head -->
			<div class="content-box">
			  <!-- Start Content Box -->
			  <div class="content-box-header">
			    <h3>编辑文章</h3>
			    <ul class="content-box-tabs">
			      <li></li>
			      <!-- href must be unique and match the id of target div -->
		        </ul>
			    <div class="clear"></div>
		      </div>
			  <!-- End .content-box-header -->
			  <div class="content-box-content">
			    <div class="tab-content default-tab" id="tab1">
			      <!-- This is the target div. id must match the href of this div's tab -->
			      <div class="notification attention png_bg"> <a href="#" class="close"><img src="images/images/icons/cross_grey_small.png" title="Close this notification" alt="close" /></a>
			        <div> 操作提示：在这里您可以编辑发表的文章。</div>
			      </div>
			          <% 
edit=request.QueryString("edit")
set rs=server.createobject("adodb.recordset")
sql="select * from web_Article where w_id="&edit&""
rs.open(sql),conn,1,1
w_id=rs("w_id")
w_title=rs("w_title")
w_keywords=rs("w_keywords")
l_id=rs("l_id")
w_description=rs("w_description")
w_author=rs("w_author")
w_content=rs("w_content")

view_yes=rs("view_yes")
w_tuijian=rs("w_tuijian")
hit=rs("hit")
Publish_Mode=rs("Publish_Mode")
w_images=rs("w_images")
rs.close
set rs=nothing
%>
                  <form id="form1" name="form1" method="post" action="?EditArticle=<%=w_id%>">
			      <table width="80%" class="biaoge">
			        <thead>
		            </thead>
			        <tbody>
		            </tbody>
			        

			          <tr >
			            <td width="15%">文章标题：</td>
			            <td width="85%"><input name="w_title" type="text" class="text4" id="w_title" value="<%=w_title%>" size="50" /></td>
		              </tr>
			          <tr>
			            <td>文章分类</td>
			            <td><label for="l_id">
			              <select name="l_id" id="l_id">
			                <% 
set rs=server.createobject("adodb.recordset")
sql="select * from Web_2Navigation where n_pattern<>1"
rs.open(sql),conn,1,1
do while not rs.eof
n_id=rs("n_id")
n_name=rs("n_name")
%>
			                <option value="<%=n_id%>" <%if l_id=n_id then response.write "selected='selected' " end if%> ><%=n_name%></option>
			                <%
rs.movenext
loop
rs.close
set rs=nothing
%>
		                  </select></td>
		              </tr>
			          <tr>
			            <td>文章图片</td>
			            <td valign="middle"><input name="w_images" type="text" class="text" id="w_images" value="<%=w_images%>" />
			              &nbsp;
			              <iframe style="top:2px" id="UploadFiles" src="Upload/Article/Upload.asp" frameborder="0" scrolling="No" width="300" height="20" name="I1" marginwidth="1" marginheight="0"></iframe></td>
		              </tr>
			          <tr>
			            <td>文章关键字</td>
			            <td><input name="w_keywords" type="text" class="text4" id="w_keywords" value="<%=w_keywords%>" size="50" />
			              &nbsp;请使用中文逗号，隔开</td>
		              </tr>
			          <tr >
			            <td>文章描述</td>
			            <td><textarea name="w_description" cols="70" rows="3" class="text3" id="w_description"><%=w_description%></textarea></td>
		              </tr>
			          <tr >
			            <td>文章内容</td>
			            <td><textarea id="editor_id" name="w_content" style="width:100%;height:400px;"><%=w_content%></textarea></td>
		              </tr>
			          <tr>
			            <td>文章作者：</td>
			            <td><input name="w_author" type="text" class="text" id="w_author" value="<%=w_author%>" size="30" /></td>
		              </tr>
			          <tr >
			            <td>是否显示</td>
			            <td><input name="view_yes" type="radio" id="radio" value="1" <%if view_yes=1 then response.write "checked='checked'" end if%> />
			              显示
			              <input type="radio" name="view_yes" id="radio2" value="0" <%if view_yes=0 then response.write "checked='checked'" end if%>/>
			              隐藏</td>
		              </tr>
			          <tr>
			            <td>是否推荐:</td>
			            <td><input type="radio" name="w_tuijian" id="radio3" value="1" <%if w_tuijian=1 then response.write "checked='checked'" end if%>/>
			              推荐
			              <input name="w_tuijian" type="radio" id="radio4" value="0" <%if w_tuijian=0 or w_tuijian="" then response.write "checked='checked'" end if%>/>
			              不推荐 </td>
		              </tr>
			          <tr >
			            <td>访问量：</td>
			            <td><input name="hit" type="text" class="text" id="hit" value="<%=hit%>" size="30" /></td>
		              </tr>
			          <tr>
			            <td>发表方式：</td>
			            <td><input name="Publish_Mode" type="radio" id="radio5" value="1" checked="checked" <%if Publish_Mode=1 then response.write "checked='checked'" end if%> />
			              WEB网页
			              <input type="radio" name="Publish_Mode" id="radio6" value="2" <%if Publish_Mode=2 then response.write "checked='checked'" end if%>/>
			              移动设备
			              <input type="radio" name="Publish_Mode" id="radio7" value="3" <%if Publish_Mode=3 then response.write "checked='checked'" end if%>/>
			              平板电脑</td>
		              </tr>
			          <tr >
			            <td>&nbsp;</td>
			            <td><input type="submit" name="button" id="button" value="提交" />
			              &nbsp;
			              <input type="reset" name="button2" id="button2" value="重置" /></td>
		              </tr>
		          </table>
                  </form>
                </div>
			    <!-- End #tab1 -->
			    <div class="tab-content" id="tab2"></div>
			    <!-- End #tab2 -->
		      </div>
		  <!-- End .content-box-content --></div> <!-- End .clear --><!-- End .content-box --><!-- End .content-box --><!-- End .content-box -->

			
			
			<!-- Start Notifications --><!-- End Notifications -->
			
<div id="footer">
				<small> <!-- Remove this notice or replace it with whatever you want -->
						<%=Copyright%>
				</small>
			</div><!-- End #footer -->
			
		</div> <!-- End #main-content -->
		
	</div></body>
  

</html>
<!-- #include file="../inc/close.asp" -->