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

<%

eb_pk		= InputValue(request("eb_pk"))
ebp_idx		= InputValue(request("ebp_idx"))  ' --일련번호
ebp_code	= InputValue(request("ebp_code")) ' --정렬번호
move		= InputValue(request("move"))   ' --이동





if move = "up" then
	sql = "select top 1 ebp_idx, ebp_code from ebook_page where eb_pk="&eb_pk&" AND ebp_code < "&ebp_code &"  order by ebp_code desc"
ElseIf move = "down" then
	sql = "select top 1 ebp_idx, ebp_code from ebook_page where eb_pk="&eb_pk&" AND ebp_code > "&ebp_code &"  order by ebp_code"
End if

Set Rs = Dbcon.Execute (sql)

If Not rs.eof Then

		v_rsebp_idx  = rs("ebp_idx")  ' -- 대체할 디비번호
		v_rsebp_code = rs("ebp_code") ' -- 대체할 값


		sql1 = "update ebook_page set ebp_code = "&ebp_code &" where ebp_idx = "&v_rsebp_idx
		sql2 = "update ebook_page set ebp_code = "&v_rsebp_code &" where ebp_idx = "&ebp_idx
		Dbcon.execute sql1
		Dbcon.execute sql2

End If


rs.close : Set rs = nothing

Dbcon.close : Set Dbcon = nothing

ok_url = "write_ui.asp?eb_pk="&eb_pk

Call loding ("0",ok_url)

%>