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

v_page    = inputvalue(Request("p_page"))
v_search  = inputvalue(Request("p_search"))
v_keyword = inputvalue(Request("p_keyword"))
page_info = "p_page="&v_page&"&p_block="&v_block&"&p_search="&v_search&"&p_keyword="&v_keyword






e_idx		= inputvalue(request("e_idx")) '--Pk
s_num		= inputvalue(Request("s_num"))
e_subject	= inputvalue(Request("e_subject"))
e_contents	= inputvalue(Request("e_contents"))





if e_idx = "" then  '--등록

	sql="insert emt(s_num, e_subject, e_contents,m_id)"
	sql = sql& " values ("
	sql = sql& " "&s_num&"" '행번
	sql = sql& ", '"&e_subject&"'" '성명
	sql = sql& ", '"&e_contents&"'"
	sql = sql& ", '"&session("ss_m_id")&"'"
	sql = sql& ")"
	
	dbcon.execute(sql)

	ok_url = "m_emoticon.asp?s_num="&s_num

else '--수정

	sql = "UPDATE emt set "
	sql = sql& "  s_num = "&s_num&"" '행번
	sql = sql& ", e_subject = '"&e_subject&"'" '성명
	sql = sql& ", e_contents = '"&e_contents&"'" 
	sql = sql& ", m_id = '"&session("ss_m_id")&"'" 
	
	sql = sql& " where e_idx = "&e_idx


	dbcon.execute(sql)

	ok_url = "m_emoticon.asp?s_num="&s_num&"&"&page_info

end if

dbcon.close
Set dbcon = nothing

'loding "2",ok_url

response.write "<SCRIPT LANGUAGE='JavaScript'>" & VbCrLf
response.write "opener.location.reload();" & VbCrLf
response.write "self.close();" & VbCrLf
response.write "</SCRIPT>" & VbCrLf
%>

