⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 label_creat.asp

📁 后台目录:qwbAdmin/Login.asp 登陆用户名:admin 登陆密码:admin
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<% Option Explicit %>
<!--#include file="../../FS_Inc/Const.asp" -->
<!--#include file="../../FS_Inc/Function.asp"-->
<!--#include file="../../FS_Inc/md5.asp" -->
<!--#include file="../../FS_InterFace/MF_Function.asp" -->
<!--#include file="../../FS_InterFace/NS_Function.asp" -->
<!--#include file="../../FS_InterFace/HS_Function.asp" -->
<!--#include file="../../FS_InterFace/AP_Function.asp" -->
<!--#include file="../../FS_Inc/Cls_SysConfig.asp"-->
<%
	Response.Buffer = True
	Response.Expires = -1
	Response.ExpiresAbsolute = Now() - 1
	Response.Expires = 0
	Response.CacheControl = "no-cache"
	Dim Conn,obj_Label_Rs,SQL,strShowErr,str_CurrPath,sRootDir
	MF_Default_Conn
	'session判断
	MF_Session_TF 
	if not MF_Check_Pop_TF("MF025") then Err_Show
	Dim LableName,txt_Content,LableClassID,Labelclass_SQL,obj_Labelclass_rs,obj_Count_rs,isDel,tmps_LableName
	if G_VIRTUAL_ROOT_DIR<>"" then sRootDir="/"+G_VIRTUAL_ROOT_DIR else sRootDir=""
	If Session("Admin_Is_Super") = 1 then
		str_CurrPath = sRootDir &"/"&G_UP_FILES_DIR
	Else
		If Session("Admin_FilesTF") = 0 Then
			str_CurrPath = Replace(sRootDir &"/"&G_UP_FILES_DIR&"/adminfiles/"&UCase(md5(Session("Admin_Name"),16)),"//","/")
		Else
			str_CurrPath = sRootDir &"/"&G_UP_FILES_DIR
		End If	
	End if
	Rem 2007-07-25
	Dim Label_ConMaxNum,Sys_Obj
	Set Sys_Obj = New Cls_SysConfig
	Sys_Obj.getSysParam()
	Label_ConMaxNum = Sys_Obj.Label_MaxNum
	If Label_ConMaxNum = "" Or IsNull(Label_ConMaxNum) Then Label_ConMaxNum = 0
	Set Sys_Obj = NOthing
	Rem End
	
	LableClassID = NoSqlHack(Request.QueryString("LableClassID"))
	LableName = Trim(Request.Form("LableName"))
	txt_Content = Trim(Request.Form("TxtFileds"))
	isDel = Trim(Request.Form("isDel"))
	
	if Request.Form("Action") = "add_save" then
			if LableName ="" or txt_Content =""  then
				strShowErr = "<li>请填写完整</li>"
				Response.Redirect("../Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
				Response.end
			end if
			If Clng(Label_ConMaxNum) > 0 Then
				if len(txt_Content) > Clng(Label_ConMaxNum)  then
					strShowErr = "<li>标签内容不允许大于" & Clng(Label_ConMaxNum) & "个字符</li>"
					Response.Redirect("../Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
					Response.end
				end if
			End If	
			Labelclass_SQL = "Select LableName,LableContent,AddDate,LableClassID,isDel from FS_MF_Lable where LableName ='"& "{FS400_"&LableName&"}"&"'"
			Set obj_Labelclass_rs = server.CreateObject(G_FS_RS)
			obj_Labelclass_rs.Open Labelclass_SQL,Conn,1,3
			if obj_Labelclass_rs.eof then
				obj_Labelclass_rs.addnew
				obj_Labelclass_rs("LableName") = "{FS400_"& LableName &"}"
				obj_Labelclass_rs("LableContent") = txt_Content
				obj_Labelclass_rs("AddDate") =now
				if isDel<>"" then
					obj_Labelclass_rs("isDel") =1
				else
					obj_Labelclass_rs("isDel") =0
				end if
				obj_Labelclass_rs("LableClassID") =Request.Form("LableClassID")
				obj_Labelclass_rs.update
			else
				strShowErr = "<li>名称重复,请重新输入</li>"
				Response.Redirect("../Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
				Response.end
			end if
			obj_Labelclass_rs.close:set obj_Labelclass_rs =nothing
			strShowErr = "<li>添加成功</li><li><a href=Label/Label_Creat.asp>继续添加</a></li><li><a href=Label/All_Label_Stock.asp?classid="&Request.Form("LableClassID")&">返回标签管理</a></li>"
			Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=Label/Label_Creat.asp")
			Response.end
	elseif Request.Form("Action") = "edit_save" then
			dim rstf
			tmps_LableName="{FS400_"&LableName&"}"
			Set rstf = Conn.execute("Select LableName,LableContent,AddDate,LableClassID,isDel from FS_MF_Lable where LableName ='"& tmps_LableName &"' and id <>"& NosqlHack(Request.Form("ID")))
			if not rstf.eof then
				strShowErr = "<li>名称重复,请重新输入</li>"
				Response.Redirect("../Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
				Response.end
			end if
			If Clng(Label_ConMaxNum) > 0 Then
				if len(txt_Content) > Clng(Label_ConMaxNum)  then
					strShowErr = "<li>标签内容不允许大于" & Clng(Label_ConMaxNum) & "个字符</li>"
					Response.Redirect("../Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
					Response.end
				end if
			End If	
			Labelclass_SQL = "Select id,isDel,LableName,LableContent,AddDate,LableClassID from FS_MF_Lable where id ="& NosqlHack(Request.Form("ID")) 
			Set obj_Labelclass_rs = server.CreateObject(G_FS_RS)
			obj_Labelclass_rs.Open Labelclass_SQL,Conn,1,3
			if not obj_Labelclass_rs.eof then
				obj_Labelclass_rs("LableName") = "{FS400_"& LableName &"}"
				obj_Labelclass_rs("LableContent") = txt_Content
				obj_Labelclass_rs("AddDate") =now
				if isDel<>"" then
					obj_Labelclass_rs("isDel") =1
				else
					obj_Labelclass_rs("isDel") =0
				end if
				obj_Labelclass_rs("LableClassID") =Request.Form("LableClassID")
				obj_Labelclass_rs.update
				obj_Labelclass_rs.close:set obj_Labelclass_rs =nothing
			else
				obj_Labelclass_rs.close:set obj_Labelclass_rs =nothing
				strShowErr = "<li>错误的参数</li>"
				Response.Redirect("../Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
				Response.end
			end if
			strShowErr = "<li>修改成功</li>"
			Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=Label/all_Label_Stock.asp")
			Response.end
	end if
	if Request.QueryString("DelTF")="1" then
		Conn.execute("Delete From FS_MF_Labestyle where StyleType='"& Request.QueryString("Label_Sub")&"' and id="&NoSqlHack(Request.QueryString("id")))
		strShowErr = "<li>删除成功</li>"
		Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=Label/All_Label_style.asp?Label_Sub="& Request.Form("Label_Sub")&"")
		Response.end
	end if
	dim tmp_LableName,tmp_LableClassID,tmp_LableContent,tmp_isDel,tmp_id,tmp_action
	if Request.QueryString("type")="edit" then
		dim rs
		if not isnumeric(Request.QueryString("id")) then
			strShowErr = "<li>错误的参数</li>"
			Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
			Response.end
		end if
		set rs = Conn.execute("select id,LableName,LableClassID,LableContent,isDel From FS_MF_Lable where id="&Request.QueryString("id"))
		if rs.eof then
			rs.close:set rs=nothing
			strShowErr = "<li>错误的参数</li>"
			Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
			Response.end
		else
			tmp_LableName=Replace(Replace(rs("LableName"),"{FS400_",""),"}","")
			tmp_LableClassID=rs("LableClassID")
			tmp_LableContent=rs("LableContent")
			tmp_isDel=rs("isDel")
			tmp_id = rs("id")
			tmp_action = "edit_save"
		end if
	else
			tmp_action = "add_save"
	end if
%>
<html>
<head>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -