task = request.QueryString("task")
if task <> session("admin_rights") or task = "" then
response.Write "<center style='font-size: 10.5pt; line-height: 20px;'>错误:非法的管理操作<br><a href='JavaScript:window.close()'>关闭窗口</a></center>"
response.End
end if
task = cint(task)
action = request.QueryString("action")
if action = "" then
response.Write "<center style='font-size: 10.5pt; line-height: 20px;'>错误:非法的管理操作<br><a href='JavaScript:window.close()'>关闭窗口</a></center>"
response.End
end if
select case task
'case 1 task select
case 0
'0 新闻 manage
select case action
'case 2 action select
case "import"
'Save News
dim news_topic
dim news_subject
dim news_source
dim news_author
dim news_type
dim news_content
'1 topic import
news_topic = request.Form("news_topic")
if news_topic = "" then
response.Write "<center style='font-size: 10.5pt; line-height: 20px;'>错误:新闻标题没有数据<br><a href='JavaScript:history.go(-1)'>返回上一页</a></center>"
response.End
end if
'2 subject import
news_subject = request.Form("news_subject")
if news_subject = "" then news_subject = "Null"
'3 source improt
news_source = request.Form("news_source")
if news_source = "" then news_source = "Null"
'4 author import
news_author = request.Form("news_author")
if news_author = "" then news_author = "Null"
'5 type import
news_type = request.Form("news_type")
if news_type = "" or new_type = "Null" then
response.Write "<center style='font-size: 10.5pt; line-height: 20px;'>错误:新闻类型没有数据<br><a href='JavaScript:history.go(-1)'>返回上一页</a></center>"
response.End
end if
'6 content import
news_content = request.Form("news_content")
if news_content = "" then
response.Write "<center style='font-size: 10.5pt; line-height: 20px;'>错误:新闻内容没有数据<br><a href='JavaScript:history.go(-1)'>返回上一页</a></center>"
response.End
end if
news_content = Replace(news_content,vbcrlf,"<br>")%>
<!-- #include file='../news/database.inc' -->
<%
sql = "insert into HanagaNewsTable ( subject,topic,content,type,create_date,source,author ) values ( " & sqlStr(news_subject) & "," & sqlStr(news_topic) & "," & sqlStr(news_content) & "," & sqlStr(news_type) & ",'" & Date() & "'," & sqlStr(news_source) & "," & sqlStr(news_author) & ")"
conn.Execute sql
conn.Close
response.Write "<center style='font-size: 10.5pt; line-height: 20px;'>新闻录入完成<br><a href='manage.asp?task=0'>继续录入</a></center>"
response.End
case "delete"
id = request.QueryString("id")
if id = "" then
response.Write "<center style='font-size: 10.5pt; line-height: 20px;'>错误:没有可删除对象<br><a href='JavaScript:history.go(-1)'>返回上一页</a></center>"
response.End
end if
id = cint(id)%>
<!-- #include file='../news/database.inc' -->
<%
sql = "select id from HanagaNewsTable where id=" & id
set rootRs = conn.Execute(sql)
if rootRs.Bof or rootRs.Eof then
conn.Close
response.Write "<center style='font-size: 10.5pt; line-height: 20px;'>错误:没有可删除对象<br><a href='JavaScript:history.go(-1)'>返回上一页</a></center>"
response.End
end if
sql = "delete * from HanagaNewsTable where id=" & id
conn.Execute sql
conn.Close
response.Write "<center style='font-size: 10.5pt; line-height: 20px;'>新闻删除完成<br><a href='manage.asp?task=0&action=delete'>继续删除</a></center>"
response.End
end select
case 6
'6 国宝精粹 manage
select case action
'case 2 action select
case "import"
'Save Item
dim item_name
dim item_sort_a
dim item_sort_b
dim item_time_a
dim item_time_b
dim item_id
dim item_style
dim item_remark
'1 name import
item_name = request.Form("item_name")
if item_name = "" then
response.Write "<center style='font-size: 10.5pt; line-height: 20px;'>错误:物品名称没有数据<br><a href='JavaScript:history.go(-1)'>返回上一页</a></center>"
response.End
end if
'2 sort a and b import
item_sort_a = request.Form("item_sort_a")
if item_sort_a = "" then
response.Write "<center style='font-size: 10.5pt; line-height: 20px;'>错误:物品类别A没有数据<br><a href='JavaScript:history.go(-1)'>返回上一页</a></center>"
response.End
end if
item_sort_b = request.Form("item_sort_b")
if item_sort_b = "" then item_sort_b = "Null"
'3 time a and b improt
item_time_a = request.Form("item_time_a")
if item_time_a = "" then
response.Write "<center style='font-size: 10.5pt; line-height: 20px;'>错误:物品年代A没有数据<br><a href='JavaScript:history.go(-1)'>返回上一页</a></center>"
response.End
end if
item_time_b = request.Form("item_time_b")
if item_time_b = "" then item_time_b = "Null"
'4 id import
item_id = request.Form("item_id")
if item_id = "" then
response.Write "<center style='font-size: 10.5pt; line-height: 20px;'>错误:物品ID没有数据<br><a href='JavaScript:history.go(-1)'>返回上一页</a></center>"
response.End
end if
'5 type import
item_style = request.Form("item_style")
if item_style = "" then item_style = "Null"
'6 content import
item_remark = request.Form("item_remark")
if item_remark = "" then
response.Write "<center style='font-size: 10.5pt; line-height: 20px;'>错误:物品描述没有数据<br><a href='JavaScript:history.go(-1)'>返回上一页</a></center>"
response.End
end if
item_remark = Replace(item_remark,vbcrlf,"<br>")%>
<!-- #include file='../search/database.inc' -->
<%
sql = "insert into HanagaSearchTable ( genus_a,genus_b,dynasty_a,dynasty_b,apellation_a,apellation_b,describe,item_id ) values ( " & sqlStr(item_sort_a) & "," & sqlStr(item_sort_b) & "," & sqlStr(item_time_a) & "," & sqlStr(item_time_b) & "," & sqlStr(item_style) & "," & sqlStr(item_name) & "," & sqlStr(item_remark) & "," & sqlStr(item_id) & " )"
conn.Execute sql
conn.Close
response.Write "<center style='font-size: 10.5pt; line-height: 20px;'>物品录入完成<br><a href='manage.asp?task=6'>继续录入</a></center>"
response.End
case "delete"
id = request.QueryString("id")
if id = "" then
response.Write "<center style='font-size: 10.5pt; line-height: 20px;'>错误:没有可删除对象<br><a href='JavaScript:history.go(-1)'>返回上一页</a></center>"
response.End
end if
id = cint(id)%>
<!-- #include file='../search/database.inc' -->
<%
sql = "select id from HanagaSearchTable where id=" & id
set rootRs = conn.Execute(sql)
if rootRs.Bof or rootRs.Eof then
conn.Close
response.Write "<center style='font-size: 10.5pt; line-height: 20px;'>错误:没有可删除对象<br><a href='JavaScript:history.go(-1)'>返回上一页</a></center>"
response.End
end if
sql = "delete * from HanagaSearchTable where id=" & id
conn.Execute sql
conn.Close
response.Write "<center style='font-size: 10.5pt; line-height: 20px;'>物品删除完成<br><a href='manage.asp?task=0&action=delete'>继续删除</a></center>"
response.End
end select
case 7
'7 文物壁纸 manage
select case action
'case 2 action select
case "import"
'Save Wallpaper
dim wallpaper_name
dim wallpaper_size
dim wallpaper_format
dim wallpaper_id
dim wallpaper_sort
'1 topic import
wallpaper_name = request.Form("wallpaper_name")
if wallpaper_name = "" then
response.Write "<center style='font-size: 10.5pt; line-height: 20px;'>错误:壁纸名称没有数据<br><a href='JavaScript:history.go(-1)'>返回上一页</a></center>"
response.End
end if
'2 subject import
wallpaper_size = request.Form("wallpaper_size")
if wallpaper_size = "" then
response.Write "<center style='font-size: 10.5pt; line-height: 20px;'>错误:壁纸大小没有数据<br><a href='JavaScript:history.go(-1)'>返回上一页</a></center>"
response.End
end if
'3 source improt
wallpaper_format = request.Form("wallpaper_format")
if wallpaper_format = "" then wallpaper_format = "Null"
'4 author import
wallpaper_id = request.Form("wallpaper_id")
if wallpaper_id = "" then
response.Write "<center style='font-size: 10.5pt; line-height: 20px;'>错误:壁纸ID没有数据<br><a href='JavaScript:history.go(-1)'>返回上一页</a></center>"
response.End
end if
'5 type import
wallpaper_sort = request.Form("wallpaper_sort")
if wallpaper_sort = "" then
response.Write "<center style='font-size: 10.5pt; line-height: 20px;'>错误:壁纸分类没有数据<br><a href='JavaScript:history.go(-1)'>返回上一页</a></center>"
response.End
end if%>
<!-- #include file='../entertainment/wallpaper/database.inc' -->
<%
sql = "insert into HanagaWallpaperTable ( wallpaper_name,wallpaper_size,wallpaper_format,wallpaper_id,wallpaper_sort,update_time ) values ( " & sqlStr(wallpaper_name) & "," & sqlStr(wallpaper_size) & "," & sqlStr(wallpaper_format) & "," & sqlStr(wallpaper_id) & "," & sqlStr(wallpaper_sort) & "," & sqlStr(Date()) & ")"
conn.Execute sql
conn.Close
response.Write "<center style='font-size: 10.5pt; line-height: 20px;'>壁纸录入完成<br><a href='manage.asp?task=7'>继续录入</a></center>"
response.End
end select
end select
response.End
'Sub and Function
function sqlStr(data)
sqlStr = Replace(data,"<","<")
sqlStr = Replace(data,">",">")
sqlStr = "'" & Replace(data, "'", "''" ) & "'"
end function
%>