<!--#include file="../Include/Config.asp"-->
<!--#include file="../Include/MD5.asp"-->
<!--#include file="../Include/Callings.asp"-->
<!--#include file="../Include/Function.asp"-->
<!--#include file="Include/Check.asp"-->
<%
sysID=Request_QueryString("id")
action=Request_QueryString("action")


'///////////////////////////////////////////////////////	设 置	////////////////////////////////////////////////////////

If action="sysSet" then
	Web_Logo1 = sub_str(Trim(request_Form("Web_Logo1")),"Upload")		'原LOGO
	Web_Logo = sub_str(Trim(request_Form("Web_Logo")),"Upload")			'当前LOGO
	If Web_Logo<>Web_Logo1 Then FileDeleting(sub_stra(Web_Logo1,"Upload"))	'判断LOGO是否被替换，替换了则删除原LOGO图片
	Set Rs=server.createobject("adodb.recordSet")
	Sql="select top 1 * from Jin_Config"
	Rs.open Sql,conn,1,3
	Rs("Web_Title")=request_Form("Web_Title")
	Rs("Web_URL")=request_Form("Web_URL")
	Rs("Web_Name")=request_Form("Web_Name")
	Rs("Web_Info")=request_Form("Web_Info")
	Rs("Web_Logo")=Web_Logo
	Rs("Web_Keyword")=request_Form("Web_Keyword")
	Rs("Web_Author")=request_Form("Web_Author")
	Rs("Web_Switch")=request_Form("Web_Switch")
	Rs("Web_CloseReason")=request_Form("Web_CloseReason")
	Rs("Web_IsHtml")=request_Form("Web_IsHtml")
	Rs("Web_Lang")=replace(replace(replace(request_Form("Web_Lang"),"，",",")," ",","),"|",",")
	Rs("Web_Style")=request_Form("Web_Style")
	Rs("Web_Description")=request_Form("Web_Description")
	Rs("Web_Foottext")=request_Form("Web_Foottext")
	Rs.Update
	Rs.close
	Set Rs=nothing
	'Call alertgo("设置成功！")
	response.Write "{""info"":""保存成功！"",""status"":""y""}"
End If
If action="sysSet1" then
	Set Rs=server.createobject("adodb.recordSet")
	Sql="select top 1 * from Jin_Config"
	Rs.open Sql,conn,1,3
	Rs("Web_EditorType")=request_Form("Web_EditorType")
	Rs("Web_PageType")=request_Form("Web_PageType")
	Rs("Web_PageNum")=request_Form("Web_PageNum")
	Rs("Web_CommentReply")=request_Form("Web_CommentReply")
	Rs.Update
	Rs.close
	Set Rs=nothing
	response.Write "{""info"":""保存成功！"",""status"":""y""}"
End If

if action="adminadd" then
	conn.execute "insert into [Jin_Admin] (AdminID,AdminName,AdminPwd) values ('"&request_Form("AdminID")&"','"&request_Form("AdminName")&"','"&MD5(request_Form("AdminPwd"))&"')"
	'call alertgo1("添加成功！","AdminSet.asp")
	response.Write "{""info"":""管理添加成功！"",""status"":""y""}"
end if
if action="adminedit" then
	dim Admin_ID,Admin_Name,Admin_PwdOld,Admin_Pwd
	Admin_ID=request_Form("AdminID")		'用户账号
	Admin_Name=request_Form("AdminName")	'用户姓名
	Admin_PwdOld=request_Form("AdminPwdOld")		'用户原密码
	Admin_Pwd=request_Form("AdminPwd")		'用户新密码
	If Admin_Pwd<>"" Then Admin_PwdNew=Admin_Pwd else Admin_PwdNew=Admin_PwdOld
	
	Set Rs = Server.CreateObject("ADODB.RecordSet")
	Sql="select * from Jin_Admin where AdminID='"&Admin_ID&"' and AdminPwd='"&MD5(Admin_PwdOld)&"' "
	Rs.open Sql,conn,1,3
	If Rs.RecordCount>0 Then
	Rs("AdminName")=request_Form("AdminName")
	Rs("AdminPwd")=MD5(Admin_PwdNew)
	Rs.update
	'call alertgo1("修改成功！\n请下次登陆时使用新密码登录！","AdminSet.asp")
	response.Write "{""info"":""修改成功！"",""status"":""y""}"
	Else
	'call alertgo("密码验证失败！")
	response.Write "{""info"":""密码验证失败！"",""status"":""y""}"
	End If
	Rs.close
	Set Rs=nothing
end if


'///////////////////////////////////////////////////////	文 章	////////////////////////////////////////////////////////
'添加文章
If action="wz_add" then
	Pic = sub_str(Trim(request_Form("Pic")),"Upload")
	Set Rs=server.createobject("adodb.recordSet")
	Sql="select * from Jin_Article"
	Rs.open Sql,conn,1,3
	Rs.Addnew
	Rs("Title")=request_Form("Title")
	Rs("Pid")=request_Form("Pid")
	Rs("Openness")=request_Form("Openness")	'公开度
	Rs("fwPwd")=request_Form("fwPwd")		'访问密码
	Rs("Author")=request_Form("Author")
	Rs("From")=request_Form("From")
	Rs("PageName")=request_Form("PageName")
	Rs("Pic")=Pic
	Rs("Link")=request_Form("Link")
	Rs("Keywords")=replace(replace(request_Form("Keywords"),"，",",")," ",",")
	Rs("Descriptions")=request_Form("Descriptions")
	Rs("Content")=request_Form("Content")
	Rs("Addtime")=Now()
	Rs.Update
	Rs.close
	Set Rs=nothing
	response.Write "{""info"":""文章发布成功"",""status"":""y""}"
	
	'生成略缩图
	'If Pic<>"" and Web_IsCreatMiniPic then Call CreateLst(sub_stra(Pic,"Upload"),Web_ArticlePicFile,Web_ArticleMiniWidth,Web_ArticleMiniHeight)
	
	'response.Redirect session("ArticlePage")	'返回列表页
	
End If
'修改文章
If action="wz_edit" then
	Pic = sub_str(Trim(request_Form("Pic")),"Upload")
	Set Rs=server.createobject("adodb.recordSet")
	Sql="select * from Jin_Article where sysID="&sysID
	Rs.open Sql,conn,1,3
	Rs("Title")=request_Form("Title")
	Rs("Pid")=request_Form("Pid")
	Rs("Openness")=request_Form("Openness")	'公开度
	Rs("fwPwd")=request_Form("fwPwd")		'访问密码
	Rs("Author")=request_Form("Author")
	Rs("From")=request_Form("From")
	Rs("PageName")=request_Form("PageName")
	Rs("Pic")=Pic
	Rs("Link")=request_Form("Link")
	Rs("Keywords")=replace(replace(request_Form("Keywords"),"，",",")," ",",")
	Rs("Descriptions")=request_Form("Descriptions")
	Rs("Content")=request_Form("Content")
	Rs("EditTime")=Now()
	Rs("EditNum")=Rs("EditNum")+1
	Rs.Update
	Rs.close
	Set Rs=nothing
	response.Write "{""info"":""文章修改成功"",""status"":""y""}"
			
	'生成略缩图
	'If Pic<>"" and Web_IsCreatMiniPic then Call CreateLst(sub_stra(Pic,"Upload"),Web_ArticlePicFile,Web_ArticleMiniWidth,Web_ArticleMiniHeight)
	
	'Call alertgo("修改成功！")
	'response.Redirect session("ArticlePage")	'返回列表页
	
	'Response.Write ("<script language=javascript>window.location=document.referrer;<//script>")
End If


'///////////////////////////////////////////////////////	相 册	////////////////////////////////////////////////////////
'创建相册
If action="AddAlbums" then
	Set Rs=server.createobject("adodb.recordSet")
	Sql="select * from Jin_Album"
	Rs.open Sql,conn,1,3
	Rs.Addnew
	Rs("Pid")=request_Form("Pid")
	Rs("Title")=request_Form("Title")
	Rs("Content")=request_Form("Content")
	Rs("IsShow")=request_Form("IsShow")
	Rs("BuildTime")=Now()
	Rs.Update
	Rs.close
	Set Rs=nothing
	response.Write "{""info"":""相册添加成功！"",""status"":""y""}"
End If
'修改相册
If action="EditAlbums" then
	Set Rs=server.createobject("adodb.recordSet")
	Sql="select * from Jin_Album where sysID="&sysID&""
	Rs.open Sql,conn,1,3
	Rs("Pid")=request_Form("Pid")
	Rs("Title")=request_Form("Title")
	Rs("Content")=request_Form("Content")
	Rs("IsShow")=request_Form("IsShow")
	Rs.Update
	Rs.close
	Set Rs=nothing
	response.Write "{""info"":""相册修改成功！"",""status"":""y""}"
End If
'添加相片
If action="AddPhoto" then
	Bianhao=get_num("Jin_Photos","Bianhao","PIC")
	Set Rs=server.createobject("adodb.recordSet")
	Sql="select * from Jin_Photos"
	Rs.open Sql,conn,1,3
	Rs.Addnew
	Rs("Bianhao")=Bianhao
	Rs("Pid")=request_Form("Pid")
	Rs("Title")=request_Form("Title")
	Rs("Author")=request_Form("Author")
	Rs("Content")=request_Form("Content")
	Rs("AddTime")=Now()
	Rs.Update
	Rs.close
	Set Rs=nothing
	response.Write "{""info"":""相片添加成功！"",""status"":""y""}"
End If
'修改相片
If action="EditPhoto" then
	Set Rs=server.createobject("adodb.recordSet")
	Sql="select * from Jin_Photos where sysID="&sysID&""
	Rs.open Sql,conn,1,3
	Rs("Pid")=request_Form("Pid")
	Rs("Title")=request_Form("Title")
	Rs("Author")=request_Form("Author")
	Rs("Content")=request_Form("Content")
	Rs("EditNum")=Rs("EditNum")+1
	Rs("EditTime")=Now()
	Rs.Update
	Rs.close
	Set Rs=nothing
	response.Write "{""info"":""相片信息修改成功！"",""status"":""y""}"
End If




'///////////////////////////////////////////////////////	单 页	////////////////////////////////////////////////////////
'新增单页
If action="pageadd" then
	PageBg = sub_str(Trim(request_Form("PageBg")),"Upload")
	PageImg = sub_str(Trim(request_Form("PageImg")),"Upload")
	PageImg_a = sub_str(Trim(request_Form("PageImg_a")),"Upload")
	PageImg_b = sub_str(Trim(request_Form("PageImg_b")),"Upload")
	Set Rs=server.createobject("adodb.recordSet")
	Sql="select * from Jin_Page"
	Rs.open Sql,conn,1,3
	Rs.Addnew
	Rs("PageID")=0
	Rs("PageName")=request_Form("PageName")
	Rs("PageTitle")=request_Form("PageTitle")
	Rs("PageTitle_a")=request_Form("PageTitle_a")
	Rs("PageBg")=PageBg
	Rs("PageImg")=PageImg
	Rs("PageImg_a")=PageImg_a
	Rs("PageImg_b")=PageImg_b
	Rs("PageVideo")=request_Form("PageVideo")
	Rs("PageContent")=request_Form("Content")
	Rs("PageContent_a")=request_Form("PageContent_a")
	Rs("PageContent_b")=request_Form("PageContent_b")
	Rs("PageContent_c")=request_Form("PageContent_c")
	Rs("Keywords")=replace(replace(request_Form("Keywords"),"，",",")," ",",")
	Rs("Descriptions")=request_Form("Descriptions")
	Rs("Remark")=request_Form("Remark")
	Rs("Addtime")=Now()
	Rs.Update
	Rs.close
	Set Rs=nothing
	response.Write "{""info"":""单页添加成功"",""status"":""y""}"
End If
'修改单页信息
If action="pageedit" then
	PageBg = sub_str(Trim(request_Form("PageBg")),"Upload")
	PageImg = sub_str(Trim(request_Form("PageImg")),"Upload")
	PageImg_a = sub_str(Trim(request_Form("PageImg_a")),"Upload")
	PageImg_b = sub_str(Trim(request_Form("PageImg_b")),"Upload")
	Set Rs=server.createobject("adodb.recordSet")
	Sql="select * from Jin_Page where SysID="&request.QueryString("SysID")
	Rs.open Sql,conn,1,3
	Rs("PageName")=request_Form("PageName")
	Rs("PageTitle")=request_Form("PageTitle")
	Rs("PageTitle_a")=request_Form("PageTitle_a")
	Rs("PageBg")=PageBg
	Rs("PageImg")=PageImg
	Rs("PageImg_a")=PageImg_a
	Rs("PageImg_b")=PageImg_b
	Rs("PageVideo")=request_Form("PageVideo")
	Rs("PageContent")=request_Form("Content")
	Rs("PageContent_a")=request_Form("PageContent_a")
	Rs("PageContent_b")=request_Form("PageContent_b")
	Rs("PageContent_c")=request_Form("PageContent_c")
	Rs("Keywords")=replace(replace(request_Form("Keywords"),"，",",")," ",",")
	Rs("Descriptions")=request_Form("Descriptions")
	Rs("Remark")=request_Form("Remark")
	Rs("Edittime")=Now()
	Rs("Editnum")=Rs("Editnum")+1
	Rs.Update
	Rs.close
	Set Rs=nothing
	response.Write "{""info"":""单页修改成功"",""status"":""y""}"
End If




'///////////////////////////////////////////////////////	Flash	////////////////////////////////////////////////////////

'添加图片
If action="addFlash" then
	Pic = sub_str(Trim(request_Form("Pic")),"Upload")
	Set Rs=server.createobject("adodb.recordSet")
	Sql="select * from Jin_Flash"
	Rs.open Sql,conn,1,3
	Rs.Addnew
	Rs("Pid")=request_Form("Pid")
	Rs("Title")=request_Form("Title")
	Rs("Pic")=Pic
	Rs("Url")=request_Form("Url")
	Rs("Remark")=request_Form("Remark")
	Rs("Addtime")=Now()
	Rs.Update
	Rs.close
	Set Rs=nothing
	response.Write "{""info"":""添加成功"",""status"":""y""}"
	'Call alertgo("添加成功！")
End If
'修改图片
If action="editFlash" then
	Pic = sub_str(request_Form("Pic"),"Upload")
	Set Rs=server.createobject("adodb.recordSet")
	Sql="select * from Jin_Flash where sysID="&request.QueryString("id")
	Rs.open Sql,conn,1,3
	Rs("Pid")=request_Form("Pid")
	Rs("Title")=request_Form("Title")
	Rs("Pic")=Pic
	Rs("Url")=request_Form("Url")
	Rs("Remark")=request_Form("Remark")
	Rs("Editnum")=Rs("Editnum")+1
	Rs("Edittime")=Now()
	Rs.Update
	Rs.close
	Set Rs=nothing
	response.Write "{""info"":""修改成功"",""status"":""y""}"
	'Call alertgo("修改成功！")
End If




'///////////////////////////////////////////////////////	Flash	////////////////////////////////////////////////////////
'添加友链
If action="addLink" then
	LinkLogo = sub_str(Trim(request_Form("LinkLogo")),"Upload")
	Set Rs=server.createobject("adodb.recordSet")
	Sql="select * from Jin_Links"
	Rs.open Sql,conn,1,3
	Rs.Addnew
	Rs("Pid")=request_Form("Pid")
	Rs("LinkName")=request_Form("LinkName")
	Rs("LinkLogo")=LinkLogo
	Rs("LinkUrl")=request_Form("LinkUrl")
	Rs("LinkInfo")=request_Form("LinkInfo")
	Rs("Addtime")=Now()
	Rs.Update
	Rs.close
	Set Rs=nothing
	response.Write "{""info"":""添加成功"",""status"":""y""}"
End If
'修改友链
If action="editLink" then
	LinkLogo = sub_str(Trim(request_Form("LinkLogo")),"Upload")
	Set Rs=server.createobject("adodb.recordSet")
	Sql="select * from Jin_Links where sysID="&request.QueryString("id")
	Rs.open Sql,conn,1,3
	Rs("Pid")=request_Form("Pid")
	Rs("LinkName")=request_Form("LinkName")
	Rs("LinkLogo")=LinkLogo
	Rs("LinkUrl")=request_Form("LinkUrl")
	Rs("LinkInfo")=request_Form("LinkInfo")
	Rs("Editnum")=Rs("Editnum")+1
	Rs("Edittime")=Now()
	Rs.Update
	Rs.close
	Set Rs=nothing
	response.Write "{""info"":""修改成功"",""status"":""y""}"
End If




'///////////////////////////////////////////////////////	下 载	////////////////////////////////////////////////////////

'添加下载
If action="addDown" then
	Pic = sub_str(Trim(request_Form("Pic")),"Upload")
	Filestr = sub_str(Trim(request_Form("Filestr")),"Upload")
	Set Rs=server.createobject("adodb.recordSet")
	Sql="select * from Jin_DownLoad"
	Rs.open Sql,conn,1,3
	Rs.Addnew
	Rs("Title")=request_Form("Title")
	Rs("Pic")=Pic
	Rs("Filestr")=Filestr
	Rs("Url")=request_Form("Url")
	Rs("Url_a")=request_Form("Url_a")
	Rs("Url_b")=request_Form("Url_b")
	Rs("Url_c")=request_Form("Url_c")
	Rs("Content")=request_Form("Content")
	Rs("Addtime")=Now()
	Rs.Update
	Rs.close
	Set Rs=nothing
	response.Write "{""info"":""添加成功"",""status"":""y""}"
End If
'修改下载
If action="editDown" then
	Pic = sub_str(Trim(request_Form("Pic")),"Upload")
	Filestr = sub_str(Trim(request_Form("Filestr")),"Upload")
	Set Rs=server.createobject("adodb.recordSet")
	Sql="select * from Jin_DownLoad where sysID="&request.QueryString("id")
	Rs.open Sql,conn,1,3
	Rs("Title")=request_Form("Title")
	Rs("Pic")=Pic
	Rs("Filestr")=Filestr
	Rs("Url")=request_Form("Url")
	Rs("Url_a")=request_Form("Url_a")
	Rs("Url_b")=request_Form("Url_b")
	Rs("Url_c")=request_Form("Url_c")
	Rs("Content")=request_Form("Content")
	Rs("Editnum")=Rs("Editnum")+1
	Rs("Edittime")=Now()
	Rs.Update
	Rs.close
	Set Rs=nothing
	response.Write "{""info"":""修改成功"",""status"":""y""}"
End If


%>
