'=============================================================================== 'ÁÖ ½Ã ½º ÅÛ : °øÅë °³¹ß '¼­ºê ½Ã½ºÅÛ : ¾øÀ½ 'ÇÁ·Î±×·¥ ID : CommonScript.vbs 'ÇÁ·Î±×·¥ ¸í : °øÅë ±â´É vbscript 'ÇÁ·Î±×·¥°³¿ä : °øÅëÀûÀ¸·Î »ç¿ëµÇ´Â vbscript¸¦ Á¤ÀÇÇÑ´Ù 'ÀÛ ¼º ÀÚ : ÃÖ¿ëÈ£ 'ÀÛ ¼º ÀÏ : 2006.04.18 '=============================================================================== Option Explicit Dim SearchName ' * @type : function ' * @access : public ' * @desc : MS Á¤Ã¥¿¡ ÀÇÇÏ¿© ¹Ù²ï ÄÄÆ÷³ÍÆ® »ç¿ë¿¡ ´ëÇÑ ¼±¾ð ÇÔ¼ö ' *
' *     
' * 
' * À§¿Í°°ÀÌ »ç¿ëÇßÀ» °æ¿ì ÆäÀÌÁö¿¡¼­ »ç¾÷ü¸¦ Çѹø¸¸ üũ¸¦ ÇÑ´Ù.
' * @sig    : NSID
' * @param  : NSID   OBJECTÇÔ¼ö¸í
' * @return : º¯È¯µÈ ½ºÆ®¸µ OBJECT
Sub WS(NSID)
	Call document.write( NSID.innerHTML )
	NSID.id = ""
End sub

' * @type   : function
' * @access : public
' * @desc   : VB½ºÅ©¸³Æ®ÀÇ ¼ýÀÚ µÚ¿¡ ÁöÁ¤µÈ ÀÚ¸´¼ö¸¸Å­ zero character ¸¦ »ðÀÔÇÑ´Ù.
' * 
' *     cfbeNumber(5, 123);
' * 
' * À§¿Í°°ÀÌ »ç¿ëÇßÀ» °æ¿ì "12300" À̶ó´Â StringÀ» ¸®ÅÏÇÑ´Ù. ' * @sig : length, number, char ' * @param : length required ¼ýÀÚ¸¦ Ç¥ÇöÇÏ´Â ±æÀÌ ' * @param : number required º¯È¯µÉ ¼ýÀÚ ' * @param : char required º¯°æÇÒ ¼ýÀÚ ' * @return : º¯È¯µÈ ½ºÆ®¸µ function cfbeNumber(length, number, char) Dim numStr, zeroChars, i numStr = number & "" For i=1 To length - Len(numStr) zeroChars = char & zeroChars Next cfbeNumber = (numStr & zeroChars) End Function ' * @type : function ' * @access : public ' * @desc : VB½ºÅ©¸³Æ®ÀÇ ¼ýÀÚ ¾Õ¿¡ ÁöÁ¤µÈ ÀÚ¸´¼ö¸¸Å­ zero character ¸¦ »ðÀÔÇÑ´Ù. ' *
' *     cfafNumber(5, 123);
' * 
' * À§¿Í°°ÀÌ »ç¿ëÇßÀ» °æ¿ì "00123" À̶ó´Â StringÀ» ¸®ÅÏÇÑ´Ù. ' * @sig : length, number, char ' * @param : length required ¼ýÀÚ¸¦ Ç¥ÇöÇÏ´Â ±æÀÌ ' * @param : number required º¯È¯µÉ ¼ýÀÚ ' * @param : char required º¯°æÇÒ ¼ýÀÚ ' * @return : º¯È¯µÈ ½ºÆ®¸µ function cfafNumber(length, number, char) Dim numStr, zeroChars, i numStr = number & "" For i=1 To length - Len(numStr) zoroChars = zeroChars & char Next cfafNumber = (zeroChars & numStr) End Function ' * @type : function ' * @access : public ' * @desc : ¹®ÀÚ¿­ÀÇ ÇØ´ç ¹®ÀÚ¸¦ »èÁ¦ÇÏ¿© ÁØ´Ù. ' *
' *     removeChar("123*", "*");
' * 
' * À§¿Í°°ÀÌ »ç¿ëÇßÀ» °æ¿ì "123" À̶ó´Â StringÀ» ¸®ÅÏÇÑ´Ù. ' * @sig : value, char ' * @param : value required »èÁ¦ÇÒ ¹®ÀÚ¿­ ' * @param : char required º¯°æÇÒ ¹®ÀÚ ' * @return : º¯È¯µÈ ½ºÆ®¸µ Function removeChar(value, char) removeChar = Replace(value, char, "") End Function ' * @type : function ' * @access : public ' * @desc : Äڵ强 ¹®ÀÚ¿­¿¡ ´ëÇÏ¿© ½ºÆäÀ̽º °ø°£À» »èÁ¦¸¦ Çϸç *·Î µé¾î¿Â°ÍÀÌ ÀÖÀ¸¸é »èÁ¦¸¦ Çϰí ' ÄÚµå ±æÀÌ¿¡ ¸ÂÃß¾î ¹®ÀÚ¸¦ ³Ö¾î ÁØ´Ù. ' *
' *     codeValueVald(5, "123*", "0");
' * 
' * À§¿Í°°ÀÌ »ç¿ëÇßÀ» °æ¿ì "12300" À̶ó´Â StringÀ» ¸®ÅÏÇÑ´Ù. ' * @sig : value, length, char ' * @param : value required ¹®ÀÚ¿­ ' * @param : length required ¹®ÀÚ¿­ ±æÀÌ ' * @param : char required º¯°æÇÒ ¹®ÀÚ ' * @return : º¯È¯µÈ ½ºÆ®¸µ Function codeValueVald(value, length, char) codeValueVald = cfbeNumber(length, removeChar(trim(value),"*"), char) End Function '========================================================== ' ÇÔ ¼ö ¸í : Window_popup_center ' ÀÎ ÀÚ : url, winName, cw, ch ' ÇÔ¼ö ¼³¸í : ÆË¾÷âÀ» °¡¿îµ¥¿¡ ¶ç¿ì±â À§ÇÑ ÇÔ¼ö '========================================================== ' ÀÛ ¼º ÀÚ : ÀÓ¿ø¹¬ ' ÃÖÃÊÀÛ¼ºÀÏ : 2005-12-30 '========================================================== ' ÃÖÁ¾¼öÁ¤ÀÚ : ' ÃÖÁ¾¼öÁ¤ÀÏ : ' ¼öÁ¤ ³»¿ë : '========================================================== Function Window_popup_center(url, winName, cw, ch) Dim sw, sh, px, py sw = screen.availWidth sh = screen.availHeight px = (sw-cw)/2 py = (sh-ch)/2 Set Window_popup_center = window.open(url,winName, "left=" & px & ", top =" & py & ",width=" & cw &",height=" & ch & ",toolbar=no,menubar=no,status=yes,scrollbars=no,resizable=yes") End Function Dim windows_open_progress '========================================================== ' ÇÔ ¼ö ¸í : progress ' ÀÎ ÀÚ : ' ÇÔ¼ö ¼³¸í : ÆË¾÷âÀ» °¡¿îµ¥¿¡ ¶ç¿ì±â À§ÇÑ ÇÔ¼ö '========================================================== ' ÀÛ ¼º ÀÚ : ÃÖ¿ëÈ£ ' ÃÖÃÊÀÛ¼ºÀÏ : 2007-01-22 '========================================================== ' ÃÖÁ¾¼öÁ¤ÀÚ : ' ÃÖÁ¾¼öÁ¤ÀÏ : ' ¼öÁ¤ ³»¿ë : '========================================================== Function progress() Dim sw, sh, px, py, cw, ch cw = 360 ch = 130 sw = screen.availWidth sh = screen.availHeight px = (sw-cw)/2 py = (sh-ch)/2 Set progress = window.open("/saup/SCRIPT/searching.html","Progress", "left=" & px & ", top =" & py & ",width=" & cw &",height=" & ch & ",directories=no,hotkeys=no,titlebar=no,toolbar=no,menubar=no,location=no,scrollbars=no,statusbar=no,resizable=no") End Function '========================================================== ' ÇÔ ¼ö ¸í : search_wait_start ' ÀÎ ÀÚ : ' ÇÔ¼ö ¼³¸í : Á¶È¸ÁßÀÔ´Ï´Ù ¸Þ½ÃÁö¸¦ Ç¥ÇöÇϱâ À§ÇÑ ¸Þ½ÃÁö '========================================================== ' ÀÛ ¼º ÀÚ : ¾ç´ëÈ« ' ÃÖÃÊÀÛ¼ºÀÏ : 2006-05-28 '========================================================== ' ÃÖÁ¾¼öÁ¤ÀÚ : ' ÃÖÁ¾¼öÁ¤ÀÏ : ' ¼öÁ¤ ³»¿ë : '========================================================== Sub search_wait_start() Dim sw, sh, px, py sw = screen.availWidth sh = screen.availHeight ' MsgBox "sw=" & sw & ", sh=" & sh px = (sw+40)/3 py = (sh-110)/3 ' MsgBox "px=" & px & ", py=" & py document.all.waitFrame.style.top = py document.all.waitFrame.style.Left = px document.all.waitFrame.style.visibility = "visible" document.all.waitFrame.focus() End Sub '========================================================== ' ÇÔ ¼ö ¸í : search_wait_stop ' ÀÎ ÀÚ : ' ÇÔ¼ö ¼³¸í : Á¶È¸Áß ¸Þ½ÃÁö¸¦ ´Ý±â À§ÇÑ ¸Þ½ÃÁö '========================================================== ' ÀÛ ¼º ÀÚ : ¾ç´ëÈ« ' ÃÖÃÊÀÛ¼ºÀÏ : 2006-05-28 '========================================================== ' ÃÖÁ¾¼öÁ¤ÀÚ : ' ÃÖÁ¾¼öÁ¤ÀÏ : ' ¼öÁ¤ ³»¿ë : '========================================================== Sub search_wait_stop() document.all.waitFrame.style.visibility = "hidden" End Sub '========================================================== ' ÇÔ ¼ö ¸í : popup_search_wait_start ' ÀÎ ÀÚ : ' ÇÔ¼ö ¼³¸í : ÆË¾÷â¿¡¼­ [Á¶È¸ÁßÀÔ´Ï´Ù] ¸Þ½ÃÁö¸¦ Ç¥ÇöÇϱâ À§ÇÑ ¸Þ½ÃÁö '========================================================== ' ÀÛ ¼º ÀÚ : ¾ç´ëÈ« ' ÃÖÃÊÀÛ¼ºÀÏ : 2006-05-28 '========================================================== ' ÃÖÁ¾¼öÁ¤ÀÚ : ' ÃÖÁ¾¼öÁ¤ÀÏ : ' ¼öÁ¤ ³»¿ë : '========================================================== Sub popup_search_wait_start() Dim sw, sh, px, py sw = Document.body.clientwidth sh = Document.body.clientHeight ' MsgBox "sw=" & sw & ", sh=" & sh px = (sw-362)/2 py = (sh-110)/3 ' MsgBox "px=" & px & ", py=" & py document.all.waitFrame.style.top = py document.all.waitFrame.style.Left = px document.all.waitFrame.style.visibility = "visible" document.all.waitFrame.focus() End Sub '========================================================== ' ÇÔ ¼ö ¸í : popup_search_wait_stop ' ÀÎ ÀÚ : ' ÇÔ¼ö ¼³¸í : ÆË¾÷â¿¡¼­ Á¶È¸Áß ¸Þ½ÃÁö¸¦ ´Ý±â À§ÇÑ ¸Þ½ÃÁö '========================================================== ' ÀÛ ¼º ÀÚ : ¾ç´ëÈ« ' ÃÖÃÊÀÛ¼ºÀÏ : 2006-05-28 '========================================================== ' ÃÖÁ¾¼öÁ¤ÀÚ : ' ÃÖÁ¾¼öÁ¤ÀÏ : ' ¼öÁ¤ ³»¿ë : '========================================================== Sub popup_search_wait_stop() document.all.waitFrame.style.visibility = "hidden" End Sub ' * @type : function ' * @access : public ' * @desc : TEXT BOXÀÇ ¹®ÀÚ¿­À» ¹Þ¾ÆTrim µî ±âº» ¼öÇà ±â´ÉÀ» ÇÏ¿© °ªÀ» Àü´ÞÇÑ´Ù. ' °ªÀÌ ¾øÀ» °æ¿ì¿¡´Â %¹®ÀÚ¿­À» ¸®ÅÏÇÑ´Ù. ' *
' *     textValue(document.all.saup_nm)
' * 
' * À§¿Í°°ÀÌ »ç¿ëÇßÀ» °æ¿ì saup_nmÀÇ ÀԷ¹ÞÀº ¹®ÀÚ¿­À» ¸®ÅÏÇÑ´Ù. ' * °ªÀÌ ¾øÀ» °æ¿ì¿¡´Â %¸¦ ¹ÝȯÇÑ´Ù. ' * @sig : obj ' * @param : obj HTML ÀÇ OBJECT ' * @return : º¯È¯µÈ ½ºÆ®¸µ or % Function textValue(obj) Dim txt txt = Replace(Trim(obj.value),"*","") If(Len(txt) < 1 ) Then txt = "" End if textValue = txt End Function ' * @type : function ' * @access : public ' * @desc : ÇàÁ¤±¸¿ª Äڵ尪À» ºñ±³ÇÏ¿© Àü°ú ÈݪÀ» ä¿öÁØ´Ù. ' ' *
' *     getzone_cdvalue('11020', '')
' * 
' * À§¿Í°°ÀÌ »ç¿ëÇßÀ» °æ¿ì 1102000, 9999999À» ¹ÝȯÇÑ´Ù. ' * °ªÀÌ ¾øÀ» °æ¿ì¿¡´Â %¸¦ ¹ÝȯÇÑ´Ù. ' * @sig : obj ' * @param : obj HTML ÀÇ OBJECT ' * @return : º¯È¯µÈ ½ºÆ®¸µ or % Function getzone_cdvalue(obj1, obj2, length) Dim zone_cd(1), val1, val2 val1 = codeValueVald(obj1.value, length, "0") val2 = codeValueVald(obj2.value, length, "9") zone_cd(0) = val1 zone_cd(1) = val2 getzone_cdvalue = zone_cd End Function ' * @type : function ' * @access : public ' * @desc : »ê¾÷ºÐ·ù Äڵ尪À» ºñ±³ÇÏ¿© Àü°ú ÈݪÀ» ä¿öÁØ´Ù. ' ' *
' *     getsnb_cdvalue('110', '')
' * 
' * À§¿Í°°ÀÌ »ç¿ëÇßÀ» °æ¿ì 11000, 9999À» ¹ÝȯÇÑ´Ù. ' * °ªÀÌ ¾øÀ» °æ¿ì¿¡´Â %¸¦ ¹ÝȯÇÑ´Ù. ' * @sig : obj ' * @param : obj HTML ÀÇ OBJECT ' * @return : º¯È¯µÈ ½ºÆ®¸µ or % Function getsnb_cdvalue(obj1, obj2) Dim snb_cd(1), val1, val2 val1 = codeValueVald(obj1.value, 5, "0") val2 = codeValueVald(obj2.value, 5, "9") snb_cd(0) = val1 snb_cd(1) = val2 getsnb_cdvalue = snb_cd End Function ' * @type : function ' * @access : public ' * @desc : °ª¿¡ ´ëÇÏ¿© ¹®ÀÚ¿­°ú NULL¿¡ ´ëÇÏ¿© üũ¸¦ ÇÏ¿© °ªÀÇ À¯¹«¿¡ ´ëÇÏ¿© È®ÀÎÇÑ´Ù. ' ' *
' *     chkValue('aaa')
' * 
' * À§¿Í°°ÀÌ »ç¿ëÇßÀ» °æ¿ì false¸¦ ¹ÝȯÇÑ´Ù. ' * °ªÀÌ ¾øÀ» °æ¿ì¿¡´Â true ¹ÝȯÇÑ´Ù. ' * @sig : val ' * @param : val ºñ±³ÇÒ °ª ' * @return : true, false Function chkValue(val) Dim ret ret = false If Len(val) < 1 Then ret = true End if chkValue = ret End Function ' * @type : function ' * @access : public ' * @desc : OBJECT¿¡ ´ëÇÏ¿© ¹®ÀÚ¿­°ú NULL¿¡ ´ëÇÏ¿© üũ¸¦ ÇÏ¿© °ªÀÇ À¯¹«¿¡ ´ëÇÏ¿© È®ÀÎÇÑ´Ù. ' ' *
' *     chkObj(document.all.saup_nm)
' * 
' * À§¿Í°°ÀÌ »ç¿ëÇßÀ» °æ¿ì false¸¦ ¹ÝȯÇÑ´Ù. ' * °ªÀÌ ¾øÀ» °æ¿ì¿¡´Â true¸¦ ¹ÝȯÇÑ´Ù. ' * @sig : val ' * @param : val ºñ±³ÇÒ °ª ' * @return : true, false Function chkObj(obj) Dim ret ret = false ' If obj Is Null Or chkValue(obj.value) Then If chkValue(textValue(obj)) Then ret = true End if chkObj = ret End Function ' * @type : function ' * @access : public ' * @desc : Input Box¿¡ ´ëÇÑ À̺¥Æ® »ç¿ëÀ¸·Î ' * ¼ýÀÚÀÌ¿ÜÀÇ °ªÀÌ µé¾î¿À¸é ¸¶Áö¸·À¸·Î ÀÔ·ÂÇÑ °ªÀº Á¦¿ÜÇϰí ÇØ´ç ÀÎDz¹Ú½º¿¡ »ðÀÔÇÑ´Ù. ' *
' *     chkNumber(document.all.saup_nm)
' * 
' * À§¿Í°°ÀÌ »ç¿ëÇßÀ» °æ¿ì ¼ýÀÚÀÎÁö ÆÇ´ÜÇÏ¿© ¹®ÀÚÀ̸é Áö¿öÁÖ°í ¼ýÀÚÀÌ¸é ±×´ë·Î ÇÑ´Ù. ' * ÀÎÀÚ·Î ¹ÞÀº OBJECT¿¡ ´ëÇÏ¿© Á÷Á¢ ÀÔ·Â ' * @sig : obj ' * @param : obj HTML OBJECT Function chkNumber(obj) Dim tmp tmp = obj.value If Len(tmp) <> 0 then If InStr("0123456789",Mid(tmp,Len(tmp),1)) = 0 then obj.value = Mid(tmp,1,Len(tmp)-1) obj.focus End If End if End Function ' * @type : function ' * @access : public ' * @desc : OBJECT¿¡ ´ëÇÑ TypeÀÌ ¼³Á¤µÇ¾î ÀÖÀ»¶§ ŸÀÔÀ» ¹ÝȯÇÏ¿© NUMBERüũ¸¦ Çϵµ·Ï ÇÑ´Ù. ' *
' *     EV_GetFormType(document.all.saup_nm)
' * 
' * ' * @sig : obj ' * @param : obj HTML OBJECT ' * C : Code Type ' * N : Number Type ' * S : String Type ' * @return ¼ýÀÚ¸é True, StringÀ̸é false function EV_GetInputType(Obj) on error resume Next If UCase(obj.tagName) = "INPUT" Then If UCase(obj.type) = "TEXT" Then select case ObjType.itype Case "C" Case "N" chkNumber(obj) end Select End if End If EV_GetInputType = obj on error goto 0 End Function ' * @type : function ' * @access : public ' * @desc : OBJECT¿¡ ´ëÇÑ Tag NameÀ» ¹ÝȯÇÑ´Ù. ' *
' *     EV_GetTagName(document.all.saup_nm)
' * 
' * @sig : obj ' * @param : obj HTML OBJECT Function EV_GetTagName(ObjType) Dim ret on error resume next select case ObjType.tagName Case "TEXTAREA" ret = "TEXTAREA" case "INPUT" ret = "INPUT" Case "SELECT" ret = "SELECT" case else ret = "" end Select EV_GetTagName = ret on error goto 0 End function ' * @type : function ' * @access : public ' * @desc : OBJECT¿¡ ´ëÇÑ Tag TypeÀ» ¹ÝȯÇÑ´Ù. ' *
' *     EV_GetTypeName(document.all.saup_nm)
' * 
' * @sig : obj ' * @param : obj HTML OBJECT Function EV_GetTypeName(ObjType) Dim ret on error resume Next select case ObjType.type case "text" ret = "text" Case "select-one" ret = "select-one" Case "textarea" ret = "textarea" Case "checkbox" ret = "checkbox" If ObjType.checked = True Then ObjType.value = "1" Else ObjType.value = "0" End if case else ret = "" end Select EV_GetTypeName = ret on error goto 0 End Function ' * @type : function ' * @access : public ' * @desc : °¢ Åë°è ¾÷¹«¿¡ ´ëÇÑ Å×À̺í¸í, ÆäÀÌÁö°æ·Î, ŰÇʵ带 ¼ÂÇÏ¿© ¹ÝȯÇÑ´Ù. ' *
' *     getSystemInfo("A")
' * 
' * À§¿Í °°ÀÌ ÀÔ·ÂÇÏ¿´À» °æ¿ì¿¡ ÇØ´ç ½Ã½ºÅÛÀÇ °æ·Î¸¦ ¹ÝȯÇÑ´Ù. ' * @sig : sid ' * @param : sid Åë°Ô ¾÷¹« ÄÚµå ' * @return : Info(0) Å×À̺í¸í ' * Info(1) °æ·Î ' * Info(2) Key Çʵå Function getSystemInfo(sid) Dim Info(2) on error resume Next select case sid case "A" Info(0) = "ASAMOT" Info(1) = "ASAMO" Info(2) = "<%=InfoCache.SYSINFO().getSystemInfo(""A"",""SEQNO_FIELD_NAME"")%>" case "B" Info(0) = "BKIMOT" Info(1) = "BKIMO" Info(2) = "<%=InfoCache.SYSINFO().getSystemInfo(""B"",""SEQNO_FIELD_NAME"")%>" case "D" Info(0) = "DSAUPBASET" Info(1) = "DSAUP" Info(2) = "<%=InfoCache.SYSINFO().getSystemInfo(""D"",""SEQNO_FIELD_NAME"")%>" case "E" Info(0) = "EKWANGJOSAT" Info(1) = "EKWANG" Info(2) = "<%=InfoCache.SYSINFO().getSystemInfo(""E"",""SEQNO_FIELD_NAME"")%>" case "F" Info(0) = "FDONGSAUPT" Info(1) = "FDONG" Info(2) = "<%=InfoCache.SYSINFO().getSystemInfo(""F"",""SEQNO_FIELD_NAME"")%>" case "K" Info(0) = "KDOSOJOSAT" Info(1) = "KDOSO" Info(2) = "<%=InfoCache.SYSINFO().getSystemInfo(""K"",""SEQNO_FIELD_NAME"")%>" case "T" Info(0) = "TTRANJOSAV" Info(1) = "TTRAN" Info(2) = "<%=InfoCache.SYSINFO().getSystemInfo(""T"",""SEQNO_FIELD_NAME"")%>" case else msgbox "À߸øµÈ Á¤º¸ÀÔ´Ï´Ù." end select getSystemInfo = Info on error goto 0 End Function ' * @type : function ' * @access : public ' * @desc : µé¾î¿Â °ªÀ» È®ÀÎÇÏ¿© ±æÀ̸¸Å­ ¾Õ¿¡ 0À» ä¿ö ³Ö´Â´Ù. ' ' *
' *     getzone_cdvalue('11020', '')
' * 
' * À§¿Í°°ÀÌ »ç¿ëÇßÀ» °æ¿ì 1102000, 9999999À» ¹ÝȯÇÑ´Ù. ' * °ªÀÌ ¾øÀ» °æ¿ì¿¡´Â %¸¦ ¹ÝȯÇÑ´Ù. ' * @sig : obj ' * @param : obj HTML ÀÇ OBJECT ' * @return : º¯È¯µÈ ½ºÆ®¸µ or % Function getbefore_value(obj1, obj2, length) Dim before(1), val1, val2, defalut, i defalut = "" For i = 0 To length - 1 defalut = defalut & "0" next val1 = Left(defalut,Len(defalut) - Len(obj1.value)) & obj1.value val2 = Left(defalut,Len(defalut) - Len(obj2.value)) & obj2.value before(0) = val1 before(1) = val2 getbefore_value = before End Function