<!--#include virtual="/common/lib/dbcon.asp"-->
<%

'최근정보인지 확인

R_Fields = "sc_wdate, sc_hdate1, sc_hdate2"
R_tablename_str = "site_config"
R_WHERE_str = " order by sc_idx desc"

value_chk = SelectQuery (R_Fields, R_tablename_str, R_WHERE_str)

domain = Request.ServerVariables("HTTP_HOST")
'//$domain = "rehab21.or.kr";

If value_chk = False Then
	sc_wdate = ""
End if


If sc_wdate <> "" then

	sc_wdate = Left(sc_wdate, 10)
	If sc_wdate <> date() then		'//최근정보가 아니라면 일단 나눔통서버에서 정보를 가져와 업데이트처리
%>
hostChkCreateScript("http://pms.nninc.co.kr/program/project_bbs6/site_info_server.asp?pjb3_domain=<%=domain%>&proc=<%=server.URLEncode("/manager/content/01info/update_ok.asp")%>");
<%
	else		'//최근 정보라면
		sc_hdate2_chk = sc_hdate2
		If sc_hdate2_chk < Date() then		'//호스팅 일자가 
%>
location.href="http://close.15449642.com/";
<%
		End if
	End if
End if


%>

function hostChkCreateScript(src){
	var script = document.createElement('script');
	script.type = 'text/javascript';
	script.src = src;

	var head =  document.getElementsByTagName('head')[0];
	head.appendChild(script);
}


<%

Function SelectQuery(R_Fields, table, where)

	Dim i, R_Fields_arr, rs
	R_Fields = Replace(R_Fields, " ", "")
	R_Fields_arr = Split(R_Fields, ",")
	
	execute("sql = ""select "&R_Fields&" from "" & table & "" "" & where")
	'response.write sql

	Set rs = Dbcon.Execute( sql )

	If rs.bof Or rs.eof Then
		SelectQuery = false
	Else
		SelectQuery = true
		For i = 0 To UBound(R_Fields_arr)	'전역변수에 담기
			execute( R_Fields_arr(i) & "= rs("""&R_Fields_arr(i)&""")")
			'execute("response.write """&R_Fields_arr(i)&"=""&"&R_Fields_arr(i)&"&""<br>""")
		Next
	End if

	Set rs = nothing
End Function

%>
