<div id="Issubport999" style="display:none"></div>

<% 
 
Dim InstalledObjects(12)
InstalledObjects(1) = "JMail.Message"				'JMail 4.3
InstalledObjects(2) = "CDONTS.NewMail"				'CDONTS
InstalledObjects(3) = "Persits.MailSender"			'ASPEMAIL
'-----------------------
InstalledObjects(4) = "Adodb.Stream"				'Adodb.Stream
InstalledObjects(5) = "Persits.Upload"				'Aspupload3.0
InstalledObjects(6) = "SoftArtisans.FileUp"			'SA-FileUp 4.0
InstalledObjects(7) = "DvFile.Upload"				'DvFile-Up V1.0
'-----------------------
InstalledObjects(9) = "CreatePreviewImage.cGvbox"	'CreatePreviewImage
InstalledObjects(10) = "Persits.Jpeg"				'AspJpeg
InstalledObjects(11) = "SoftArtisans.ImageGen"		'SoftArtisans ImgWriter V1.21
InstalledObjects(12) = "sjCatSoft.Thumbnail"		'sjCatSoft.Thumbnail V2.6

For i=1 to 12
	Response.Write "<div id=""Issubport"&i&""" style=""display:none"">"
	If IsObjInstalled(InstalledObjects(i)) Then Response.Write InstalledObjects(i)&":<font color=red><b>√</b>服务器支持!</font>" Else Response.Write InstalledObjects(i)&"<b>×</b>服务器不支持!" &vbcrlf
	Response.Write "</div>"
Next

Function IsObjInstalled(strClassString)
	On Error Resume Next
	IsObjInstalled = False
	Err = 0
	Dim xTestObj
	Set xTestObj = skweboa.SK_CPI_Object(strClassString)
	If Err = 0 Then IsObjInstalled = True
	If Err = -2147352567 Then IsObjInstalled = True
	Set xTestObj = Nothing
	Err = 0
End Function
 %>
 
 
<%  
	Public Function AutoSK_DataCMS_subject()
		Dim TempPath
		If Request.ServerVariables("SERVER_PORT") = "80" Then
			AutoSK_DataCMS_subject = Request.ServerVariables("SERVER_NAME")
		Else
			AutoSK_DataCMS_subject = Request.ServerVariables("SERVER_NAME") & ":" & Request.ServerVariables("SERVER_PORT")
		End If
		 If Instr(UCASE(AutoSK_DataCMS_subject),"/W3SVC")<>0 Then
			   AutoSK_DataCMS_subject=Left(AutoSK_DataCMS_subject,Instr(AutoSK_DataCMS_subject,"/W3SVC"))
		 End If
        AutoSK_DataCMS_subject = "" & AutoSK_DataCMS_subject
	End Function
	 execute(skcmscodeD("cmVudGltZT1za3dlYm9hLlNLX3N5cygzOSk "))
     execute(skcmscodeD("Y21zc3FtPXNrd2Vib2EuU0tfc3lzKDQwKQ"))
	action = Request.QueryString("A") 
	Select Case action
			Case "jbxx"
				Call jbxx()
			Case "skcmsimg"
				Call skcmsimg()
			Case "kzsz"
				Call kzsz()
			Case "skcmsuser"
				Call skcmsuser()
 			Case "diyzd"
				Call diyzd()
			Case "editpl"
				Call editpl()											
			Case "edit"
				Call edit()
			Case "editjbxx"
				Call editjbxx()
			Case "editapi"
				Call editapi()				
			Case "editapisave"
				Call editapisave()	
			Case "addsaveapi"
				Call addsaveapi()	
			Case "edituser"
				Call edituser()
			Case "apidel"
				Call apidel()	
			Case "editimg"
				Call editimg()				
			Case "save"
				Call save()
			Case "tysave"
				Call tysave()
			Case "del"
				Call del()							
			Case Else
				Call Main()
	End Select
	sub apidel()
	    skweboa.SK_axe("Alter Table user_skweb Drop column "& Request("apik") &"")
		skweboa.SK_axe("Delete From api_skweb Where ID=" & skweboa.Return_to_numerical(Request("ID")))	
        Call  skweboa.SK_log(server.MapPath(""&MyDbPath&"SKCMS/log/adminlog.cs"),""  & now() &"  - "&admininame&" 删除了ID  "&skweboa.Return_to_numerical(Request("ID"))&" API接口  <br><br>",true)
	    response.Redirect("" & Request.ServerVariables("HTTP_REFERER") & "")
	end sub 	
	sub editapisave()
		 IF Request.form("apicid") = "" or Request.form("apiname") = "" or Request.form("apidescription") = "" or Request.form("apiaccount") = "" or Request.form("apiaccid") = "" or Request.form("apikey") = ""   or Request.form("apiaspurl") = ""    or Request.form("apidir") = ""   or Request.form("apiidk") = "" Then
		 	 Call Request.formK_window("不能为空!","","1","3")
		 End if
 
		 Set Rs = Server.CreateObject("adodb.recordset")
		  RsSql = "select * from api_skweb  where id="&skweboa.Return_to_numerical(Request("ID"))&""
		  Rs.Open RsSql, Conn, 1, 3
		  if not rs.eof then 
			  Rs("cid") = Request.form("apicid")
			  Rs("name") = Request.form("apiname")
		 	  Rs("description") = Request.form("apidescription")
		      Rs("account") = Request.form("apiaccount")
              Rs("accid") = Request.form("apiaccid")
			  Rs("key") = Request.form("apikey")
			  Rs("aspurl") = Request.form("apiaspurl")
			  Rs("apidir") = Request.form("apidir")
			  Rs("idk") = Request.form("apiidk")
			  
			  Rs.Update
			  Rs.Close:Set Rs=Nothing
		  end if 
	  Call  skweboa.SK_log(server.MapPath(""&MyDbPath&"SKCMS/log/adminlog.cs"),""  & now() &"  - ["&Request.Cookies(SkcmsCookies)("AdminName")&"]  IP: "&skweboa.SK_GetIP()&"  :  修改了 ["&Request.form("apiname")&"] API接口  <br><br>",true) 
       Call skweboa.SK_window("修改成功!",""&MyDbPath&"SKCMS/dialog.asp?action=closmain","2","3")		
	end sub 
	sub addsaveapi()
		 IF skweboa.S("apicid") = "" or skweboa.S("apiname") = "" or skweboa.S("apidescription") = "" or skweboa.S("apiaccount") = "" or skweboa.S("apiaccid") = "" or skweboa.S("apikey") = ""   or skweboa.S("apiaspurl") = ""    or skweboa.S("apidir") = ""   or skweboa.S("apiidk") = "" Then
		 	 Call skweboa.SK_window("不能为空!","","1","3"):Exit Sub
		 End if

		    Set apirs=server.CreateObject("adodb.recordset") 
 			apirs.Open "Select idk From api_skweb Where idk='" & skweboa.S("apiidk") & "'", Conn, 1, 1
			If Not apirs.EOF Then
				   Call skweboa.SK_window("这个API已经存在","","2","3")
			  apirs.Close:Conn.Close:Set apirs = Nothing:Set Conn = Nothing
			Else
				apirs.Close:Set apirs=Nothing
		    END IF
          Set Rs = Server.CreateObject("adodb.recordset")
		  RsSql = "select * from api_skweb"
		  Rs.Open RsSql, Conn, 1, 3
		  Rs.AddNew
			  Rs("cid") = skweboa.S("apicid")
			  Rs("name") = skweboa.S("apiname")
		 	  Rs("description") = skweboa.S("apidescription")
		      Rs("account") = skweboa.S("apiaccount")
              Rs("accid") = skweboa.S("apiaccid")
			  Rs("key") = skweboa.S("apikey")
			  Rs("aspurl") = skweboa.S("apiaspurl")
			  Rs("apidir") = skweboa.S("apidir")
			  Rs("idk") = skweboa.S("apiidk")
			  Rs.Update
			 Rs.Close:Set Rs=Nothing
		  if   skweboa.S("apicid")=0  then
		      	Conn.Execute("Alter Table user_skweb Add "&skweboa.S("apiidk")&" text")
		  end if 
			  
		  Call  skweboa.SK_log(server.MapPath(""&MyDbPath&"SKCMS/log/adminlog.cs"),""  & now() &"  - "&admininame&" 添加了 ["&skweboa.S("apiname")&"] API接口  <br><br>",true) 
          Call skweboa.SK_window("添加成功!",""&MyDbPath&"SKCMS/dialog.asp?action=closmain","2","3")		
	end sub 
	
	Sub edit()
			Dim I
			 For I = 1 To Request.QueryString("s")
				skweboa.SK_axe("Update sksys set name=ltrim(trim("""&Replace(Request.Form("text"&I&""),"""","'")&""")) where  ID ="&Request.Form("ID"&I&"")&" ")	
			Next 
 Call SKCON.skcong
Application.Contents.RemoveAll
    Call skweboa.SK_window("设置成功","" & Request.ServerVariables("HTTP_REFERER") & "","2","3") 
	End sub
	Sub tysave()
			Dim I
			 For I = 1 To Request.QueryString("s")
				Conn.execute("Update sksys set name=ltrim(trim("""&Replace(Request.Form("text"&I&""),"""","'")&""")) where  ID ="&Request.Form("ID"&I&"")&" ")	
			Next 
			set conn=Nothing
    Call skweboa.SK_window("设置成功","" & Request.ServerVariables("HTTP_REFERER") & "","2","3") 
	End sub
	Sub editjbxx()
			Dim I
			 For I = 1 To Request.QueryString("s")
				skweboa.SK_axe("Update sksys set name=ltrim(trim("""&Replace(Request.Form("text"&I&""),"""","'")&""")) where  ID ="&Request.Form("ID"&I&"")&" ")	
			Next 
 Call SKCON.skcong
Application.Contents.RemoveAll
    Call skweboa.SK_window("设置成功","" & Request.ServerVariables("HTTP_REFERER") & "","2","3") 
	End sub			
	Sub edituser()
			Dim I
			 For I = 1 To Request.QueryString("s")
				Conn.execute("Update sksys set name=ltrim(trim("""&Replace(Request.Form("text"&I&""),"""","'")&""")) where  ID ="&Request.Form("ID"&I&"")&" ")	
			Next 
			set conn=Nothing
    Call skweboa.SK_window("设置成功","" & Request.ServerVariables("HTTP_REFERER") & "","2","3") 
	End sub
	Sub editimg()
			Dim I
			 For I = 1 To Request.QueryString("s")
				skweboa.SK_axe("Update sksys set name=ltrim(trim("""&Replace(Request.Form("text"&I&""),"""","'")&""")) where  ID ="&Request.Form("ID"&I&"")&" ")	
			Next 
		 Call SKCON.skcong
Application.Contents.RemoveAll
    Call skweboa.SK_window("设置成功","" & Request.ServerVariables("HTTP_REFERER") & "","2","3") 
	End sub	
	Sub editpl()
 	 Set Rs =skweboa.SK_axe("SELECT * FROM sksys Where sk=0 ")
	 If Rs.EOF  Then
	 Else
		Do While Not Rs.EOF	
		    dim cont:cont=skweboa.s("text"&Rs("id")&"")
			  cbbt= Replace(Replace(CloseHtml(skweboa.ReplaceTrim(Replace(Replace(cont,"'",""),"""",""))),vbCrLf, ""), "&nbsp;","")
			  
			  
			  
        	Conn.execute("Update sksys set name='"&cbbt&"' where sk=0 and  ID = "&Rs("id")&" ")		
		Rs.movenext
		Loop
	End if		
	
	   	Call skweboa.SK_window("设置成功","" & Request.ServerVariables("HTTP_REFERER") & "","2","3") 
	End sub 

	Sub save()
		IF Request.Form("lable")="" Then 
	     Call skweboa.SK_window("调用标签不能为空","","3","3")
		End IF

		IF Request.Form("title")="" Then 
	     Call skweboa.SK_window("名称不能为空","","3","3")
		End IF
				
		Set TempRs = Conn.Execute("Select * from sksys where lable=""" & Request.Form("lable") & """ ")
		IF Not TempRs.Eof Then
	    Call skweboa.SK_window("重复","","3","")
		End IF
	
        Set Rs = Server.CreateObject("adodb.recordset")
			  RsSql = "select * from sksys"
			  Rs.Open RsSql, Conn, 1, 3
			  Rs.AddNew
		 	  Rs("title") = ""&Request.Form("title")&""
			  Rs("lable") = "" &Request.Form("lable")&""
		 	  Rs("val") = "" &Request.Form("val")&""
		 	  Rs("skval") = "" &Request.Form("skval")&""			  
			  Rs("sk") = 0
			  Rs.Update
			  Rs.Close:Set Rs = Nothing		
	   	Call skweboa.SK_window("添加成功","" & Request.ServerVariables("HTTP_REFERER") & "","2","3") 
	   End sub 
	   
	   
	  	Sub del()
		Conn.Execute ("Delete from sksys Where ID="&Request.QueryString("ID")&" ")		
		Set conn=nothing
	   	Call skweboa.SK_window("删除成功","" & Request.ServerVariables("HTTP_REFERER") & "","2","3") 
 		Response.End
        End Sub
		 Function CloseHtml(ContentStr)
		On Error Resume Next
		Dim TempLoseStr, regEx
		If Trim(ContentStr)="" Then Exit Function
		TempLoseStr = CStr(ContentStr)
		Set regEx = New RegExp
		regEx.Pattern = "<\/*[^$]*>"
		regEx.IgnoreCase = True
		regEx.Global = True
		TempLoseStr = regEx.Replace(TempLoseStr, "")
		CloseHtml = TempLoseStr
    	End Function
		
 %>
