Files
2026-02-23 10:01:00 +09:00

2023 lines
55 KiB
Plaintext

<%
'------------- List ---------------------------------------------------
'1. 문자열처리함수1 - InputValue(strvalue)
'2. 문자열처리함수2 - InputValue2(strvalue) -->textarea적용시에사용..
'3. 대분류명구하기 - fun_cateLName(CateL_idx)
'4. 소분류명구하기 - fun_cateSName(CateL_idx, CateS_idx)
'5. 생년월일로 나이구하기 - mnai (ssn)
'6. 인기검색어나타내기 - TopSearch_Keyword(val)
'7. DBConnection - dbconnect() ->sub함수
'8. 관리자페이지 체크 - security_admin()
'9. 캐쉬초기화 - no_cache()
'10. 폴더검사후 없으면 생성 - FolderCreate(strDir)
'11. DB연결해제 - DBnothing() -->삭제예정..
'12. <tr>마우스오버시색상적용 - trmouseover(clr)
'13. 레코드셋연결해제 - RSnothing(rsobj)
'14. 관리자페이지타이틀
'15. 게시판 제목알아내기 bbs_name_str(a_num)
'16. 팝업띄우는모듈 popup_view()
'----------------------------------------------------------------------
'Set func = server.CreateObject("func.sites")
'************** Information ****************************************
' Program Title : 문자열처리구문1
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 03. 05
'*********************************************************************
'function InputValue(strvalue)
' strvalue = trim(strvalue)
' strvalue = Replace(strvalue,"'","''")
'strvalue = Replace(strvalue,chr(34), "&#34")
'strvalue = Replace(strvalue,",", "")
'strvalue = Replace(strvalue,"%", "")
'strvalue = Replace(strvalue,"<", "&lt")
'strvalue = Replace(strvalue,">", "&gt")
'strvalue = Replace(strvalue, "<title>", "")
'strvalue = Replace(strvalue, "</title>", "")
'strvalue = Replace(strvalue,chr(13),"<br>")
'strvalue = Replace(strvalue,"\","")
' strvalue = Replace(strvalue," ","&nbsp;&nbsp;")
' strvalue = Replace(strvalue,"\t","&nbsp;&nbsp;&nbsp;")
' InputValue = strvalue
'end function
'function InputValue(strvalue)
' strvalue = func.InputValue(strvalue)
' InputValue = strvalue
'end function
'************** Information ****************************************
' Program Title : 문자열처리구문2
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 03. 05
'*********************************************************************
'function InputValue2(strvalue)
'strvalue = trim(strvalue)
'strvalue = Replace(strvalue,"'","''")
'strvalue = Replace(strvalue,",", "")
'strvalue = Replace(strvalue,"%", "")
'strvalue = Replace(strvalue,"<", "&lt")
'strvalue = Replace(strvalue,">", "&gt")
'strvalue = Replace(strvalue, "<title>", "")
'strvalue = Replace(strvalue, "</title>", "")
'strvalue = Replace(strvalue,chr(13),"<br>")
'strvalue = Replace(strvalue,"\","")
' strvalue = Replace(strvalue," ","&nbsp;&nbsp;")
' strvalue = Replace(strvalue,"\t","&nbsp;&nbsp;&nbsp;")
' InputValue2 = strvalue
'end function
'************** Information ****************************************
' Program Title : 문자열처리구문1
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 03. 05
'*********************************************************************
function InputValue(strvalue)
strvalue = trim(strvalue)
strvalue = Replace(strvalue,"'","''")
strvalue = Replace(strvalue,chr(34), "&#34")
strvalue = Replace(strvalue, "<title>", "")
strvalue = Replace(strvalue, "</title>", "")
InputValue = strvalue
end function
'************** Information ****************************************
' Program Title : 문자열처리구문2
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 03. 05
'*********************************************************************
function InputValue2(strvalue)
strvalue = trim(strvalue)
strvalue = Replace(strvalue,"'","''")
strvalue = Replace(strvalue, "<title>", "")
strvalue = Replace(strvalue, "</title>", "")
InputValue2 = strvalue
end function
'************** Information ****************************************
' Program Title : 문자열처리구문3
' Company : (주)나우아이텍 (053)955-9055
' Creator : 최 경 수 2006. 3. 14
'*********************************************************************
Function InputValue3( CheckValue )
CheckValue = replace(CheckValue, "&" , "&amp;")
CheckValue = replace(CheckValue, "<", "&lt;")
CheckValue = replace(CheckValue, ">", "&gt;")
CheckValue = replace(CheckValue, "'", "`")
CheckValue = replace(CheckValue, " ", "&nbsp;&nbsp;")
CheckValue = replace(CheckValue, vbcrlf,"<br>")
InputValue3 = CheckValue
End Function
'텍스트에리어에서 불러질 경우
Function outputValue( CheckValue )
CheckValue = replace(CheckValue, "&amp;", "&")
CheckValue = replace(CheckValue, "&lt;", "<")
CheckValue = replace(CheckValue, "&gt;", ">")
CheckValue = replace(CheckValue, "&nbsp;&nbsp;", " ")
CheckValue = replace(CheckValue, "<br>", vbcrlf)
outputValue = CheckValue
End Function
'************** Information ****************************************
' Program Title : 대분류명
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 03. 05
'*********************************************************************
function fun_cateLName(CateL_idx)
SQL = "SELECT CateL_name FROM C_CateL WHERE CateL_idx="&CateL_idx
Set Rsx = Dbcon.Execute(SQL)
CateL_name = Rsx(0)
Set Rsx = Nothing
fun_cateLName = CateL_name
end function
'************** Information ****************************************
' Program Title : 소분류명
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 03. 05
'*********************************************************************
function fun_cateSName(CateL_idx, CateS_idx)
SQL = "SELECT CateS_name FROM C_CateS WHERE CateL_idx="&CateL_idx&"and CateS_idx = "&CateS_idx
Set Rsx = Dbcon.Execute(SQL)
CateS_name = Rsx(0)
Set Rsx = Nothing
fun_cateSName = CateS_name
end function
'************** Information ****************************************
' Program Title : 나이구하는함수
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 03. 10
'*********************************************************************
function mnai (ssn)
dim y_mon, ssn_r
y_mon=cint((year(date())-cint("19" & left(ssn,2)))/4)
if mid(ssn,7,1)="1" or mid(ssn,7,1)="2" then
ssn_r = "19" & left(ssn,2) & "-" & mid(ssn,3,2) & "-" & mid(ssn,5,2)
else
ssn_r = "20" & left(ssn,2) & "-" & mid(ssn,3,2) & "-" & mid(ssn,5,2)
end if
mnai = fix((datediff("d",cdate(ssn_r),date())-y_mon)/365)
End Function
'************** Information ****************************************
' Program Title : 인기검색어
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 03. 05
'*********************************************************************
function TopSearch_Keyword(val)
sql = "select top "&val&" search_keyword, count(search_keyword) as tot from C_search group by search_keyword order by tot desc"
set rs_keyword = dbcon.execute(sql)
do while not rs_keyword.eof
response.write "&nbsp;&nbsp;"&rs_keyword("search_keyword")
rs_keyword.MoveNext
Loop
Set rs_keyword = Nothing
end function
'************** Information ****************************************
' Program Title : 관리자페이지 체크
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 05. 13
'*********************************************************************
function security_admin()
If Request.Cookies("security_admin") <> "ok" then
response.write "<SCRIPT LANGUAGE='JavaScript'>" & VbCrLf
response.write "alert('당신은 보안을 위반했거나 연결이 끊겼습니다.');" & VbCrLf
' response.write "top.location.href='/admin/default.html';" & VbCrLf
response.write "top.location.href='/admin/default.asp';" & VbCrLf
response.write "</SCRIPT>" & VbCrLf
response.end
end if
end function
'************** Information ****************************************
' Program Title : 회원로그인 체크
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 05. 13
'*********************************************************************
function member_login_chk(url)
If Request.Cookies("M_id") = "" then
response.write "<SCRIPT LANGUAGE='JavaScript'>" & VbCrLf
response.write "alert('로그인 하세요');" & VbCrLf
response.write "top.location.href='"&url&"';" & VbCrLf
response.write "</SCRIPT>" & VbCrLf
set dbcon = nothing
response.end
end if
end function
'************** Information ****************************************
' Program Title : 관리자 체크
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 05. 13
'*********************************************************************
function no_cache()
Response.Expires = -1
Response.Expiresabsolute = Now() - 1
Response.AddHeader "Pragma", "no_cache"
Response.AddHeader "cache-control", "no-cache"
Response.CacheControl = "no-cache"
end function
'************** Information ****************************************
' Program Title : 폴더검사후 없으면 생성
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 05. 13
'*********************************************************************
function FolderCreate(strDir)
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
If FSO.FolderExists(strDir) = False Then '폴더가 없으면 새로 생성한다..
FSO.CreateFolder(strDir)
End if
set FSO = nothing
end function
'************** Information ****************************************
' Program Title : DB연결해제
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 05. 13
'*********************************************************************
function DBnothing()
dbcon.close
set dbcon = nothing
end function
'************** Information ****************************************
' Program Title : DB연결해제
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 05. 13
'*********************************************************************
function page(url)
v_temp = Int((v_page - 1) / v_block) * v_block + 1
If v_temp = 1 Then
'Response.Write "[이전 " & v_block & "개]"
Else
Response.Write"<a href="&url&"?p_page="&v_temp-v_block&"&p_search="&v_search&"&p_keyword="&v_keyword&">[이전]</a>"
End If
v_loop = 1
Do Until v_loop > v_block Or v_temp > v_totalpage
If v_temp = CInt(v_page) Then
Response.Write "" & v_temp &"&nbsp;"
Else
Response.Write"<a href="&url&"?p_page="&v_temp&"&p_search="&v_search&"&p_keyword="&v_keyword&">" & v_temp & "</a>&nbsp;"
End If
v_temp = v_temp + 1
v_loop = v_loop + 1
Loop
If v_temp > v_totalpage Then
'Response.Write "[다음 " &v_block&"개]"
Else
Response.Write"<a href="&url&"?p_page="&v_temp&"&p_search="&v_search&"&p_keyword="&v_keyword&">[다음]</a>"
End If
end function
'************** Information ****************************************
' Program Title : 페이지2
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 05. 13
'*********************************************************************
function page2(url)
v_temp = Int((v_page - 1) / v_block) * v_block + 1
If v_temp = 1 Then
'Response.Write "[이전 " & v_block & "개]"
Else
Response.Write"<a href="&url&"&p_page="&v_temp-v_block&"&p_search="&v_search&"&p_keyword="&v_keyword&"><img src='/program/address/image/prev.gif' border='0' align='absmiddle'></a>"
End If
v_loop = 1
Do Until v_loop > v_block Or v_temp > v_totalpage
If v_temp = CInt(v_page) Then
Response.Write "<font color='ED8000'><b>" & v_temp &"</b></font>&nbsp;"
Else
Response.Write"<a href="&url&"&p_page="&v_temp&"&p_search="&v_search&"&p_keyword="&v_keyword&">[" & v_temp & "]</a>&nbsp;"
End If
v_temp = v_temp + 1
v_loop = v_loop + 1
Loop
If v_temp > v_totalpage Then
'Response.Write "[다음 " &v_block&"개]"
Else
Response.Write"<a href="&url&"&p_page="&v_temp&"&p_search="&v_search&"&p_keyword="&v_keyword&"><img src='/program/address/image/next.gif' border='0' align='absmiddle'></a>"
End If
end function
'************** Information ****************************************
' Program Title : 페이지3
' Company : (주)나우아이텍 (053)955-9055
' Creator : 최 경 수 2006. 03. 14
'*********************************************************************
Function page3(url, getCode)
v_temp = Int((v_page - 1) / v_block) * v_block + 1
If v_temp = 1 Then
'Response.Write "[이전 " & v_block & "개]"
Else
Response.Write"<a href="&url& getCode & "p_page="&v_temp-v_block&"&p_search="&v_search&"&p_keyword="&v_keyword&">[이전]</a>"
End If
v_loop = 1
Do Until v_loop > v_block Or v_temp > v_totalpage
If v_temp = CInt(v_page) Then
Response.Write "" & v_temp &"&nbsp;"
Else
Response.Write"<a href="&url&getCode&"p_page="&v_temp&"&p_search="&v_search&"&p_keyword="&v_keyword&">" & v_temp & "</a>&nbsp;"
End If
v_temp = v_temp + 1
v_loop = v_loop + 1
Loop
If v_temp > v_totalpage Then
'Response.Write "[다음 " &v_block&"개]"
Else
Response.Write"<a href="&url&getCode&"p_page="&v_temp&"&p_search="&v_search&"&p_keyword="&v_keyword&">[다음]</a>"
End If
end Function
'************** Information ****************************************
' Program Title : <tr>마우스오버시색상적용
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 05. 13
'*********************************************************************
function trmouseover(clr)
response.write "onMouseOver=this.style.backgroundColor='"&clr&"' onMouseOut=this.style.backgroundColor=''"
end function
'************** Information ****************************************
' Program Title : 레코드셋연결해제
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 05.
'*********************************************************************
function RSnothing(rsobj)
rsobj.close
set rsobj = nothing
end function
'************** Information ****************************************
' Program Title : 타이틀
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 05.
'*********************************************************************
function title_str(str,w)
%>
<table width='<%=w%>' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td>
<table border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width=><img src='/admin/image/title_icon.gif'></td>
<td style="font-size:13pt;font-weight:bold;letter-spacing:-1px;"><%=str%></td>
</tr>
</table>
</td>
</tr>
</table>
<table width='<%=w%>' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td><img src='/admin/image/tit_left.gif' width='10' height='4' border='0'></td>
<td width='100%'><img src='/admin/image/tit_bg.gif' width='100%' height='4' border='0'></td>
<td><img src='/admin/image/tit_right.gif' width='10' height='4' border='0'></td>
</tr>
<tr>
<td height='10'></td>
</tr>
</table>
<%
end function
'************** Information ****************************************
' Program Title : 타이틀
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 05.
'*********************************************************************
function title_str2(str,w,help)
%>
<!-- Title 시작 -->
<table width="<%=w%>" cellspacing="0" cellpadding="0">
<tr height="6">
<td colspan="3"></td>
</tr>
<tr height="48">
<td background="/admin/image/ntit_left.gif" style="padding-right:25;padding-left:15;" nowrap><%=str%></td>
<td background="/admin/image/ntit_bg.gif" width="100%"><%=help%></td>
<td background="/admin/image/ntit_right.gif" width="5"><img width="5" height="0"></td>
</tr>
<tr height="15">
<td colspan="3"></td>
</tr>
</table>
<!-- Title 끝 -->
<%
end function
'************** Information ****************************************
' Program Title : 타이틀
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 05.
'*********************************************************************
function title_str3(str,path)
%>
<!-- Title 시작 -->
<br>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td class="gulim pl15 pb10"><img src="/img/tit_ic.gif" width="22" height="16" border=0 align="absmiddle"><b><font size="2"><%=str%></font></b></td>
<td align="right" class="pr20"><img src="/img/loc_ic.gif" width="17" height="10" align="absmiddle"><%=path%></td>
</tr>
</table>
<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td><img src='/admin/image/tit_left.gif' width='10' height='4' border='0'></td>
<td width='100%'><img src='/admin/image/tit_bg.gif' width='100%' height='4' border='0'></td>
<td><img src='/admin/image/tit_right.gif' width='10' height='4' border='0'></td>
</tr>
<tr>
<td height='10'></td>
</tr>
</table>
<!-- Title 끝 -->
<%
end function
'************** Information ****************************************
' Program Title : 게시판 제목알아내기bbs_name_str(a_num)
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 03. 05
'*********************************************************************
function bbs_name_str(a_num)
if a_num <> "" then
sql = "select a_bbsname from bbs_admin where a_num="&a_num
set rs = dbcon.execute(sql)
a_bbsname = rs(0)
set rs = nothing
end if
bbs_name_str = a_bbsname
end function
'************** Information ****************************************
' Program Title : 팝업띄우는 모듈 popup_view()
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 09. 03
'*********************************************************************
function popup_view()
getdate_str = replace(left(now(),10),"-","")
sql = " select * from popup "
sql = sql&" where status = 'Y' and "
'sql = sql&" left(edate,10) >= left(getdate(),10) and left(sdate,10) <= left(getdate(),10)"
sql = sql&" convert(int,convert(varchar(20),edate,112)) >= CONVERT(int,'"&getdate_str&"') and "
sql = sql&" convert(int,convert(varchar(20),sdate,112)) <= CONVERT(int,'"&getdate_str&"')"
set rs = Dbcon.Execute(sql)
do while not rs.eof
idx = trim(rs("idx"))
w_width = trim(rs("w_width"))
w_height = trim(rs("w_height"))
w_top = trim(rs("w_top"))
w_left = trim(rs("w_left"))
ck_chk = trim(rs("ck_chk"))
ck_val = trim(rs("ck_val"))
scrollbars = trim(rs("scrollbars"))
toolbar = trim(rs("toolbar"))
menubar = trim(rs("menubar"))
locations = trim(rs("locations"))
if ck_val = "" then ck_val = "1"
%>
<SCRIPT language="JavaScript">
<!--
<% if ck_chk = "Y" then %>
// 팝업창 띄우지 않게 하기 시작
function ReadCookie(name){
var nameOfCookie=name+"=";
//alert(nameOfCookie);
var x=0;
while(x<=document.cookie.length)
{
var y=(x+nameOfCookie.length)
if(document.cookie.substring(x,y)==nameOfCookie)
{
if((endOfCookie=document.cookie.indexOf(";",y))==-1)
endOfCookie=document.cookie.length;
return unescape(document.cookie.substring(y,endOfCookie));
}
x=document.cookie.indexOf(" ",x) +1;
if(x==0)
break;
}
return "";
}
function bd_popup_win(){
var ck = ReadCookie( "pop<%=idx%>" );
if ( ck == "<%=ck_val%>" ){
return;
}else{
window.open('/program/popup/view.asp?idx=<%=idx%>','bd_popup<%=idx%>','scrollbars=<%=scrollbars%>,toolbar=<%=toolbar%>,menubar=<%=menubar%>,location=<%=locations%>,width=<%=w_width%>,height=<%=w_height%>,left=<%=w_left%>, top=<%=w_top%>');
}
}
bd_popup_win();
<% else '-- 쿠키사용을 하지 않는다면.... %>
window.open('/program/popup/view.asp?idx=<%=idx%>','bd_popup<%=idx%>','scrollbars=<%=scrollbars%>,toolbar=<%=toolbar%>,menubar=<%=menubar%>,location=<%=locations%>,width=<%=w_width%>,height=<%=w_height%>,left=<%=w_left%>, top=<%=w_top%>');
<% end if %>
//-->
</SCRIPT>
<%
rs.movenext
loop
end function
'************** Information ****************************************
' Program Title : 좋은시 보기 goodsi_view()
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2006-01-27
'*********************************************************************
function goodsi_view()
getdate_str = replace(left(now(),10),"-","")
sql = " select * from goodsi "
sql = sql&" where status = 'Y' and "
'sql = sql&" left(edate,10) >= left(getdate(),10) and left(sdate,10) <= left(getdate(),10)"
sql = sql&" convert(int,convert(varchar(20),edate,112)) >= CONVERT(int,'"&getdate_str&"') and "
sql = sql&" convert(int,convert(varchar(20),sdate,112)) <= CONVERT(int,'"&getdate_str&"')"
set rs = Dbcon.Execute(sql)
%>
<marquee direction="up" scrollamount="1" width="150" height="100">
<span class="굴림12">
<%
do while not rs.eof
idx = trim(rs("idx"))
w_width = trim(rs("w_width"))
w_height = trim(rs("w_height"))
w_top = trim(rs("w_top"))
w_left = trim(rs("w_left"))
ck_chk = trim(rs("ck_chk"))
ck_val = trim(rs("ck_val"))
scrollbars = trim(rs("scrollbars"))
toolbar = trim(rs("toolbar"))
menubar = trim(rs("menubar"))
locations = trim(rs("locations"))
subject = trim(rs("subject"))
content = trim(rs("content"))
%>
<%=content%><br><br>
<%
rs.movenext
loop
%>
</span>
</marquee>
<%
end function
'--------------------------------------------------------------'
' 태그삭제 remove_tags( str )
'--------------------------------------------------------------'
function remove_tags( str )
dim temp, dest, length, i, ch, tag
tag = false
dest = ""
temp = str
length = len(temp)
for i=1 to length
ch = mid( temp, i, 1 )
if ( ch="<" ) then tag = true
if ( ch=">" ) then
tag = false
ch=""
end if
if not tag and ch<>chr(13) and ch<>chr(10) and ch<>chr(9) then dest = dest+ch
next
dest = replace( dest, " ", "" )
remove_tags = dest
end function
'이미지 사이즈 가져오기
Function GetImageSize(Virtual_Image_Path)
Image_Path = Server.MapPath("/")&Virtual_Image_Path
Set objPic = LoadPicture(Image_Path)
imgWidth = CLng(CDbl(objPic.Width) * 24 / 635)
imgHeight = CLng(CDbl(objPic.Height) * 24 / 635)
Set objPic = Nothing
GetImageSize =imgWidth&","&imgHeight
End Function
'--------------------------------------------------------------'
' 지정한 폭(max)만큼 문자열 조절 (한글을 2바이트로 인식)
'--------------------------------------------------------------'
'
' str : 잘라낼 문자열 변수
' max : 잘라낼 길이
' br : max단위로 <br> 태그를 붙여준다.
'
' 문자열을 한줄에 80자씩 만들 경우
' : StringToHTML( str, 80, true )
'
' 80자 까지만 출력하고 더 길면 "..."을 붙여주려면
' : StringToHTML( str, 80, false )
'
'--------------------------------------------------------------'
function StringToHTML( str, max, br )
Dim i, length, buf, tmp, count, count2, ch, first
first = false
if ( isnull(str) ) then
StringToHTML = "ㅋㅋㅋ"
Exit Function
end if
if max>0 then
buf = Trim( str )
'buf = Replace( buf, CHR(9), " " )
'buf = Replace( buf, CHR(13), "" )
length = len( buf )
count = 1
count2 = 0
tmp = ""
for i=1 to length
if count>max then
if br=false then
tmp = tmp & "..."
exit for
end if
if i<length-1 then tmp = tmp & "<BR>"
count = 1
first = true
end if
ch = mid( buf, i, 1 )
if ch=CHR(10) then
if br=false then
exit for
end if
tmp = tmp & "<BR>"
count = 1
first = true
elseif count>1 AND ch=CHR(32) then
if not first then
tmp = tmp & " "
end if
elseif count = 1 and ch = CHR(32) then
tmp = tmp
else
tmp = tmp & ch
first = false
end if
if asc(ch)<0 then '한글이면
count = count+2
else '영문이면
count = count+1
end if
next
else
tmp = str
tmp = Trim( tmp )
tmp = Replace( tmp, "&", "&amp;" )
tmp = Replace( tmp, "<", "&lt;" )
tmp = Replace( tmp, ">", "&gt;" )
'tmp = Replace( tmp, CHR(10), "<BR>" )
'tmp = Replace( tmp, CHR(32), " " )
end if
StringToHTML = tmp
end function
'---------------------sms 용 수정 최경수---------------
function StringToHTML2( str, max, br )
Dim i, length, buf, tmp, count, count2, ch, first
first = false
if ( isnull(str) ) then
StringToHTML = "ㅋㅋㅋ"
Exit Function
end if
if max>0 then
buf = Trim( str )
'buf = Replace( buf, CHR(9), " " )
'buf = Replace( buf, CHR(13), "" )
length = len( buf )
count = 1
count2 = 0
tmp = ""
for i=1 to length
if count>max then
if br=false then
tmp = tmp & "..."
exit for
end if
if i<length-1 then tmp = tmp & "<BR>"
count = 1
first = true
end if
ch = mid( buf, i, 1 )
'if ch=CHR(10) then
'if br=false then
' exit for
'end if
'tmp = tmp & "<BR>"
'count = 1
'first = true
'Else
if count>1 AND ch=CHR(32) then
if not first then
tmp = tmp & " "
end if
elseif count = 1 and ch = CHR(32) then
tmp = tmp
else
tmp = tmp & ch
first = false
end if
if asc(ch)<0 then '한글이면
count = count+2
else '영문이면
count = count+1
end if
next
else
tmp = str
tmp = Trim( tmp )
tmp = Replace( tmp, "&", "&amp;" )
tmp = Replace( tmp, "<", "&lt;" )
tmp = Replace( tmp, ">", "&gt;" )
'tmp = Replace( tmp, CHR(10), "<BR>" )
'tmp = Replace( tmp, CHR(32), " " )
end if
StringToHTML2 = tmp
end function
sub loding(st,strlink)
%>
<META HTTP-EQUIV="refresh" CONTENT="<%=st%>; url=<%=strlink%>">
<div align=center>
<table width="400">
<tr>
<td height="40"><!--<br><b><center>[처리중]</b><br><br>--></td>
</tr>
<tr>
<td align="center"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="300" height="115">
<param name="movie" value="/include/lib/loding.swf">
<param name="quality" value="high">
<embed src="/include/lib/loding.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="300" height="115"></embed></object></td>
</tr>
<tr>
<td align="center">&nbsp;</td>
</tr>
</table>
</html>
</div>
<%
end sub
'************** Information ****************************************
' Program Title : 폴더유무확인
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2005-10-19
'*********************************************************************
function isdir(strDirectory)
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
If FSO.FolderExists(strDirectory) = False Then '폴더가 없으면 새로 생성한다..
FSO.CreateFolder(strDirectory)
End if
Set FSO = Nothing
end function
'************** Information ****************************************
' Program Title : 업로드파일저장하기(dext버젼)
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 05
'*********************************************************************
function wfile(filedname, maxMbyte, strDirectory)
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
if Len(UploadForm(filedname)) > 0 then
'strDirectory = server.MapPath("./")&"\data\"&a_tablename&"\"
If FSO.FolderExists(strDirectory) = False Then '폴더가 없으면 새로 생성한다..
FSO.CreateFolder(strDirectory)
End if
'--파일 정보추출
fileName = UploadForm(filedname).FileName '파일이름..
filePath = UploadForm(filedname).FilePath '절대경로..
fileSize = UploadForm(filedname).FileLen '파일사이즈..
saveFileName = strDirectory & fileName '실제 저장되 경로에 파일...
'--확장장와 파일 이름 분리
strfile = split(fileName,".")
strName = strfile(0) '파일명
strExt = strfile(1) '확장자
'-- 파일크기가 검사
'1MByte = 1048576Byte
if Round(fileSize) > Round(1048576 * maxMbyte) then
response.write "<SCRIPT LANGUAGE='JavaScript'>" & VbCrLf
response.write "alert('파일크기가"& maxMbyte &"MByte 이하여만 합니다.');" & VbCrLf
response.write "history.back();" & VbCrLf
response.write "</SCRIPT>" & VbCrLf
Set UploadForm = nothing
Set FSO = nothing
response.end
end if
'같은 파일 이 존재할경우 --> _1,_2 이런식으로 파일명 변경..ㅡㅡv
bExist = True
count= 0
Do While bExist
If (FSO.FileExists(saveFileName)) Then
count = count + 1
FileName = strName & "_" & count & "." & strExt
saveFileName = strDirectory & FileName
Else
Exit Do '없으며 빠져나간당..
End If
Loop
'파일 저장
UploadForm(filedname).SaveAs saveFileName
end if
'Set UploadForm = nothing
Set FSO = nothing
wfile = FileName
end function
'************** Information ****************************************
' Program Title :
' Company :
' Creator :
'*********************************************************************
function cfile(filedname,strDirectory1,strDirectory)
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
If FSO.FolderExists(strDirectory) = False Then '폴더가 없으면 새로 생성한다..
FSO.CreateFolder(strDirectory)
End if
'--확장장와 파일 이름 분리
strfile = split(filedname,".")
strName = strfile(0) '파일명
strExt = strfile(1) '확장자
'같은 파일 이 존재할경우 --> _1,_2 이런식으로 파일명 변경..ㅡㅡv
bExist = True
count= 0
org_file = strDirectory1&filedname
fwsaveFileName = strDirectory&filedname
FileName = filedname
Do While bExist
If (FSO.FileExists(fwsaveFileName)) Then
count = count + 1
FileName = strName & "_" & count & "." & strExt
fwsaveFileName = strDirectory & FileName
Else
Exit Do '없으며 빠져나간당..
End If
Loop
'파일 저장
FSO.CopyFile org_file,fwsaveFileName
Set FSO = nothing
cfile = FileName
end function
'************** Information ****************************************
' Program Title : file삭제
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 05.
'*********************************************************************
function dfile(strpath)
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
If FSO.fileExists(strpath) = true Then '파일이 있으면 지운다.
FSO.DeleteFile(strpath)
End if
Set FSO = nothing
end function
'************** Information ****************************************
' Program Title : 등급별 용량 가지고 오기
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 05
'*********************************************************************
function get_hdsize(loging_level)
if loging_level = "-1" then
get_hdsize = Application("admin_hdsize")
else
SQL = "Select g_hdsize from member_group where g_num=" & loging_level
Set rs = DbCon.Execute(SQL)
if not rs.eof then
get_hdsize = Rs(0)
else
get_hdsize = 0
end if
Set rs = nothing
end if
end function
'************** Information ****************************************
' Program Title : 공유폴더 용량 가지고 오기
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 05
'*********************************************************************
function get_public()
sql = "Select wc_public from webhd_config"
Set rs = DbCon.Execute(SQL)
if not rs.eof then
get_public = Rs(0)
else
get_public = 0
end if
Set rs = nothing
end function
'************** Information ****************************************
' Program Title : 업로드제한용량 가지고 오기
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 05
'*********************************************************************
function get_upload()
sql = "Select wc_upload from webhd_config"
Set rs = DbCon.Execute(SQL)
if not rs.eof then
get_upload = Rs(0)
else
get_upload = 0
end if
Set rs = nothing
end function
'************** Information ****************************************
' Program Title : '마지막접속시간정보구하기
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 05
'*********************************************************************
function get_lastdate(m_id)
sql = "select m_lastdate from member where m_id = '"&m_id&"'"
set rs_view = DbCon.Execute(sql)
get_lastdate = rs_view("m_lastdate")
Set rs_view = nothing
end function
'************** Information ****************************************
' Program Title : '
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 05
'*********************************************************************
function get_FileName1(filename)
If Trim(filename) = "" Then
FileName1 = "default.gif"
Else
FileName = Split(filename,".",-1,1)
FileEnd = Lcase(Trim(FileName(1)))
Select Case FileEnd
Case ""
FileName1 = "default.gif"
Case "asf"
FileName1 = "asf.gif"
Case "asx"
FileName1 = "asf.gif"
Case "doc"
FileName1 = "doc.gif"
Case "mpg"
FileName1 = "mpg.gif"
Case "mpeg"
FileName1 = "mpg.gif"
Case "bat"
FileName1 = "bat.gif"
Case "bmp"
FileName1 = "bmp.gif"
Case "com"
FileName1 = "com.gif"
Case "sys"
FileName1 = "device.gif"
Case "dll"
FileName1 = "device.gif"
Case "exe"
FileName1 = "exe.gif"
Case "gif"
FileName1 = "gif.gif"
Case "htm"
FileName1 = "html.gif"
Case "html"
FileName1 = "html.gif"
Case "hwp"
FileName1 = "hwp.gif"
Case "xls"
FileName1 = "excel.gif"
Case "jpg"
FileName1 = "jpg.gif"
Case "mp3"
FileName1 = "mp3.gif"
Case "pcx"
FileName1 = "pcx.gif"
Case "png"
FileName1 = "png.gif"
Case "ppt"
FileName1 = "ppt.gif"
Case "ra"
FileName1 = "ra.gif"
Case "txt"
FileName1 = "text.gif"
Case "url"
FileName1 = "url.gif"
Case "wav"
FileName1 = "wav.gif"
Case "zip"
FileName1 = "zip.gif"
Case else
FileName1 = "unknown.gif"
End Select
End If
get_FileName1 = FileName1
end function
'************** Information ****************************************
' Program Title : '회원이름찾기
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2005-07-24
'*********************************************************************
function get_name(m_id)
if m_id <> "" then
m_id = replace(m_id,",","")
sql = "select m_name from member where m_id = '"&m_id&"'"
set rs_view = DbCon.Execute(sql)
if rs_view.eof then
get_name = m_id
else
get_name = rs_view(0)
end if
Set rs_view = nothing
end if
end function
'************** Information ****************************************
' Program Title : '회사이름'
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2005-07-24
'*********************************************************************
function get_company_name()
sql = "select subject from default_config where idx=1"
set rs_view = DbCon.Execute(sql)
if rs_view.eof then
get_company_name = ""
else
get_company_name = rs_view(0)
end if
set rs_view = nothing
end function
'************** Information ****************************************
' Program Title :
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2005-07-27
'*********************************************************************
function get_rdate(do_key,do_formid)
sql = "select dov_rdate from document_view where do_key="&do_key&" and do_id='"&do_formid&"'"
set rs_view = DbCon.Execute(sql)
if isnull(trim(rs_view(0))) or trim(rs_view(0)) = "" then
get_rdate = "<font color='red'>읽지않음</font>"
else
get_rdate = left(rs_view(0),10)&"<br>"&mid(rs_view(0),12,8)
end if
set rs_view = nothing
end function
'************** Information ****************************************
' Program Title : ip 체크
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2005-10-12
'*********************************************************************
function security_ip()
user_ip = trim(request.ServerVariables("REMOTE_ADDR"))
sql = "select count(se_idx) from security where se_ip='"&user_ip&"' and se_chk='Y'"
set rs = dbcon.execute(sql)
rs_str = rs(0)
set rs = nothing
if rs_str = 0 then
response.write "<SCRIPT LANGUAGE='JavaScript'>" & VbCrLf
response.write "alert('허용된 아이피만 접근이 가능합니다.');" & VbCrLf
'response.write "top.location.href='/admin/default.asp';" & VbCrLf
response.write "history.back();" & VbCrLf
response.write "</SCRIPT>" & VbCrLf
response.end
end if
end function
'************** Information ****************************************
' Program Title : 'input관리
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2005-10-28
'*********************************************************************
sub input_type(iptype,ip_name,ip_value,size,maxlength,ip_aciton)
if maxlength <> "0" then
maxlength_str = "maxlength='"&maxlength&"'"
end if
if iptype = "text" then
%>
<input name="<%=ip_name%>" type="text" class="ipche_input" id="<%=ip_name%>" style="width:<%=size%>%;" value="<%=ip_value%>" <%=maxlength_str%> <%=ip_aciton%>>
<%elseif iptype = "password" then%>
<input name="<%=ip_name%>" type="password" class="ipche_input" id="<%=ip_name%>" style="width:<%=size%>%;" value="<%=ip_value%>" <%=maxlength_str%> <%=ip_aciton%>>
<%elseif iptype = "ipdate" then%>
<input name="<%=ip_name%>" type="text" class="ipche_input" id="<%=ip_name%>" style="width:<%=size%>%;" value="<%=ip_value%>" <%=maxlength_str%> <%=ip_aciton%>>
<a href="javascript:calendarBtn(document.frm.<%=ip_name%>);">[날짜선택]</a>
<%elseif iptype = "textarea" then%>
<textarea name="<%=ip_name%>" class="ipche_input" id="<%=ip_name%>" style="width:98%;height:<%=maxlength%>px"><%=ip_value%></textarea>
<%elseif iptype = "file" then%>
<input name="<%=ip_name%>" type=file class='ipche_input' id="<%=ip_name%>" style="width:<%=size%>%;" <%=maxlength_str%> <%=ip_aciton%>>
<%end if
end sub
'************** Information ****************************************
' Program Title : '코드관리
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2005-10-28
'*********************************************************************
sub code_view(code_idx,opt_name,code_name)
SQL = "SELECT * FROM C_CODE_S WHERE CateL_idx="&code_idx&" ORDER BY CateS_code"
Set rs = DbCon.Execute(SQL)
if not rs.eof then
%>
<select name="<%=opt_name%>" style="behavior: url('/include/css/selectBox.htc');">
<option value=''>선택</option>
<%
Do While Not Rs.EOF
CateS_idx = Rs("CateS_idx") '--일련번호
CateL_idx = Rs("CateL_idx") '--정렬번호
CateS_code = Rs("CateS_code") '--정렬번호
CateS_name = Rs("CateS_name") '--코드명
CateS_chk = Rs("CateS_chk") '--사용여부
%>
<option value='<%=CateS_name%>' <% if code_name = CateS_name then %>selected<% end if %>><%=CateS_name%></option>
<%
rs.MoveNext
Loop
%>
</select>
<%else%>
<input name="<%=opt_name%>" type="text" class="bip" id="<%=opt_name%>" style="width:95%;" value="<%=code_name%>">
<%end if
rs.close
set rs = nothing
end sub
'************** Information ****************************************
' Program Title : 'new 아이콘 출력.(get_newimg)
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2005-07-27
'*********************************************************************
function get_newimg(getdate)
if not(isnull(getdate)) and getdate <> "" then
aa_regdate = trim(getdate)
aa_regdate = trim(left(aa_regdate,10))
'response.write aa_regdate
aa_regdate = cdate(aa_regdate)
new_day = cint("-" & 1)
date1 = dateadd("d",new_day,date()) '-- new_day일전의 날짜를 계산
If aa_regdate >= date1 Then
response.write "<img src='image/ic_new.gif' align='absmiddle' border='0'>"
end if
end if
end function
'************** Information ****************************************
' Program Title : '인쇄
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2005-11-03
'*********************************************************************
sub page_print()
%>
<script language="javascript">
function printWindow() {
//factory.printing.header = "여기는 머릿글입니다."
//factory.printing.footer = "여기는 바닥글입니다."
/*
factory1.printing.header = ""
factory1.printing.footer = ""
factory1.printing.portrait = true
factory1.printing.leftMargin = 10.0
factory1.printing.topMargin = 10.0
factory1.printing.rightMargin = 10.0
factory1.printing.bottomMargin = 10.0
factory1.printing.Print(false, window)
*/
window.print();
//window.close();
}
printWindow();
</script>
<%
end sub
'************** Information ****************************************
' Program Title : 게시판 테이블명알아내기 bbs_tablename_str(a_num)
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2004. 03. 05
'*********************************************************************
function bbs_tablename_str(a_num)
if a_num <> "" then
sql = "select a_tablename from bbs_admin where a_num="&a_num
set rs = dbcon.execute(sql)
bbs_tablename_str = trim(rs(0))
'set rs = nothing
end if
end function
'************** Information ****************************************
' Program Title : 게시판 명알아내기 bbs_bbsname_str(a_num)
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2006-02-03
'*********************************************************************
function bbs_bbsname_str(a_num)
if a_num <> "" then
sql = "select a_bbsname from bbs_admin where a_num="&a_num
set rs = dbcon.execute(sql)
bbs_bbsname_str = trim(rs(0))
set rs = nothing
end if
end function
'************** Information ****************************************
' Program Title : '회원부서
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2005-07-24
'*********************************************************************
function get_buseo(bdm_idx)
if bdm_idx <> 0 then
SQL = "Select bdm_menuname from bd_menu_page where bdm_idx = "&bdm_idx
response.write sql
set rs_buseo = DbCon.Execute(sql)
if rs_buseo.eof then
get_buseo = "부서없음"
else
get_buseo = rs_buseo(0)
end if
Set rs_buseo = nothing
else
get_buseo = "부서없음"
end if
end Function
'************** Information ****************************************
' Program Title : '회원 최상위부서
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2005-07-24
'*********************************************************************
function get_bdm_idx(bdm_idx)
if bdm_idx <> 0 then
SQL = "Select bdm_ref from bd_menu_page where bdm_idx = "&bdm_idx
'response.write sql
set rs_buseo = DbCon.Execute(sql)
if rs_buseo.eof then
get_bdm_idx = 0
else
get_bdm_idx = rs_buseo(0)
end if
Set rs_buseo = nothing
else
get_bdm_idx = 0
end if
end function
'**************************************************************************************************************
'나의 일정 관리 함수 모음
'**************************************************************************************************************
' 해당월의 마지막 날자를 구한다.(28일 부터 31일 중에 하나인데 시스템에서 제공하는 날짜함수를 사용하여 구한다)
function LastDay(stryear, strmonth)
intLastDay = 28
For d = 29 To 31 step 1 'up to the 31st 하루씩 증가 시키며 날짜 포맷을 만들어 같은달인가 검사한다.
calMonth = Month(DateSerial(stryear, strmonth, d))
If cint(calMonth) = cint(strmonth) Then ' 같은 달인경우 마지막 날짜 설정하고 루프 계속
intLastDay = d
else
exit for '같은달이 아니면 for문을 끝낸다.
End If
Next
LastDay = intLastDay
end function
'******************************************************************************************************************
'**************************************************************************************************************
'가계부
'**************************************************************************************************************
'가계부 항목
function account_type(gubun, no)
'수익
if gubun = "0" then
select case no
case 0 : temp = "급여"
case 1 : temp = "용돈"
case 2 : temp = "아르바이트"
case 3 : temp = "이자"
case 4 : temp = "보험금"
case 5 : temp = "배당금"
case 6 : temp = "저축인출"
case 7 : temp = "차입금"
case 8 : temp = "기타"
end select
'지출
elseif gubun = "1" then
select case no
case 0 : temp = "식비"
case 1 : temp = "주거비"
case 2 : temp = "피복비"
case 3 : temp = "교육비"
case 4 : temp = "구입비"
case 5 : temp = "보건위생비"
case 6 : temp = "문화생활비"
case 7 : temp = "경조비"
case 8 : temp = "교제비"
case 9 : temp = "교통비"
case 10 : temp = "통신비"
case 11 : temp = "세금공과금"
case 12 : temp = "특별비"
case 13 : temp = "저축"
case 14 : temp = "보험금"
case 15 : temp = "기타"
end select
end if
account_type = temp
end function
'차계부 항목
function car_type(no)
select case no
case 1 : temp = "유류비"
case 2 : temp = "주차비"
case 3 : temp = "통행료"
case 4 : temp = "세차비"
case 5 : temp = "차량유지비"
case 6 : temp = "자동차할부금"
case 7 : temp = "자동차세금"
case 8 : temp = "자동차보험료"
case 9 : temp = "자동차검사비"
case 10 : temp = "자동차범칙금"
case 11 : temp = "자동차수리비"
case 12 : temp = "자동차소모품"
case 13 : temp = "자동차장식품"
end select
car_type = temp
end function
'가계부 항목 수
iaccount = 8 '수입
eaccount = 15 '지출
'******************************************************************************************************************
%>
<%
'************** Information ****************************************
' Program Title : 게시판 스킨 경로 정의
' Creator : Heo jaehoon
'*********************************************************************
board_skin1_url = site_root_dir_url&"/Program/bbs/skin/1/Imgs" '스킨1 이미지디렉토리 url
board_skin2_url = site_root_dir_url&"/Program/bbs/skin/2/Imgs" '스킨2 이미지디렉토리 url
%>
<%
'---------------------------------------------------------------------------------------------------------------
' DDDDD EEEEEE SSSSSS IIIIII GGGGG NN NN
' DD D EE SS II GG N N NN
' DD D EEEEEE SSSSS II GG GGG NN N NN
' DD D EE SS II GG GG NN N N
' DDDDD EEEEEE SSSSSS IIIIII GGGGG NN NN
'---------------------------------------------------------------------------------------------------------------
'************** Information ****************************************
' Program Title : 디렉토리/경로 정의
' Creator : Heo jaehoon
'*********************************************************************
site_name="경북지방 경찰청 문자전송시스템" '사이트명
site_root_dir_path = "E:\Web Service2\대구시청SMS_SEC" '프로그램 시작디렉토리 절대경로
include_dir_path = site_root_dir_path&"\include" 'Include디렉토리 절대경로
site_root_dir_url = Application("domain1") '프로그램 시작디렉토리 url
include_dir_url = site_root_dir_url&"/include" 'Include디렉토리 url
common_image_url = site_root_dir_url&"/Imgs" '공통 이미지디렉토리 url
skin_normal_img = site_root_dir_url&"/program/ebook/user_view/skin/normal" 'ebook 이미지디렉토리 url
program_image_url = site_root_dir_url&"/image" '프로그램용 이미지 디렉토리 url
program_dir_url = site_root_dir_url&"/program" '프로그램 디렉토리 url
program_dir_path = site_root_dir_path&"\program" '프로그램 디렉토리 path
save_data_path = site_root_dir_path&"\data" '프로그램 데이터 저장 디렉토리 path
save_data_url = site_root_dir_url&"/data" '프로그램 데이터 저장 디렉토리 URL
'메뉴별 서브메인 주소..
'작성자 : 윤종우
'작성일 : 2005-12-17
home_webhdd_url = site_root_dir_url&"/webhard/intro.asp"
home_infopia_url = site_root_dir_url&"/infopia/default.asp"
home_eandong_url = site_root_dir_url&"/eandong/default.asp"
home_study_url = site_root_dir_url&"/study/default.asp"
home_private_url = site_root_dir_url&"/infopia/default.asp" '임시주소.(마이비서는 로그인후 사용되게끔->루트메인으로 가게...)/program/private
home_sms_url = site_root_dir_url&"/infopia/default.asp" '임시주소.(마이비서는 로그인후 사용되게끔->루트메인으로 가게...)/program/sms
club_sms_url = site_root_dir_url&"/club/default.asp"
myhome_sms_url = site_root_dir_url&"/myhome/default.asp"
sms_image_url = site_root_dir_url&"/program/sms/Imgs" '문자서비스 이미지디렉토리 url
sms_url = site_root_dir_url&"/program/sms" '문자서비스 디렉토리 url
'************** Information ****************************************
' Program Title : '주소이동
' Company : (주)나우아이텍 (053)955-9055
' Creator : 최 경 수 2006-03-14
'*********************************************************************
Function Back_back(message)
Response.Write"<script language='javascript'>" &_
"alert('" + message + "');" &_
"history.go(-1);" &_
"</script>"
Response.End
End Function
Function Back_back2(message, url)
Response.Write"<script language='javascript'>" &_
"alert('" + message + "');" &_
"location.href = '" + url + "';" &_
"</script>"
Response.End
End Function
Function Back_back3(message, url)
Response.Write"<script language='javascript'>" &_
"alert('" + message + "');" &_
"top.location.href = '" + url + "';" &_
"</script>"
Response.End
End Function
'=========================================================
Function Sung_gong(message)
Response.Write "<script language='javascript'>" &_
"alert('" & message & "');" &_
"window.close();" &_
"</script>"
Response.End
End Function
Function Sung_gong2(message, url)
Response.Write "<script language='javascript'>" &_
"alert('" & message & "');" &_
"location.href = '" + url + "';" &_
"opener.location.reload();" &_
"</script>"
Response.End
End Function
Function Sung_gong3(message)
Response.Write "<script language='javascript'>" &_
"alert('" & message & "');" &_
"window.close();" &_
"opener.location.reload();" &_
"</script>"
Response.End
End Function
'************** Information ****************************************
' Program Title : '값체크후 폼에 적용
' Company : (주)나우아이텍 (053)955-9055
' Creator : 최 경 수 2006-03-14
'*********************************************************************
'셀렉트버튼
Function ChkValSelect(ByVal value1, ByVal value2)
If CStr(value1) = CStr(value2) Then
response.write "selected"
End if
End Function
'체크박스
Function ChkValChkBox(ByVal value1, ByVal value2)
If CStr(value1) = CStr(value2) Then
response.write "checked"
End if
End Function
'************** Information ****************************************
' Program Title : SMS 전송
' Company : (주)나우아이텍 (053)955-9055
' Creator : 최 경 수 2006-03-17
'*********************************************************************
Function SmsSend(tran_phone, tran_callback, Msg, RDate, a_num)
'tran_phone = b_phone1&"-"&b_phone2&"-"&b_phone3 '받는사람
'tran_phone = a_smssend_addr '받는사람
'tran_callback = "053-955-9055" '보내는 사람
'a_num = 고유번호
tran_phone = Replace(tran_phone, "-" , "")
tran_phone = Replace(tran_phone, " " , "")
message_temp = StringToHTML2(Msg, 80, true)
messageArr = Split(message_temp, "<BR>")
if clng(smsSelect()) <= 0 then Back_back2 "당월 남은 건수가 부족합니다.", request.servervariables("http_referer")
If UBound(messageArr) > 0 Then
For ii = 0 To UBound(messageArr)
response.write ii&"=ii<BR>"
if clng(smsSelect()) <= 0 then Back_back2 "당월 남은 건수가 부족합니다.", request.servervariables("http_referer")
SQL = "Insert into em_tran(tran_id, tran_phone, tran_callback, tran_status, tran_date, tran_msg, tran_etc1, tran_etc2, tran_etc3, tran_etc4) values ("
SQL = SQL & "'"&Request.Cookies("M_id")&"','"&tran_phone&"', '"&tran_callback&"', '1', '"&Rdate&"', '"&ii+1&")"&messageArr(ii)&"','"&a_num&"', '"&Rdate&"','"&request.cookies("bdm_idx")&"', '"&get_bdm_idx(request.cookies("bdm_idx"))&"')"
'response.write sql & "<br>"
'response.write "<br>sql="&sql
'response.end
dbcon.execute sql
sql = "update member set M_g_sms = M_g_sms - 1 where M_id = '" & Request.Cookies("M_id") & "'"
dbcon.execute sql
next
else
SQL = "Insert into em_tran(tran_id, tran_phone, tran_callback, tran_status, tran_date, tran_msg, tran_etc1, tran_etc2, tran_etc3, tran_etc4) values ("
SQL = SQL & "'"&Request.Cookies("M_id")&"','"&tran_phone&"', '"&tran_callback&"', '1', '"&Rdate&"', '"&Msg&"','"&a_num&"', '"&Rdate&"', '"&request.cookies("bdm_idx")&"','"&get_bdm_idx(request.cookies("bdm_idx"))&"')"
'response.write sql & "<br>"
'response.write "<br>sql="&sql
'response.end
dbcon.execute sql
sql = "update member set M_g_sms = M_g_sms - 1 where M_id = '" & Request.Cookies("M_id") & "'"
dbcon.execute sql
End if
'***********************************************************************************************************************************************
v_year = year(now())
v_month = month(now())
v_day = day(now())
v_week = weekday(now())
'-- 오늘 처음 접속인지 아닌지 체크
sqlc = "select nowcount from bd_counter where info_url = '"&request.cookies("m_id")&"' and nowyear = "& v_year &" and nowmonth = "& v_month &" and nowday = "& v_day &" and nowweek = "& v_week
set rsc = Dbcon.Execute(sqlc)
if rsc.eof then '-- 오늘 처음접속이면 insert
sql = "insert into bd_counter (info_url, nowcount, nowyear, nowmonth, nowday, nowweek) values('"&request.cookies("m_id")&"', 1, "& v_year &", "& v_month &", "& v_day &", "& v_week &")"
else '-- 처음이 아니면 count 1증가 --> update
v_count = rsc(0)+1
sql = "update bd_counter set nowcount = "& v_count &" where info_url = '"&request.cookies("m_id")&"' and nowyear = "& v_year &" and nowmonth = "& v_month &" and nowday = "& v_day &" and nowweek = "& v_week
end if
set rsc=Nothing
Dbcon.Execute sql
'***********************************************************************************************************************************************
End Function
Function SMSdateChk(dateval, hourval, minval)
If CDate(dateval) > Date() Then '날짜가 오늘날짜보다 크면
SMSdateChk = True
ElseIf CDate(dateval) = Date() Then '날짜가 같다면
If CInt(hourval) > CInt(hour(now)) Then '같은날짜 시간이 크다면
SMSdateChk = True
ElseIf Not(CInt(hourval) < CInt(hour(now))) And CInt(minval) > Minute(now) Then'시간이 작지않고 분이 크다면
SMSdateChk = True
Else
SMSdateChk = false
End If
Else
SMSdateChk = False
End if
End function
'=======================회원별 남은 건수 보기=========================================================
Function smsSelect()
strConnect="Provider=SQLOLEDB.1;Data Source=(local);Initial catalog="&Application("DB")&";user ID="&Application("DB_id")&";Password="&Application("DB_pwd")
'StrCon = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=nambu;Initial Catalog=nambu;Data Source=NAMBU-WEB"
'strConnect="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog="&Application("DB")&";User ID="&Application("DB_id")&";Data Source=(local)" '경로 지정
Set Db=Server.CreateObject("ADODB.Connection")
Db.Open strConnect
sql = "select M_g_sms from member where M_id = '" & Request.Cookies("M_id") & "'"
Set rs_sms = Db.Execute(sql)
If IsNull(rs_sms(0)) Or rs_sms(0) = "" Then
smsSelect = 0
Else
smsSelect = rs_sms(0)
End If
Set rs_sms = Nothing
Db.close
Set Db = nothing
End function
'===================내 소속 실국 번호 알아내기==========================
Function mysilguk()
sql = "select b.bdm_ref from member as a inner join bd_menu_page b on a.bdm_idx = b.bdm_idx where a.M_id = '" & Request.Cookies("m_id") & "'"
Set rs = Dbcon.Execute(sql)
If rs.bof Or rs.eof Then
mysilguk = null
Else
mysilguk = cint(rs(0))
End If
Set rs = nothing
End function
'=======================================================================
%>