first commit

This commit is contained in:
2026-08-07 12:53:18 +09:00
commit 0b0415f0f4
1523 changed files with 496649 additions and 0 deletions

193
Lib/SiteFunc.asp Normal file
View File

@@ -0,0 +1,193 @@
<%
'###########################################################################################
'로그인 여부 체크 함수
'return : void
'###########################################################################################
Function Login()
If Session("name")="" Or Session("team")="" Then
Response.Redirect "/logout.asp"
End If
End Function
Function Login_Ajax()
If Session("name")="" Or Session("team")="" Then
Login_Ajax = "timeout"
End If
End Function
'###########################################################################################
'로그아웃
'return : void
'###########################################################################################
Sub Logout()
Session("ID")=""
Session("userID")=""
Session("Grade")=""
Session("userName")=""
Session.Contents.RemoveAll()
Session.Abandon
End Sub
'###########################################################################################
'URL Redirect
'return : void
'###########################################################################################
Function call_Url(url,msg)
Response.Write "<html xmlns='http://www.w3.org/1999/xhtml'>" & vbCRLF
Response.Write "<head>" & vbCrLF
Response.Write "<title>" & PROGRAMTITLE & "</title>" & vbCrlf
Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />" & vbCrlf
Response.Write "</head>" & vbCrLF
Response.Write "<body></body>" & vbCrLF
Response.Write "<script src='//code.jquery.com/jquery-1.12.0.min.js'></script>" & vbCrLF
Response.Write "<script language='javascript'>" & vbCrlf
Response.Write "<!--" & vbCrlf
Response.Write " $(document).ready(function(){" & vbCrlf
if Trim(msg)<>"" Then
Response.Write " alert('" & trim(msg) & "');" & vbCrlf
end if
Response.Write " location.replace('" & trim(url) & "');" & vbCrlf
Response.Write " });" & vbCrlf
Response.Write "//-->" & vbCrlf
Response.Write "</script>" & vbCrlf
Response.Write "</html>"
End Function
'###########################################################################################
'URL Redirect
'return : void
'###########################################################################################
Function call_msg(msg)
Response.Write "<html xmlns='http://www.w3.org/1999/xhtml'>" & vbCRLF
Response.Write "<head>" & vbCrLF
Response.Write "<title>" & SurveyTitle & "</title>" & vbCrlf
Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />" & vbCrlf
Response.Write "</head>" & vbCrLF
Response.Write "<body></body>" & vbCrLF
Response.Write "<script src='//code.jquery.com/jquery-1.12.0.min.js'></script>" & vbCrLF
Response.Write "<script language='javascript'>" & vbCrlf
Response.Write "<!--" & vbCrlf
Response.Write " $(document).ready(function(){" & vbCrlf
if Trim(msg)<>"" Then
Response.Write " alert('" & trim(msg) & "');" & vbCrlf
end if
Response.Write " history.back();" & vbCrlf
Response.Write " });" & vbCrlf
Response.Write "//-->" & vbCrlf
Response.Write "</script>" & vbCrlf
Response.Write "</html>"
End Function
'TEST ID 생성'
Function RNDKEY(types)
Dim str, strlen, r, i, ds, serialCode '사용되는 변수를 선언
Dim IDKEY
str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" '랜덤으로 사용될 문자 또는 숫자
strlen = 8 '랜덤으로 출력될 값의 자릿수 ex)해당 구문에서 10자리의 랜덤 값 출력
Randomize '랜덤 초기화
For i = 1 To strlen '위에 선언된 strlen만큼 랜덤 코드 생성
r = Int((36 - 1 + 1) * Rnd + 1) ' 36은 str의 문자갯수
serialCode = serialCode + Mid(str,r,1)
Next
IF types = "TEST" Then
IDKEY = "TEST"&serialCode
ELSE
IDKEY = serialCode
END IF
RNDKEY = IDKEY
End Function
'###########################################################################################
'데이터맵 파일 생성
'return : void
'###########################################################################################
Function createDataMap(code)
Dim PSQL
Dim params(0)
Dim dbmapFile,mapStr,sourceStr
Dim jCnt,xCnt
Dim cVar,jsonObj
dbmapFile = "/Survey/Map/"&code&".map"
mapStr = getVariableQuery(code,"")
sourceStr = "[IDX],[IDKey],[Interviewer],[StartDate],[UpdateDate],[EndDate],[Page],[OutPage],[IPName],[ResType],"
WriteUTF_File dbmapFile,sourceStr & mapStr
Set jsonOBJ = Nothing
End Function
'###########################################################################################
'" 을 ˝ 로 변경해줌 ASP 파일 아웃풋을 위해 처리
'@resText : Text
'return : String
'###########################################################################################
Function ConverTextForASP(resText)
ConverTextForASP = Replace(resText,Chr(34),"˝")
End Function
Function ConvertHtmlQuot(resText)
resText = Replace(resText,"=" & Chr(34),"='")
resText = Replace(resText,Chr(34)&">","'>")
resText = Replace(resText,Chr(34)&" ","' ")
resText = Replace(resText,Chr(34)&Chr(34),"""")
resText = Replace(resText,Chr(34),"&quot;")
resText = Replace(resText,vbCRLF,"<br>")
ConvertHtmlQuot =resText
End Function
Function ReadUTF8File(sFileName)
Dim Stream, TextBuffer
Set Stream = Server.CreateObject("ADODB.Stream")
With Stream
.Charset = "utf-8"
.Type = 2 'adTypeText
.Open
.LoadFromFile sFileName
.Position = 0
ReadUTF8File = .ReadText
.Close
End With
Set Stream = Nothing
End Function
Function WriteUTF8File(sFileName, sText)
Dim Stream
Set Stream = Server.CreateObject("ADODB.Stream")
With Stream
.Charset = "utf-8"
.Type = 2 'adTypeText
.Open
.WriteText sText
.SaveToFile sFileName, 2 'adSaveCreateOverWrite
.Close
End With
Set Stream = Nothing
End Function
%>