📄 addfreetwo.asp
字号:
<% 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="FieldsArr.asp" -->
<%
'========================================================
'系统设置
'========================================================
Dim Conn,strShowErr
MF_Default_Conn
MF_Session_TF
If Not MF_Check_Pop_TF("MF_sPublic") Then Err_Show
Dim sRootDir,str_CurrPath
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
'====================================================
'获取从第一步提交的内容
'====================================================
Dim LabelName,Label_DesStr,LabelID,ActStr,LabelType,NS_TableName,NC_TableName,Select_num
Dim Sql_ConStr,Ns_FieldsStr,Nc_fieldsStr,Str_Lable_ConStr,Lable_Sql_Str
Dim Auto_Fields_Str,Auto_Str_N,Auto_Str_C,LNameStr,CheckNameRs,Auto_Str_DA
Dim Dis_AllFields
Dim Lable_Content
Dim InfoTitle,InfoType,InfoContent,ReturnUrl
Dim AddRs,AddSql
ActStr = Request.Form("To_Act")
If ActStr = "Add" Then
LabelID = ""
Label_DesStr = ""
Str_Lable_ConStr = ""
ElseIf ActStr = "Edit" Then
LabelID = Request.Form("LabelID")
Label_DesStr = Request.Form("Label_Des")
Str_Lable_ConStr = Request.Form("Lable_ConStr")
End If
LabelName = "FS400_" & Request.Form("LabelName")
LabelType = Request.Form("SysType")
NS_TableName = Request.Form("NTable")
NC_TableName = Request.Form("CTable")
Select_num = Request.Form("SelectNum")
Sql_ConStr = ReplaceMidFildes(Request.Form("DisSql"))
Ns_FieldsStr =ReplaceMidFildes(Request.Form("Fist_TF_All"))
Nc_fieldsStr = ReplaceMidFildes(Request.Form("Sec_TF_All"))
If LabelType = "NS" Then
Auto_Str_N = "<span style=""cursor:hand;"" onclick=""InsertToHTMl('[#NewsUrl#]')"">[新闻浏览地址]</span>"
Auto_Str_C = "<span style=""cursor:hand;"" onclick=""InsertToHTMl('[#NewsClassUrl#]')"">[栏目浏览地址]</span>"
Auto_Str_DA = ""
ElseIf LabelType = "DS" Then
Auto_Str_N = "<span style=""cursor:hand;"" onclick=""InsertToHTMl('[#DownUrl#]')"">[下载浏览地址]</span>"
Auto_Str_C = "<span style=""cursor:hand;"" onclick=""InsertToHTMl('[#DownClassUrl#]')"">[栏目浏览地址]</span>"
Auto_Str_DA = "<span style=""cursor:hand;"" onclick=""InsertToHTMl('[#DownAddress#]')"">[软件下载地址]</span>"
ElseIf LabelType = "MS" Then
Auto_Str_N = "<span style=""cursor:hand;"" onclick=""InsertToHTMl('[#MallUrl#]')"">[商品浏览地址]</span>"
Auto_Str_C = "<span style=""cursor:hand;"" onclick=""InsertToHTMl('[#MallClassUrl#]')"">[栏目浏览地址]</span>"
Auto_Str_DA = ""
End If
If Ns_FieldsStr <> "" Then
If LabelType = "DS" Then
Auto_Fields_Str = Auto_Str_N & " ┆ " & Auto_Str_DA
Else
Auto_Fields_Str = Auto_Str_N
End If
Else
Auto_Fields_Str = ""
End If
If Nc_fieldsStr <> "" Then
If Auto_Fields_Str <> "" Then
Auto_Fields_Str = Auto_Fields_Str & " ┆ " & Auto_Str_C
Else
Auto_Fields_Str = Auto_Str_C
End If
Else
Auto_Fields_Str = Auto_Fields_Str & ""
End If
If Ns_FieldsStr <> "" And Nc_fieldsStr <> "" Then
Dis_AllFields = GetLeftSeFields(Ns_FieldsStr,"And",LabelType) & " ┆ " & GetRightSeFields(Nc_fieldsStr,"And",LabelType)
ElseIf Ns_FieldsStr <> "" And Nc_fieldsStr = "" Then
Dis_AllFields = GetLeftSeFields(Ns_FieldsStr,"No",LabelType)
ElseIf Ns_FieldsStr = "" And Nc_fieldsStr <> "" Then
Dis_AllFields = GetRightSeFields(Nc_fieldsStr,"No",LabelType)
Else
Dis_AllFields = ""
End If
'====================================================
'将包含有mid或者substring的字段中的,替换成*
'====================================================
Function ReplaceMidFildes(SqlStr)
Dim Str_Sql,FlagSql,FormBack,InstrMidStr,ReplaceMidStr,LeftStr
Dim Mid_arr,Mid_i
Str_Sql = SqlStr & ""
IF Instr(Str_Sql,"From") > 0 Then
FlagSql = Trim(Split(Str_Sql,"From")(0))
FormBack = " From " & Trim(Split(Str_Sql,"From")(1))
Else
FlagSql = Trim(Str_Sql)
FormBack = ""
End If
IF Instr(FlagSql,GetStrFun) <> 0 Then
Mid_arr = Split(FlagSql,GetStrFun)
For Mid_i = 1 To UBound(Mid_arr)
InstrMidStr = Trim(Mid_arr(Mid_i))
LeftStr = Trim(Split(InstrMidStr,")")(0))
ReplaceMidStr = Replace(LeftStr,",","*")
FlagSql = Replace(FlagSql,LeftStr,ReplaceMidStr)
Next
ReplaceMidFildes = FlagSql & FormBack
Else
ReplaceMidFildes = Str_Sql
End IF
End Function
'====================================================
'根据获取的值来得到新闻表可用字段的下拉列表
'====================================================
Function GetLeftSeFields(FidldsStr,StrType,TableType)
Dim TableName,i,Arr,Fname,FNameStr,FNum,FCName
If FidldsStr = "" Then
GetLeftSeFields = ""
Exit Function
End If
GetLeftSeFields = "<select name=""InsertToConN"" id=""InsertToConN"" onChange=""InsertToHTMl(this.options[this.selectedIndex].value)"">" & vbnewline
If Instr(FidldsStr,",") > 0 Then
Arr = Split(FidldsStr,",")
For i = LBound(Arr) To UBound(Arr)
FNameStr = Replace(Replace(Arr(i),"*",","),NS_TableName & ".","")
If TableType = "NS" Then
FNum = GetInnerFieldsNum(FNameStr,NSAllFENArr)
FCName = NSAllFCNArr(FNum)
TableName = "新闻"
ElseIf TableType = "DS" Then
FNum = GetInnerFieldsNum(FNameStr,DSAllFENArr)
FCName = DSAllFCNArr(FNum)
TableName = "下载"
ElseIF TableType = "MS" Then
FNum = GetInnerFieldsNum(FNameStr,MSAllFENArr)
FCName = MSAllFCNArr(FNum)
TableName = "商品"
End IF
If StrType = "And" Then
Fname = Replace(Arr(i),"*",",")
FCName = TableName & "." & FCName
ElseIF StrType = "No" Then
Fname = Replace(Replace(Arr(i),"*",","),NS_TableName & ".","")
FCName = FCName
End If
GetLeftSeFields = GetLeftSeFields & "<option value=""[*" & Fname & "*]"">" & FCName & "</option>" & vbnewline
Next
Else
FNameStr = Replace(Replace(FidldsStr,"*",","),NS_TableName & ".","")
If TableType = "NS" Then
FNum = GetInnerFieldsNum(FNameStr,NSAllFENArr)
FCName = NSAllFCNArr(FNum)
TableName = "新闻"
ElseIf TableType = "DS" Then
FNum = GetInnerFieldsNum(FNameStr,DSAllFENArr)
FCName = DSAllFCNArr(FNum)
TableName = "下载"
ElseIF TableType = "MS" Then
FNum = GetInnerFieldsNum(FNameStr,MSAllFENArr)
FCName = MSAllFCNArr(FNum)
TableName = "商品"
End IF
If StrType = "And" Then
Fname = Replace(FidldsStr,"*",",")
FCName = TableName & "." & FCName
ElseIF StrType = "No" Then
Fname = Replace(Replace(FidldsStr,"*",","),NS_TableName & ".","")
FCName = FCName
End If
GetLeftSeFields = GetLeftSeFields & "<option value=""[*" & Fname & "*]"">" & FCName & "</option>" & vbnewline
End If
GetLeftSeFields = GetLeftSeFields & "</select>" & vbnewline
End Function
'====================================================
'根据获取的值来得到栏目表可用字段的下拉列表
'====================================================
Function GetRightSeFields(FidldsStr,StrType,TableType)
Dim TableName,i,Arr,Fname,FNameStr,FNum,FCName
If FidldsStr = "" Then
GetRightSeFields = ""
Exit Function
End If
GetRightSeFields = "<select name=""InsertToConC"" id=""InsertToConC"" onChange=""InsertToHTMl(this.options[this.selectedIndex].value)"">" & vbnewline
If Instr(FidldsStr,",") > 0 Then
Arr = Split(FidldsStr,",")
For i = LBound(Arr) To UBound(Arr)
FNameStr = Replace(Replace(Arr(i),"*",","),NC_TableName & ".","")
If TableType = "NS" Then
FNum = GetInnerFieldsNum(FNameStr,NS_CAllENArr)
FCName = NS_CAllFCNArr(FNum)
TableName = "新闻栏目"
ElseIf TableType = "DS" Then
FNum = GetInnerFieldsNum(FNameStr,DCAllFENArr)
FCName = DCAllFCNArr(FNum)
TableName = "下载栏目"
ElseIF TableType = "MS" Then
FNum = GetInnerFieldsNum(FNameStr,MCAllFENArr)
FCName = MCAllFCNArr(FNum)
TableName = "商品栏目"
End IF
If StrType = "And" Then
Fname = Replace(Arr(i),"*",",")
FCName = TableName & "." & FCName
ElseIF StrType = "No" Then
Fname = Replace(Replace(Arr(i),"*",","),NC_TableName & ".","")
FCName = FCName
End If
GetRightSeFields = GetRightSeFields & "<option value=""[*" & Fname & "*]"">" & FCName & "</option>" & vbnewline
Next
Else
FNameStr = Replace(Replace(FidldsStr,"*",","),NC_TableName & ".","")
If TableType = "NS" Then
FNum = GetInnerFieldsNum(FNameStr,NS_CAllENArr)
FCName = NS_CAllFCNArr(FNum)
TableName = "新闻栏目"
ElseIf TableType = "DS" Then
FNum = GetInnerFieldsNum(FNameStr,DCAllFENArr)
FCName = DCAllFCNArr(FNum)
TableName = "下载栏目"
ElseIF TableType = "MS" Then
FNum = GetInnerFieldsNum(FNameStr,MCAllFENArr)
FCName = MCAllFCNArr(FNum)
TableName = "商品栏目"
End IF
If StrType = "And" Then
Fname = Replace(FidldsStr,"*",",")
FCName = TableName & "." & FCName
ElseIF StrType = "No" Then
Fname = Replace(Replace(FidldsStr,"*",","),NC_TableName & ".","")
FCName = FCName
End If
GetRightSeFields = GetRightSeFields & "<option value=""[*" & Fname & "*]"">" & FCName & "</option>" & vbnewline
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -