<!--#include file="../utf-8.asp" -->
<!--#include file="../js/Function.asp" -->
<!--#include file="../html/yidacms_htmlurl.asp" -->
<!--#include file="../js/admin_vipkp.asp" -->
<!--#include file="../CheckAdmin.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META NAME="copyright" CONTENT="Copyright 2010-2012 - yidacms.com" />
<META NAME="Author" CONTENT="世纪伟成  yidacms.com" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../js/admin.css" rel="stylesheet" type="text/css">
<title>新闻管理！</title>
	<script charset="utf-8" src="<%=webpath%>bianji/kindeditor.js"></script>
	<script charset="utf-8" src="<%=webpath%>bianji/lang/zh_CN.js"></script>
	<script charset="utf-8" src="<%=webpath%>bianji/plugins/code/prettify.js"></script>

	<script>
		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="content1"]', {

				uploadJson : '<%=webpath%>uploadclass/upfile_flash.asp',
				fileManagerJson : '<%=webpath%>uploadclass/file_manager_json.asp',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						K('form[name=example]')[0].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						K('form[name=example]')[0].submit();
					});
				}
			});
			prettyPrint();
		});
	</script>
</head>
<body>
<%

		'版权：世纪伟成(http://yidacms.com)
		'本信息不会影响您网站的正常访问，无论免费用户或是收费用户请保留这里的信息.
		'如果您删除了这里的版权信息,将追究法律责任.
		yidacms_id = cint(Request("id"))
		set rs = server.createobject("adodb.recordset")
		sql="select * from shuaiweb_news WHERE id = "&yidacms_id&""
		rs.open sql,dbok,1,1
        	T_news = rs("shuaiweb_newssort")

		if request("t")="newsedit" Then

		yidacms_fenlei = request.form("shuaiweb_newssort")
		yidacms_fenlei1 = split(yidacms_fenlei,"|")

	        if len(trim(request.Form("shuaiweb_newstitle")))<1 then
				response.write ("<script language=javascript>alert('新闻名称必填且不能少于1个字符！');history.back(-1);</script>")
				response.end
	        end if
	  
	        if len(trim(request.Form("shuaiweb_newsContent")))<1 then
				response.write ("<script language=javascript> alert('新闻内容不能为空，且不少于1个字符！');history.back(-1);</script>")
				response.end
	        end if 

		dim rs,sql
		set rs=server.createobject("adodb.recordset")
		sql="select * from shuaiweb_news WHERE id= "&yidacms_id&""
		rs.open sql,dbok,1,3
			rs("shuaiweb_newstitle")=trim(request.form("shuaiweb_newstitle"))
			rs("shuaiweb_newsAbstract")=trim(request.form("shuaiweb_newsAbstract"))
			rs("shuaiweb_newsSource")=trim(request.form("shuaiweb_newsSource"))
			rs("shuaiweb_newsAuthor")=trim(request.form("shuaiweb_newsAuthor"))
			rs("shuaiweb_newsContent")=trim(request.form("shuaiweb_newsContent"))
			rs("shuaiweb_pic")=trim(request.form("shuaiweb_pic"))
			rs("shuaiweb_newssort")=yidacms_fenlei1(0)
			rs("shuaiweb_newssort2")=yidacms_fenlei1(1)
			rs("shuaiweb_vipnkeywords")=trim(request.form("shuaiweb_vipnkeywords"))
			rs("shuaiweb_vipndescription")=trim(request.form("shuaiweb_vipndescription"))
			rs("wait_neyi")=trim(request.form("wait_neyi"))
			rs("yida_language")="ch"
		rs.update
		rs.close
		set rs=nothing
		response.write "<script language=javascript> alert('成功添加！');location.replace('admin_newslist.asp');</script>"
		response.end
		End If
%>
		<form id="form1" name="form1" method="post" action="admin_newslistedit.asp?t=newsedit&id=<%=rs("id")%>">
		 <table width="98%" height="205" border="0" cellpadding="10" cellspacing="0" bordercolor="#666666" style="border-collapse:collapse" align="center">
                   <tr> 
                    <td>
                        <input type=button onclick="window.location.href('admin_newslist.asp')"value="返 回" class="inanniu">
                    </td>
                   </tr>
                   <tr>
			<td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">新闻栏目: <br />
<%
				set rs = server.createobject("adodb.recordset")
				sql="select * from shuaiweb_newsclass where wait_ncyi = '0'  ORDER BY shuaiweb_classsort ASC"
				rs.open sql,dbok,1,1
%>
					<select name="shuaiweb_newssort" id="shuaiweb_newssort" class="fenleiliebiao">
<%
				if rs.bof and rs.eof then
					response.write "暂无记录!"
						Else
				do while not rs.eof 
%>
		<optgroup label="<%=rs("shuaiweb_classname")%>">
<%
		set rss = server.createobject("adodb.recordset")
		sql="select * from shuaiweb_newsclass where wait_ncyi = '"&rs("id")&"' ORDER BY shuaiweb_classsort ASC"
		rss.open sql,dbok,1,1
		do while not rss.eof
%>
                <option value="<%=rss("id")%>|<%=rs("id")%>" <%if T_news = rss("id") then%>selected<%end if%>> ┝ <%=rss("shuaiweb_classname")%></option>
<%
                rss.movenext
                Loop
				rss.close
				set rss = nothing
				
				rs.MoveNext 
				loop   
				rs.close
				End If
		sql="select * from shuaiweb_news WHERE id= "&request("id")&""
		rs.open sql,dbok,1,1
        	T_newsse = rs("wait_neyi")
%>
						</select>
				</td>
                   </tr>
		  <tr>
			<td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc"><div class="uppic">标题<br /><input name="shuaiweb_newstitle" type="text" id="shuaiweb_newstitle" size="50"  class="win" value="<%=rs("shuaiweb_newstitle")%>"/></div><div class="uppic2">
	        <select name="wait_neyi" style=" width:80px; height:33px;">
                <option value="">无颜色</option>
                <option value="#000000" style="background:#000000" <%if T_newsse = "#000000" then response.write "selected" end if%>></option>
                <option value="#FF0000" style="background:#FF0000" <%if T_newsse = "#FF0000" then response.write "selected" end if%>></option>
                <option value="#009900" style="background:#009900" <%if T_newsse = "#009900" then response.write "selected" end if%>></option>
                <option value="#0066FF" style="background:#0066FF" <%if T_newsse = "#0066FF" then response.write "selected" end if%>></option>
                <option value="#00CCFF" style="background:#00CCFF" <%if T_newsse = "#00CCFF" then response.write "selected" end if%>></option>
                <option value="#FF6600" style="background:#FF6600" <%if T_newsse = "#FF6600" then response.write "selected" end if%>></option>
                <option value="#FF0066" style="background:#FF0066" <%if T_newsse = "#FF0066" then response.write "selected" end if%>></option>
                <option value="#FF3399" style="background:#FF3399" <%if T_newsse = "#FF3399" then response.write "selected" end if%>></option>
                <option value="#FFFF00" style="background:#FFFF00" <%if T_newsse = "#FFFF00" then response.write "selected" end if%>></option>
                <option value="#FF00FF" style="background:#FF00FF" <%if T_newsse = "#FF00FF" then response.write "selected" end if%>></option>
                <option value="#FF9933" style="background:#FF9933" <%if T_newsse = "#FF9933" then response.write "selected" end if%>></option>
                <option value="#FF99FF" style="background:#FF99FF" <%if T_newsse = "#FF99FF" then response.write "selected" end if%>></option>
                <option value="#CCCC66" style="background:#CCCC66" <%if T_newsse = "#CCCC66" then response.write "selected" end if%>></option>
                <option value="#0000FF" style="background:#0000FF" <%if T_newsse = "#0000FF" then response.write "selected" end if%>></option>
                </select><font color=red>(必填)</font></div></td>
		  </tr>
				<%
				set rs = server.createobject("adodb.recordset")
				sql="select * from shuaiweb_news WHERE id= "&yidacms_id&""
				rs.open sql,dbok,1,1
				%>

		  <tr>
			<td>来源<br /><input name="shuaiweb_newsSource" type="text" id="shuaiweb_newsSource" class="win" value="<%=rs("shuaiweb_newsSource")%>"/></td>
		  </tr>
		  <tr>
			<td>作者<br /><input name="shuaiweb_newsAuthor" type="text" id="shuaiweb_newsAuthor" class="win" value="<%=rs("shuaiweb_newsAuthor")%>"/></td>
		  </tr>
		  <tr>
			<td colspan="2" width="90%">内容<br /><textarea id="content1" name="shuaiweb_newsContent" style="width:100%;height:500px;"><%=rs("shuaiweb_newsContent")%></textarea><font color=red>(必填)</font></td>
		  </tr>
		  <tr>
			<td colspan="2"><input type="submit" name="Submit" value="提交" class="inanniu"/>
			  <input type="reset" name="Submit2" value="重置" class="inanniu"/> <input type=button onclick="window.location.href('admin_newslist.asp')"value="返 回" class="inanniu"></td>
		  </tr>
			<tr>
				<td>
<script>
 function showText(){
  if(document.getElementById("q").value==2){
   document.getElementById("text").innerHTML="<div style='padding:5px 5px 5px 5px; font-size:12px;'><input type='button' value='隐藏' onclick='hiddenText();' /><br /><br />网站标题 {sys:title} | 网站地址 {sys:weburl} | 公司标题 {sys:gongsibiaoti} | 公司地址 {sys:gongsidizhi}<br />联系电话 {sys:dianhua} | 移动电话 {sys:yidongdianhua} | 传真 {sys:chuanzhen} | QQ {sys:qq} | 联系人 {sys:lianxiren}<br />备案号 {sys:beian} | 邮箱 {sys:youxiang} | 邮编 {sys:youbian} </div>";
  } 
 }
 function hiddenText(){
  document.getElementById("text").innerHTML="";
 }
</script>
<select name="q" id="q" onchange="showText();">
 <option value="1">===查看可用标签===</option>
    <option value="2">基本标签</option>
</select>
<span id="text"></span>
				</td>
			</tr>
		</table>
		</form>
<%
rs.close
set rs = nothing
%>
</body>
</html>