<%
'------------- 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_ad_cms()
'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

'**************  Information  ****************************************
'	Program Title	:	문자열처리구문4
'	Company		    :	(주)나우아이텍 (053)955-9055
'	Creator		    :	최 경 수  2006. 3. 14
'*********************************************************************
function InputValue4(strvalue)
	
	strvalue = trim(strvalue)
	strvalue = Replace(strvalue,"'","''")
	InputValue4 = strvalue
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 getTextmode(strvalue)
	
	if strvalue <> "" or not isnull(strvalue) then

	strvalue=Replace(strvalue, "<" , "&lt;")
    strvalue=Replace(strvalue, ">" , "&gt;")
    strvalue=Replace(strvalue,chr(13),"<br>")
    strvalue=Replace(strvalue,"  ","&nbsp;&nbsp;")
    strvalue=Replace(strvalue,"\t","&nbsp;&nbsp;&nbsp;")
	getTextmode = strvalue
	end if


end Function

function InputValue6(strvalue)
	
	strvalue = trim(strvalue)
	strvalue = Replace(strvalue," ","")

	strvalue = left(strvalue,16)
	strvalue = left(strvalue,10)&"-"&right(strvalue,6)
	strvalue = Replace(strvalue,":","-")


	
	InputValue6 = strvalue
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_ad_cms()

	If Request.Cookies("security_ad_cms") <> "ok" then
	   response.write "<SCRIPT LANGUAGE='JavaScript'>" & VbCrLf
	   response.write "alert('당신은 보안을 위반했거나 연결이 끊겼습니다.');" & VbCrLf
	  ' response.write "top.location.href='/ad_cms/default.html';" & VbCrLf
	   response.write "top.location.href='/ad_cms/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='/ad_cms/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='/ad_cms/image/tit_left.gif' width='10' height='4' border='0'></td>
	 <td width='100%'><img src='/ad_cms/image/tit_bg.gif' width='100%' height='4' border='0'></td>			
	 <td><img src='/ad_cms/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="/ad_cms/image/ntit_left.gif" style="padding-right:25;padding-left:15;" nowrap><%=str%></td>
		<td background="/ad_cms/image/ntit_bg.gif" width="100%"><%=help%></td>
		<td background="/ad_cms/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='/ad_cms/image/tit_left.gif' width='10' height='4' border='0'></td>
	 <td width='100%'><img src='/ad_cms/image/tit_bg.gif' width='100%' height='4' border='0'></td>			
	 <td><img src='/ad_cms/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_ad_cms 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


Function GetImageSize_w(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_w	=imgWidth
End Function

Function GetImageSize_h(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_h	=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	:	업로드파일저장하기(dext버젼)
'	Company		    :	(주)나우아이텍 (053)955-9055
'	Creator		    :	윤 종 우  2007-04-17
'*********************************************************************
function wfile_mail(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) '확장자

			
			a_nofile	  = "asp,php,jsp,exe,aspx,dll,com,js"
			a_nofile      = split(a_nofile,",") '제한파일..
			a_nofile_len  = UBound(a_nofile) '배열갯수

			for z=0 to a_nofile_len 

				if Lcase(strExt) = a_nofile(z) then   
					response.write "<SCRIPT LANGUAGE='JavaScript'>" & VbCrLf
					response.write "alert('"&Trim(a_nofile(z))&" 파일은 첨부할 수 없습니다.');" & VbCrLf
					response.write "history.back();" & VbCrLf
					response.write "</SCRIPT>" & VbCrLf
					set dbcon      = nothing
					Set UploadForm = nothing 
					Set FSO        = nothing
					response.end
				end if

			Next


		'-- 파일크기가 검사
		'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_mail = 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("ad_cms_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)&"&nbsp;"&mid(rs_view(0),12,10)

			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='/ad_cms/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_ad_cms 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_ad_cms 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 IsNull(bdm_idx) Or Trim(bdm_idx) = "" Then bdm_idx = 0

if CLng(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_idx2(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_idx2      = 0

	else

		get_bdm_idx2      = rs_buseo(0)

	end if

	Set rs_buseo = nothing
else
	
	get_bdm_idx2      = 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="문자전송시스템 Ver 2.1.1"										'사이트명

site_root_dir_path				= "E:\Web Service2\SMSVER2"				'프로그램 시작디렉토리 절대경로
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_back_cnt(message, cnt)
	Response.Write"<script language='javascript'>" &_
				  "alert('" + message + "');" &_
				  "history.go(-"&cnt&");" &_
				  "</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_host(tran_phone, tran_callback, Msg, RDate, s_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
	
		If UBound(messageArr) > 0 Then
			For ii = 0 To UBound(messageArr)
				response.write ii&"=ii<BR>"
				if clng(smsSelect()) <= 0 Then
					Exit for
				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&"', '"&ii+1&")"&messageArr(ii)&"','', '"&s_num&"','"&request.cookies("bdm_idx")&"', '"&get_bdm_idx2(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
			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&"','', '"&s_num&"', '"&request.cookies("bdm_idx")&"','"&get_bdm_idx2(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 if
	'***********************************************************************************************************************************************
End Function


'**************  Information  ****************************************
'	Program Title	:   SMS 전송
'	Company		    :	(주)나우아이텍 (053)955-9055
'	Creator		    :	최 경 수 2006-03-17
'*********************************************************************
Function SmsSend(tran_phone, tran_callback, Msg, RDate, s_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)&"','', '"&s_num&"','"&request.cookies("bdm_idx")&"', '"&get_bdm_idx2(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&"','', '"&s_num&"', '"&request.cookies("bdm_idx")&"','"&get_bdm_idx2(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


'**************  Information  ****************************************
'	Program Title	:   SMS 전송
'	Company		    :	(주)나우아이텍 (053)955-9055
'	Creator		    :	최 경 수 2006-03-17
'*********************************************************************
Function SmsSend_s(tran_phone, tran_callback, Msg, RDate, s_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 UBound(messageArr) > 0 Then
		For ii = 0 To UBound(messageArr)
			'response.write ii&"=ii<BR>"

			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)&"','', '"&s_num&"','"&request.cookies("bdm_idx")&"', '"&get_bdm_idx2(request.cookies("bdm_idx"))&"')"
			'response.write sql & "<br>"
			'response.write "<br>sql="&sql
			'response.end
			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&"','', '"&s_num&"', '"&request.cookies("bdm_idx")&"','"&get_bdm_idx2(request.cookies("bdm_idx"))&"')"
		'response.write sql & "<br>"
		'response.write "<br>sql="&sql
		'response.end
		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



'**************  Information  ****************************************
'	Program Title	:   SMS 전송
'	Company		    :	(주)나우아이텍 (053)955-9055
'	Creator		    :	최 경 수 2006-03-17
'*********************************************************************
Function SmsSend_2(tran_phone, tran_callback, Msg, RDate, a_num, qry, rowcnt)
	'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>"
			qry_value = Replace(qry, Msg, ii+1&")"&messageArr(ii) )
			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) " & qry_value
			
			'select '"&Request.Cookies("M_id")&"', m_mobile, '"&callback&"', '1', getdate(), '"&message&"', '', '', '"&request.cookies("bdm_idx")&"','"&get_bdm_idx(request.cookies("bdm_idx"))&"' from member"
			
			
			'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) " &qry
			'response.write sql & "<br>"
			'response.write "<br>sql="&sql
			'response.end
			dbcon.execute sql
			sql = "update member set M_g_sms = M_g_sms - "&rowcnt&" 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) " &qry


		'"select '"&Request.Cookies("M_id")&"', m_mobile, '"&callback&"', '1', getdate(), '"&message&"', '', '', '"&request.cookies("bdm_idx")&"','"&get_bdm_idx(request.cookies("bdm_idx"))&"' from member"
		'response.write sql & "<br>"
		'response.write "<br>sql="&sql
		'response.end
		dbcon.execute sql
		sql = "update member set M_g_sms = M_g_sms - "&rowcnt&" where M_id = '" & Request.Cookies("M_id") & "'"
		'response.write sql
		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")&"', '"&rowcnt&"', "& v_year &", "& v_month &", "& v_day &", "& v_week &")"

	else  '-- 처음이 아니면 count 1증가 --> update
		v_count = rsc(0)+rowcnt
		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


'**************  Information  ****************************************
'	Program Title	:   SMS 전송
'	Company		    :	(주)나우아이텍 (053)955-9055
'	Creator		    :	최 경 수 2006-03-17
'*********************************************************************
Function SmsSend_s_2(tran_phone, tran_callback, Msg, RDate, a_num, qry, rowcnt)
	'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 UBound(messageArr) > 0 Then
		For ii = 0 To UBound(messageArr)
			'response.write ii&"=ii<BR>"
			qry_value = Replace(qry, Msg, ii+1&")"&messageArr(ii) )
			
			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) " & qry_value
			
			'response.write sql & "<br>"
			'response.write "<br>sql="&sql
			'response.end
			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) " &qry


		'"select '"&Request.Cookies("M_id")&"', m_mobile, '"&callback&"', '1', getdate(), '"&message&"', '', '', '"&request.cookies("bdm_idx")&"','"&get_bdm_idx(request.cookies("bdm_idx"))&"' from member"
		'response.write sql & "<br>"
		'response.write "<br>sql="&sql
		'response.end
		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")&"', '"&rowcnt&"', "& v_year &", "& v_month &", "& v_day &", "& v_week &")"

	else  '-- 처음이 아니면 count 1증가 --> update
		v_count = rsc(0)+rowcnt
		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()
	Dim strConnect, Db, sql, rs_sms
	strConnect="Provider=SQLOLEDB.1;Data Source=(local);Initial catalog="&Application("DB")&";user ID="&Application("DB_id")&";Password="&Application("DB_pwd")
	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 rs_sms.bof Or rs_sms.eof Then
		smsSelect = 0
	Else
		smsSelect = rs_sms(0)
	End If
	Set rs_sms = Nothing
	
	Db.close
	Set Db = nothing
End Function


Function smsSelect2(m_id)
	Dim strConnect, Db, sql, rs_sms
	strConnect="Provider=SQLOLEDB.1;Data Source=(local);Initial catalog="&Application("DB")&";user ID="&Application("DB_id")&";Password="&Application("DB_pwd")
	Set Db=Server.CreateObject("ADODB.Connection") 
	Db.Open strConnect
	sql = "select M_g_sms from member where M_id = '" & m_id & "'"
	Set rs_sms = Db.Execute(sql)
	If rs_sms.bof Or rs_sms.eof Then
		smsSelect2 = 0
	Else
		smsSelect2 = rs_sms(0)
	End If
	Set rs_sms = Nothing
	
	Db.close
	Set Db = nothing
End Function

'=======================회원별 남은 통수 보기=========================================================
Function smsMail()
	Dim strConnect, Db, sql, rs_mail
	strConnect="Provider=SQLOLEDB.1;Data Source=(local);Initial catalog="&Application("DB")&";user ID="&Application("DB_id")&";Password="&Application("DB_pwd")
	Set Db=Server.CreateObject("ADODB.Connection") 
	Db.Open strConnect
	sql = "select M_g_mail from member where M_id = '" & Request.Cookies("M_id") & "'"
	Set rs_mail = Db.Execute(sql)
	If rs_mail.bof Or rs_mail.eof Then
		smsMail = 0
	Else
		smsMail = rs_mail(0)
	End If
	Set rs_mail = 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
'=======================================================================

'**************  Information  ****************************************
'	Program Title	:   '포토갤러리일때..첫번째이미지명 가지고 오기'
'	Company		    :	(주)나우아이텍 (053)955-9055
'	Creator		    :	윤 종 우 2007-03-29
'*********************************************************************
function bbs_getphoto(a_tablename,is_b_num)

		sql = "select top 1 f_filename from bbs_file where f_b_tablename = '" & a_tablename & "' and f_b_num="&is_b_num&" order by f_sort"
		set rs_getpt = dbcon.execute(sql)
			
		If not rs_getpt.eof then
			bbs_getphoto      = rs_getpt(0)
		Else
			bbs_getphoto      = "noimage"
		End if


		set rs_getpt = nothing

end Function


'**************  Information  ****************************************
'	Program Title	:   'bbs_href_type (포토갤러리때 사용)
'	Company		    :	(주)나우아이텍 (053)955-9055
'	Creator		    :	윤 종 우  2007-03-29
'*********************************************************************
sub bbs_href_type()

	bbs_href_type_link1 = "<a href='/program/bbs/view.asp?mode="&mode&"&a_num="&a_num&"&b_num="&b_num&"&b_lnum="&b_lnum&"&"&page_info&"'>"
	'bbs_href_type_link2 = "<a href='javascript:showSearchForm"&num&"();'>"
	bbs_href_type_link2 = "<a href='/program/bbs/pwd.asp?mode="&mode&"&a_num="&a_num&"&b_num="&b_num&"&b_lnum="&b_lnum&"&"&page_info&"'>"
	

	if a_type = "1" or Bl_ad_cms = "Y" then '공개

		response.write bbs_href_type_link1

	elseif a_type = "2" then'비공개

		response.write bbs_href_type_link2

	elseif a_type = "3" then'공개/비공개

		if b_open = "1" or b_open = ""  Then
			
			response.write bbs_href_type_link1

		elseif b_open = "2" then
			
			response.write bbs_href_type_link2

		end if

	end if

end Sub


'**************  Information  ****************************************
'	Program Title	:	get_time
'	Company		    :	(주)나우아이텍 (053)955-9055
'	Creator		    :	윤 종 우  2007-03-30
'*********************************************************************
function get_time(time_value)

	If time_value <> "" Then
	
		Select Case time_value

		Case "오전1"
			time_value2 = "1"
		Case "오전2"
			time_value2 = "2"
		Case "오전3"
			time_value2 = "3"
		Case "오전4"
			time_value2 = "4"
		Case "오전5"
			time_value2 = "5"
		Case "오전6"
			time_value2 = "6"
		Case "오전7"
			time_value2 = "7"
		Case "오전8"
			time_value2 = "8"
		Case "오전9"
			time_value2 = "9"
		Case "오전10"
			time_value2 = "10"
		Case "오전11"
			time_value2 = "11"
		Case "오전12"
			time_value2 = "12"
		Case "오후1"
			time_value2 = "13"
		Case "오후2"
			time_value2 = "14"
		Case "오후3"
			time_value2 = "15"
		Case "오후4"
			time_value2 = "16"
		Case "오후5"
			time_value2 = "17"
		Case "오후6"
			time_value2 = "18"
		Case "오후7"
			time_value2 = "19"
		Case "오후8"
			time_value2 = "20"
		Case "오후9"
			time_value2 = "21"
		Case "오후10"
			time_value2 = "22"
		Case "오후11"
			time_value2 = "23"
		Case "오후12"
			time_value2 = "24"
		End select
	End If

		
		get_time = time_value2

end Function

'**************  Information  ****************************************
'	Program Title	:   '코드이름'
'	Company		    :	(주)나우아이텍 (053)955-9055
'	Creator		    :	윤 종 우 2005-07-24
'*********************************************************************
function Update_bbs_susin_view(a_tablename,b_num,s_do_id)

	sql="UPDATE bbs_susin SET"
	sql = sql& " s_view = 'Y'"

	sql = sql& " WHERE s_tablename = '" & a_tablename & "' and s_b_num="&b_num&" and s_do_id ='"&s_do_id&"'"

	Dbcon.Execute(SQL)
	
end Function





'**************  Information  ****************************************
'	Program Title	:
'	Company		    :	(주)나우아이텍 (053)955-9055
'	Creator		    :	윤 종 우 2007-04-04
'*********************************************************************
function SELECT_ARY_RS(SQL)

	
	If SQL <> "" Then
	
		Dbcon.Execute(SQL)

		'SQL	= "select a_num, from bbs_ad_cms order by "& sorder
		SET DBMS_RS = Dbcon.Execute(SQL)


		If DBMS_RS.bof Or DBMS_RS.eof Then
			SELECT_ARY_RS = null
		Else
			SELECT_ARY_RS = DBMS_RS.getrows

		End If

		Set DBMS_RS = Nothing

	End if

	
end Function


'**************  Information  ****************************************
'	Program Title	:   부서idx 가지고 오기
'	Company		    :	(주)나우아이텍 (053)955-9055
'	Creator		    :	윤 종 우  2007-03-09
'*********************************************************************
function get_bdm_idx(m_id)
	
	sql = "Select bdm_idx  from member where m_id='"&m_id&"'"
	Set rs = DbCon.Execute(SQL)
	
	if not rs.eof then
		get_bdm_idx = Rs(0)
	else
		get_bdm_idx = ""
	end if

	Set rs = nothing

end function




'=======================전화번호 필터==========================
Function phoneValue(value)
	'response.write value
	phone_arr_temp = value
	'---------------불필요한 문자열 제거------------------
	phone_arr_temp = Replace(phone_arr_temp,")","")
	phone_arr_temp = Replace(phone_arr_temp,"(","")
	phone_arr_temp = Replace(phone_arr_temp,"-","")
	phone_arr_temp = Replace(phone_arr_temp," ","")
	phone_arr_temp = Replace(phone_arr_temp,",","")
	phone_arr_temp = Replace(phone_arr_temp,"ㅡ","")
	phone_arr_temp = Replace(phone_arr_temp,"*","")
	'---------------불필요한 문자열 제거------------------
	
	'phone_arr_temp = Split(mem_list(4, i), "-")
	
	If Left(phone_arr_temp, 2) = "00" Then	'지역번호에 0이 2개 들어갔을 경우
		phone_arr_temp = Mid(phone_arr_temp, 2)
	End if	
	'response.write "["& mem_list(4, i) &"], "
	
	'---------------전화번호를 정규화------------------			
	Select Case Len(phone_arr_temp)
		Case 7
			phone_arr = Array("053",Left(phone_arr_temp,3),right(phone_arr_temp,4))
		Case 8
			phone_arr = Array("053",Left(phone_arr_temp,4),right(phone_arr_temp,4))
		Case 10
			phone_arr = Array(Left(phone_arr_temp,3),mid(phone_arr_temp,4,3),right(phone_arr_temp,4))
		Case 11
			phone_arr = Array(Left(phone_arr_temp,3),mid(phone_arr_temp,4,4),right(phone_arr_temp,4))
		Case 12
			phone_arr = Array(Left(phone_arr_temp,4),mid(phone_arr_temp,5,4),right(phone_arr_temp,4))
		Case Else
			phone_arr = Array("","","")
	End select			
	'---------------전화번호를 정규화끝------------------
	'---------------마지막필터 숫자냐---------------
	If IsNumeric(phone_arr(0)) And IsNumeric(phone_arr(1)) And IsNumeric(phone_arr(2)) Then
		M_phone = phone_arr(0) & phone_arr(1) & phone_arr(2)
	Else
		M_phone = "--"
	End If
	'---------------마지막필터 숫자냐---------------
	phoneValue = M_phone
End Function

'=======================전화번호 필터 끝==========================

'**************  Information  ****************************************
'	Program Title	:   '코드이름'
'	Company		    :	(주)나우아이텍 (053)955-9055
'	Creator		    :	윤 종 우 2005-07-24
'*********************************************************************
function get_document_cnt(m_id)

		
		SQL = "Select  count(do_idx) from document where do_id='"&m_id&"' and do_count=0 and do_keep <>'3'"
		Set rs_view = DbCon.Execute(SQL)
		

			get_document_cnt      = rs_view(0)


		set rs_view = nothing

end Function


'========================================================================================
'==================================이메일 발송2(외부smtp인증기능)========================
'========================================================================================
Function sendMail(from_add, to_add, cc, bcc, subject, body)

	Const cdoSendUsingMethod = "http://schemas.microsoft.com/cdo/configuration/sendusing" 
	Const cdoSendUsingPort = 2 
	Const cdoSMTPServer = "http://schemas.microsoft.com/cdo/configuration/smtpserver" 
	Const cdoSMTPServerPort = "http://schemas.microsoft.com/cdo/configuration/smtpserverport" 
	Const cdoSMTPConnectionTimeout = "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout" 
	Const cdoSMTPAccountName = "http://schemas.microsoft.com/cdo/configuration/smtpaccountname" 
	Const cdoSMTPAuthenticate = "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate" 
	Const cdoBasic = 1 
	Const cdoSendUserName = "http://schemas.microsoft.com/cdo/configuration/sendusername" 
	Const cdoSendPassword = "http://schemas.microsoft.com/cdo/configuration/sendpassword" 

	Dim objConfig ' As CDO.Configuration 
	Dim objMessage ' As CDO.Message 
	Dim Fields ' As ADODB.Fields 

	' Get a handle on the config object and it's fields 
	Set objConfig = Server.CreateObject("CDO.Configuration") 
	Set Fields = objConfig.Fields 

	' Set config fields we care about 
	With Fields 
	.Item(cdoSendUsingMethod) = cdoSendUsingPort 
	.Item(cdoSMTPServer) = "mail.hanafos.com" 
	.Item(cdoSMTPServerPort) = 25 
	.Item(cdoSMTPAuthenticate) = cdoBasic 
	.Item(cdoSendUserName) = "sp1000je@hanafos.com" 
	.Item(cdoSendPassword) = "1472lo" 

	.Update 
	End With 

	Set objMessage = Server.CreateObject("CDO.Message") 

	Set objMessage.Configuration = objConfig 

	With objMessage 
	.To = to_add
	.From = from_add
	.cc = cc
	.bcc = bcc
	.Subject = subject
	.HTMLBody = body
	.Send 
	End With 

	'Response.Write "Success!!" 

	Set Fields = Nothing 
	Set objMessage = Nothing 
	Set objConfig = Nothing 

End Function



'========================================================================================
'==================================이메일 발송2(외부smtp인증기능)========================
'========================================================================================
Function sendMail_tabs(from_add, to_add, cc, bcc, subject, body)
	

	'/////////////////////////////////////////////////////
'// 상수 정의
Const TEXT_MSG = 0
Const HTML_MSG = 1

Const ENCODING_BASE64 = 0
Const ENCODING_QP = 1
Const ENCODING_8BIT = 2

Const PRIORITY_HIGH = 0
Const PRIORITY_NORMAL = 1
Const PRIORITY_LOW = 2

Dim Mail, i, j

'// 메일 객체 생성
Set Mail = Server.CreateObject("Tabs.Mailer.1")

For i = 1 To 5
	'// Mail 정보 설정
	Mail.ServerIp = "219.253.180.226"
	Mail.ServerPort = 6700
	'// 메일러 서버로 메일 전송시에 인증이 필요할 경우, 인증 정보를 입력해야 합니다.
	'// 인증 계정및 암호는 메일러 관리툴에서 확인할 수 있습니다.
	Mail.AuthId = "ad_cms"
	Mail.AuthPwd = "1"

	Mail.BodyType = HTML_MSG
	Mail.Encoding = ENCODING_BASE64
	Mail.Charset = "Euc-kr"
	Mail.FromField "from@domain.org", "보내는사람이름" '보내는 사람변수로 받기
	Mail.Subject = "회원 공지사항"
	Mail.AddAttachFile "C:\WINNT\Cursors\size1_i.cur"	'// 파일 첨부
	Mail.AlterMessage = "HTML 메일 내용을 볼수 없으면, 이 메시지가 보일 것입니다."
	Mail.Message = "<Html><Body>회원 여러분께, 공지사항</Body></Html>"

	'// 스케줄 기능 사용
	'Mail.ScheduleTime = "2003/01/01/01/01" '// 년/월/일/시/분
	
	For j = 1 To 1
		'// 한 메시지에 여러명의 받는 사람 지정
		Mail.AddToAddr "to" &j &"@domain.com", "받는사람이름" &j
	Next

	'// 메일 생성후 실제 발송
	If Mail.Send() Then			'// Send1() 메서드도 사용 가능
		Response.Write "발송 성공"
	Else
		Response.Write "발송 실패, 에러코드: " &Mail.LastError &", 에러내용: " &Mail.GetLastErrorDesc
	End If

	'// 메일 생성후 로컬 저장
	'If Mail.SendEx("c:\temp\mail") Then
	'	Response.Write "생성 성공"
	'Else
	'	Response.Write "생성 실패, 에러코드: " &Mail.LastError &", 에러내용: " &Mail.GetLastErrorDesc
	'End If

	'// 이전 정보들을 초기화
	Mail.Reset
Next

'// 메일 객체 해제
Set Mail = Nothing




End function




'**************  Information  ****************************************
'	Program Title	:   '메인리스트
'	Company		    :	(주)나우아이텍 (053)955-9055
'	Creator		    :	최 경 수 2006-03-14
'*********************************************************************

Function list(table, a_num)
	'table = "bbs_6"
	Select Case table
		Case "bbs_3"
			chk_on = "1"
			url = "/sub04/04_01.asp?chk_on=1"
		Case "bbs_4"
			chk_on = "2"
			url = "/sub04/04_02.asp?chk_on=2"
		Case "bbs_13"
			chk_on = "8"
	End Select
	
	Dim b_num, b_subject, b_regdate, b_content, i

	sql = "select top 2 b_num, b_subject, b_regdate from " & table & " where b_look = 'Y' and b_noticeChk <> 'Y' order by b_regdate desc"
	Set rs = Dbcon.Execute( sql )

	If rs.bof Or rs.eof Then
		list_data = null
	Else
		list_data = rs.getrows
	End If
	Set rs = nothing

	If IsNull(list_data) Then
%>
<table cellspacing="0" cellpadding="0">
<tr>
	<td><img src="imgs/info_ic.gif" width="10" height="20" align="absmiddle">내용이 없습니다.</td>
</tr>
</table>
<%
	else
%>
<table cellspacing="0" cellpadding="0">
<%
				For i = 0 To UBound(list_data, 2)
					b_num		= ""
					b_regdate	= ""
					b_subject	= ""
					
					If UBound(list_data, 2) >= i Then
						b_num		= list_data(0,i)
						b_regdate	= Replace(Left(list_data(2, i), 10), "-", ".")
						b_subject	= StringToHTML( list_data(1, i), 30, false )
					End If
%>
<tr>
	<td><img src="imgs/info_ic.gif" width="10" height="20" align="absmiddle"><a href="/program/bbs/view.asp?a_num=<%=a_num%>&b_num=<%=b_num%>&chk_on=<%=chk_on%>"><%=b_subject%></td>
</tr>
<%
				next
%>
</table>
<%
	End if
End Function


'**************  Information  ****************************************
'	Program Title	:	select 쿼리문 생성기
'	Company		    :	(주)나우아이텍 (053)955-9055
'	Creator		    :	최 경 수  2007-03-08
'*********************************************************************
'필드가 많지 않을때는 가급적 사용 자제
'한레코드만 불러올때 쓴다
'ex) SelectQuery("filed1, filed2", "table", "where idx = 1")



Function SelectQuery(R_Fields, table, where)

	Dim loop_i, R_Fields_arr, rs
	R_Fields = Replace(R_Fields, " ", "")
	R_Fields_arr = Split(R_Fields, ",")
	
	where = " " & where
	execute("sql = ""select """)

	For loop_i = 0 To UBound(R_Fields_arr)

		execute("sql = sql & """&R_Fields_arr(loop_i)&"""")
		
		If loop_i < UBound(R_Fields_arr) Then sql = sql & ","
	next
	execute("sql = sql & "" from " &table& " " & where&"""")
	'response.write sql

	execute("set rs = Dbcon.Execute( sql )")
	For loop_i = 0 To UBound(R_Fields_arr)
		execute(R_Fields_arr(loop_i)&" = trim(rs("""&R_Fields_arr(loop_i)&"""))")
	'	execute("response.write rs("""&filed_arr(i)&""") & ""<br>""")
	Next

End Function

Function InsertQuery(R_Fields, table)
	Dim i, R_Fields_arr
	R_Fields = Replace(R_Fields, " ", "")
	R_Fields_arr = Split(R_Fields, ",")

	execute("sql = ""insert into "&table&"("&R_Fields&") values(""")

	For i = 0 To UBound(R_Fields_arr)

		execute("sql = sql & ""'""&"&R_Fields_arr(i)&"&""'""")
	
		If i < UBound(R_Fields_arr) Then sql = sql & ","
	next
	execute("sql = sql & "")""")
	'response.write sql

	Dbcon.Execute sql

End Function

'**************  Information  ****************************************
'	Program Title	:	update 쿼리문 생성기
'	Company		    :	(주)나우아이텍 (053)955-9055
'	Creator		    :	최 경 수  2007-03-08
'*********************************************************************
'필드가 많지 않을때는 가급적 사용 자제
'ex) UpdateQuery("filed1, filed2", "table", "where idx = 1")

Function UpdateQuery(R_Fields, table, where)

	Dim i, R_Fields_arr
	R_Fields = Replace(R_Fields, " ", "")
	R_Fields_arr = Split(R_Fields, ",")
	
	execute("sql = ""update "&table&" set """)

	For i = 0 To UBound(R_Fields_arr)

		execute("sql = sql & """&R_Fields_arr(i)&" = '""&"&R_Fields_arr(i)&"&""'""")
		
		If i < UBound(R_Fields_arr) Then sql = sql & ","
	next
	execute("sql = sql & where")
	'response.write sql

	Dbcon.Execute sql

End Function

%>


<%
'---------------------------------------------------------------------------------------------------------------
'  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="SMS, Mail 호스팅!! 효율적인 업무관리를 위한 순수 웹기반 메시징시스템"									'사이트명



webhard_image_url				= site_root_dir_url&"/Program/webhdd/imgs"						'프로그램 데이터 저장 디렉토리 URL



'메뉴별 서브메인 주소..
'작성자 : 윤종우
'작성일 : 2005-12-17
home_webhdd_url = site_root_dir_url&"/program/member/login.asp"

home_search_url = site_root_dir_url&"/search/default.asp"

main_url = site_root_dir_url&"/default.asp"

%>