<% '****************************************************************************************************************** 'System Name : ELIS Ver 1.0 '****************************************************************************************************************** 'File Name : inc_function.asp 'File Description : System Configuration 'Developer : Taejin Kwon 'Date : 3/29/2009 'Modifier(Date) : None '****************************************************************************************************************** Function funcEncode(ByVal asContents) funcEncode = replace(replace(asContents,"=","!"),"&","^") End Function 'Ãâ·Â ÇÔ¼ö function echo(Str) response.write(Str) end function '¹®ÀÚ¿­ ÀÚ¸£±â function StringCut(Str,Val) dim cutLen,strLen strLen = len(Str) cutLen = Val-2 if strLen > Val then Str = left(Str,cutLen)&"..." end if StringCut = Str end function ' ÀÚ¹Ù½ºÅ©¸³Æ® ¸Þ½ÃÁö Ãâ·Â ÇÔ¼ö function MsgView(Msg,go) Dim str str = ""&chr(13) response.write(str) end function function OnlyMsgView(Msg) Dim str str = ""&chr(13) response.write(str) end function function MsgViewHref(Msg,href) Dim str str = ""&chr(13) response.write(str) end function function MsgViewClose(Msg) Dim str str = ""&chr(13) response.write(str) end function 'À¯´ÏÅ©ÇÑ ÆÄÀϰæ·Î¹× ÆÄÀÏÀ̸§À» ¾ò¾î³»´Â ÇÔ¼ö Function GetUniqueName(byRef strFileName, DirectoryPath) Dim strName, strExt ' È®ÀåÀÚ¸¦ Á¦¿ÜÇÑ ÆÄÀϸíÀ» ¾ò´Â´Ù. strName = Mid(strFileName, 1, InstrRev(strFileName, ".") - 1) strExt = Mid(strFileName, InstrRev(strFileName, ".") + 1)'È®ÀåÀÚ¸¦ ¾ò´Â´Ù Dim fso Set fso = Server.CreateObject("Scripting.FileSystemObject") Dim bExist : bExist = True '¿ì¼± °°ÀºÀ̸§ÀÇ ÆÄÀÏÀÌ Á¸ÀçÇÑ´Ù°í °¡Á¤ Dim strFileWholePath : strFileWholePath = DirectoryPath & "\" & strName & "." & strExt 'ÀúÀåÇÒ ÆÄÀÏÀÇ ¿ÏÀüÇÑ À̸§(¿ÏÀüÇÑ ¹°¸®ÀûÀÎ °æ·Î) ±¸¼º Dim countFileName : countFileName = 0 'ÆÄÀÏÀÌ Á¸ÀçÇÒ °æ¿ì, À̸§ µÚ¿¡ ºÙÀÏ ¼ýÀÚ¸¦ ¼¼ÆÃÇÔ. Do While bExist ' ¿ì¼± ÀÖ´Ù°í »ý°¢ÇÔ. If (fso.FileExists(strFileWholePath)) Then ' °°Àº À̸§ÀÇ ÆÄÀÏÀÌ ÀÖÀ» ¶§ countFileName = countFileName + 1 'ÆÄÀÏ¸í¿¡ ¼ýÀÚ¸¦ ºÙÀÎ »õ·Î¿î ÆÄÀÏ À̸§ »ý¼º strFileName = strName & "(" & countFileName & ")." & strExt strFileWholePath = DirectoryPath & "\" & strFileName Else bExist = False End If Loop GetUniqueName = strFileWholePath End Function '¸®Ç÷¡½Ã function ReFresh(href) response.write("") end function '°¡°Ý Æ÷¸ä function PriceFormat(price) 'PriceFormat = price PriceFormat = formatnumber(price,0) end function function dateFormat(str) dim re re = left(str,4) & "-" & mid(str,5,2) & "-" & mid(str,7,2) dateFormat = re end function function fileType(file) dim arr arr = split(file,".") if ubound(arr) <1 then fileType = "" else fileType = arr(1) end if end function Function FuncRenderButton(byVal pStrBtnName, byVal pStrAction, byVal pStrAlign) '//ÇâÈÄ À̹ÌÁö¸¦ »ó¼öÈ­Çϰųª CSS¿¡¼­ °¡Á®¿Àµµ·Ï ÇÑ´Ù. Dim ImgLeft Dim ImgCenter Dim ImgRight ImgLeft = "/image/Button/button_left.gif" ImgCenter = "/image/Button/button_center_bg.gif" ImgRight = "/image/Button/button_right.gif" %>
 <%=pStrBtnName%> 
<% End Function '-------------------------------------------------------------------------------------------- ' fntEncodingNum : NumÀ» Code·Î '-------------------------------------------------------------------------------------------- Function fntEncodingNum (byVal str) Dim i Dim m Dim code code = "" for i=1 to len(str) m = mid(str,i,1) code = code & hex(asc(m)) next fntEncodingNum = code End Function '-------------------------------------------------------------------------------------------- ' fntDecodingNum : Code ¸¦ ¿ø·¡·Î '-------------------------------------------------------------------------------------------- Function fntDecodingNum (byVal code) Dim i Dim m Dim n Dim str str = "" for i=1 to len(code) step 2 m = mid(code,i,2) n = "&H" & m if n > "&H7F" then m=mid(code,i,4) n = "&H" & m i=i+2 end if str = str & chr(n) next fntDecodingNum = str End Function Sub subStateBox(byVal Rval) %> <% End Sub Sub subReStateBox2(byVal Rval) %> <% End Sub Function oGetUploadObject() Response.Expires = -10000 '// Progress Bar 󸮸¦ À§ÇØ Server.ScriptTimeOut = 300 '// Progress Bar 󸮸¦ À§ÇØ ' ============================================================== Set oGetUploadObject = Server.CreateObject("ABCUpload4.XForm") End Function Sub oGetUploadDesc(ByRef oUploadForm) oUploadForm.AbsolutePath = True oUploadForm.Overwrite = False oUploadForm.MaxUploadSize = 10000000 '//may be 10MB oUploadForm.ID = Request.QueryString("ID") End Sub Function funcGetUploadFileObject(ByRef oUploadForm, ByVal fileName, ByVal Path) Dim PhysicalPath, fileCount '1¹øÂ° ÆÄÀÏ ¾÷·Îµå ---------------------------------------------------------------------- Dim oUploadField Set oUploadField = oUploadForm(fileName)(1) '//ÆÄÀÏŸÀÌÆ², ÆÄÀϸí, È®ÀåÀÚ ÃßÃâ Dim img_name, img_name_only, img_name_ext img_name = Trim(oUploadField.SafeFileName) If img_name <> "" then img_name_only = Mid(img_name, 1, InStr(img_name, ".") - 1 ) img_name_ext = oUploadField.FileType '//¹°¸®Àû ÆÄÀÏÀúÀå°æ·Î + ÆÄÀϸí PhysicalPath = Path & oUploadField.SafeFileName '//µ¿ÀϸíÀ» °¡Áø ÆÄÀÏÀÌ ÀÌ¹Ì Á¸ÀçÇÑ´Ù¸é.. Dim oFSO Set oFSO = CreateObject("Scripting.FileSystemObject") IF (oFSO.FileExists(PhysicalPath)) Then fileCount = 0 '//¸¸¾à Áߺ¹ÆÄÀÏÀÌ ÀÖ´Ù¸é ÆÄÀÏÀ̸§ µÚ¿¡ ÀÓÀÇÀÇ ¼ö¸¦ Ãß°¡ÇÑ´Ù. While (oFSO.FileExists(PhysicalPath)) fileCount = Cint(fileCount) + 1 PhysicalPath = Path & img_name_only &"_"& fileCount & "." & img_name_ext img_name = img_name_only &"_"& fileCount & "." & img_name_ext Wend End IF Set oFSO = Nothing '//ÆÄÀÏ ÃÖÁ¾ ¾÷·Îµå oUploadField.Save PhysicalPath End If Set oUploadField = Nothing funcGetUploadFileObject = img_name End Function Function FuncRenderButton2(byVal pStrBtnName, byVal pStrAction, byVal pStrAlign) '//ÇâÈÄ À̹ÌÁö¸¦ »ó¼öÈ­Çϰųª CSS¿¡¼­ °¡Á®¿Àµµ·Ï ÇÑ´Ù. Dim ImgLeft Dim ImgCenter Dim ImgRight ImgLeft = "/images/button/button2_left.gif" ImgCenter = "/images/button/button2_center_bg.gif" ImgRight = "/images/button/button2_right.gif" %>
<%=pStrBtnName%>
<% End Function Function FuncRenderButton3(byVal pStrBtnName, byVal pStrAction, byVal pStrAlign) '//ÇâÈÄ À̹ÌÁö¸¦ »ó¼öÈ­Çϰųª CSS¿¡¼­ °¡Á®¿Àµµ·Ï ÇÑ´Ù. Dim ImgLeft Dim ImgCenter Dim ImgRight ImgLeft = "/images/button/button2_left.gif" ImgCenter = "/images/button/button2_center_bg.gif" ImgRight = "/images/button/button2_right.gif" %>
 <%=pStrBtnName%> 
<% End Function Sub subScriptClose() Dim strClose strClose = FuncRenderScript("window.close();", "Javascript") Response.write strClose End Sub Sub subScriptPageMove(pUrl) Dim strMove strMove = FuncRenderScript("document.location.href('"&pUrl&"');", "Javascript") Response.write strMove End Sub Sub subScriptPageMsg(pMsg) Dim strMsg strMsg = FuncRenderScript("alert('"&pMsg&"');", "Javascript") Response.write strMsg End Sub '//SUMMER SEASON ' Sub subBoardingTime(pRoute, pVal) ' Dim strMsg ' If pRoute = "DEPART" Then '//To JFK ' Select Case pVal ' Case "CLOSTER (Golf Range)" ' strMsg = "9:00 AM" ' Case "Tenafly (Train Station)" ' strMsg = "9:10 AM" ' Case "HANNAM CHAIN (RT 46)" ' strMsg = "9:30 AM" ' Case "Fort Lee (Woori Bank)" ' strMsg = "9:50 AM" ' Case "JFK Airport #4" ' strMsg = "10:30 AM" ' End Select ' Else '//Return '// To Bergen ' Select Case pVal ' Case "JFK Airport #4" ' strMsg = "11:30 AM" ' Case "Fort Lee (Woori Bank)" ' strMsg = "12:20 PM" ' Case "HANNAM CHAIN (RT 46)" ' strMsg = "12:30 PM" ' Case "Tenafly (Train Station)" ' strMsg = "12:50 PM" ' Case "CLOSTER (Golf Range)" ' strMsg = "1:10 PM" ' End Select ' End IF ' ' Response.write strMsg ' End Sub ' Function funcBoardingTime(pRoute, pVal) ' Dim strMsg ' If pRoute = "DEPART" Then '//To JFK ' Select Case pVal ' Case "CLOSTER (Golf Range)" ' strMsg = "9:00 AM" ' Case "Tenafly (Train Station)" ' strMsg = "9:10 AM" ' Case "HANNAM CHAIN (RT 46)" ' strMsg = "9:30 AM" ' Case "Fort Lee (Woori Bank)" ' strMsg = "9:50 AM" ' Case "JFK Airport #4" ' strMsg = "10:30 AM" ' End Select ' Else '//Return '// To Bergen ' Select Case pVal ' Case "JFK Airport #4" ' strMsg = "11:30 AM" ' Case "Fort Lee (Woori Bank)" ' strMsg = "12:20 PM" ' Case "HANNAM CHAIN (RT 46)" ' strMsg = "12:30 PM" ' Case "Tenafly (Train Station)" ' strMsg = "12:50 PM" ' Case "CLOSTER (Golf Range)" ' strMsg = "1:10 PM" ' End Select ' End IF ' funcBoardingTime = strMsg ' End Function '// Winter Season Sub subBoardingTime(byRef objQuery, pRoute, pVal) Set rsVal = funcGetContents(objQuery) IF rsVal.EOF AND rsVal.BOF Then Response.write "There is no data!" Else Dim strMsg If pRoute = "DEPART" Then '//To JFK Select Case pVal Case "CLOSTER (Golf Range)" strMsg = Trim(rsVal("location1_time1")) Case "Tenafly (Train Station)" strMsg = Trim(rsVal("location2_time1")) Case "HANNAM CHAIN (RT 46)" strMsg = Trim(rsVal("location3_time1")) 'Case "Fort Lee (Woori Bank)" ' strMsg = Trim(rsVal("location4_time1")) Case "JFK Airport #4" strMsg = Trim(rsVal("location5_time1")) End Select Else '//Return '// To Bergen Select Case pVal Case "JFK Airport #4" strMsg = Trim(rsVal("location5_time2")) 'Case "Fort Lee (Woori Bank)" ' strMsg = Trim(rsVal("location4_time2")) Case "HANNAM CHAIN (RT 46)" strMsg = Trim(rsVal("location3_time2")) Case "Tenafly (Train Station)" strMsg = Trim(rsVal("location2_time2")) Case "CLOSTER (Golf Range)" strMsg = Trim(rsVal("location1_time2")) End Select End IF Response.write strMsg End If rsVal.close Set rsVal = Nothing End Sub Function funcBoardingTime(byRef objQuery, pRoute, pVal) Set rsVal = funcGetContents(objQuery) IF rsVal.EOF AND rsVal.BOF Then Response.write "There is no data!" Else Dim strMsg If pRoute = "DEPART" Then '//To JFK Select Case pVal Case "CLOSTER (Golf Range)" strMsg = Trim(rsVal("location1_time1")) Case "Tenafly (Train Station)" strMsg = Trim(rsVal("location2_time1")) Case "HANNAM CHAIN (RT 46)" strMsg = Trim(rsVal("location3_time1")) 'Case "Fort Lee (Woori Bank)" ' strMsg = Trim(rsVal("location4_time1")) Case "JFK Airport #4" strMsg = Trim(rsVal("location5_time1")) End Select Else '//Return '// To Bergen Select Case pVal Case "JFK Airport #4" strMsg = Trim(rsVal("location5_time2")) 'Case "Fort Lee (Woori Bank)" ' strMsg = Trim(rsVal("location4_time2")) Case "HANNAM CHAIN (RT 46)" strMsg = Trim(rsVal("location3_time2")) Case "Tenafly (Train Station)" strMsg = Trim(rsVal("location2_time2")) Case "CLOSTER (Golf Range)" strMsg = Trim(rsVal("location1_time2")) End Select End IF funcBoardingTime = strMsg End If rsVal.close Set rsVal = Nothing End Function %>