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

<!--#include file = "config.asp" -->

<%

R_Fields = "idx, w_width, w_height, w_top, w_left, ck_chk, ck_val, scrollbars, toolbar, menubar, locations, subject, w_chk, wdate, mdate, sdate_y, sdate_m, sdate_d, edate_y, edate_m, edate_d, tot_chk"

Call RequestAll (R_Fields, "")

If Len(sdate_m)=1 Then sdate_m = "0" & sdate_m
If Len(sdate_d)=1 Then sdate_d = "0" & sdate_d
If Len(edate_m)=1 Then edate_m = "0" & edate_m
If Len(edate_d)=1 Then edate_d = "0" & edate_d

sdate = sdate_y&"-"&sdate_m&"-"&sdate_d
edate = edate_y&"-"&edate_m&"-"&edate_d

' 에디터부분은 따로 InputValue2로 필터 해준다..
content = InputValue2(request("content"))

wdate	= getDateFm(now,3)
mdate	= getDateFm(now,3)


if scrollbars	= "" Then scrollbars = "no"
if toolbar		= "" Then toolbar = "no"
if menubar		= "" Then menubar = "no"
if locations	= "" Then locations = "no"
if w_chk		= "" Then w_chk = "N"



if idx = "" then  ' --등록

	R_Fields_i = "w_width, w_height, w_top, w_left, ck_chk, ck_val, scrollbars, toolbar, menubar, locations, subject, content, w_chk, wdate, mdate, sdate, edate, tot_chk"
	
	Call InsertQuery(R_Fields_i, "popup")

	ok_url = "list.asp?"&page_info

Else ' --수정
	
	R_Fields_u = "w_width, w_height, w_top, w_left, ck_chk, ck_val, scrollbars, toolbar, menubar, locations, subject, content, mdate, sdate, edate, tot_chk"

	Call UpdateQuery (R_Fields_u, "popup", "where idx="&idx)

	ok_url = "list.asp?idx="&idx&"&"&page_info

End if

Dbcon.close : Set Dbcon = Nothing

Call loding("0", ok_url)

%>
