<%if Session("weight")<>5 then 
Response.Redirect "error.asp?cause=4"
 end if
%>
<object runat=server id=conn1 progid="adodb.connection"></object>
<%application.Lock
conn1.Open Application("p_jyzx")
Application.UnLock
%>
<%

 if Request("object")=1 then
	if Request("public_note")<>"" then
  set rs=server.CreateObject ("ADODB.recordset")
 
   sql="select * from public_note  where object=1 order by time desc"
   rs.Open sql,conn1,2,3
  
	
	rs("public_note")=replace(Request("public_note"),chr(10),"<br>",1,-1,1)
	rs("time")=now()
	rs.Update 
	end if
  
 else
	if Request("select1")=1 then
	set rs=server.CreateObject ("ADODB.recordset")
  
    sql="select * from public_note  where object=2 order by time desc"
    rs.Open sql,conn1,2,3
 	rs("public_note")=replace(Request("public_note"),chr(10),"<br>",1,-1,1)
	rs("time")=now()
	rs.Update 
 
  else
	dim public_note
	set rs=server.CreateObject ("ADODB.recordset")
  
    sql="select * from public_note  where object=2 order by time desc"
    rs.Open sql,conn1,2,3
 	'public_note=replace(Request("public_note")," ","v",1,-1,1)
 	rs("public_note")=replace(Request("public_note"),chr(10),"<br>",1,-1,1)
	rs("time")=now()
	rs.Update 
	set rs_user=server.CreateObject ("ADODB.recordset")
      sql="select * from user"
     rs_user.Open sql,conn1,3
     while not rs_user.EOF
     
    
		Set rs1 = Server.CreateObject("ADODB.Recordset")
		rs1.Open "other_note",conn1,3,2
		rs1.addnew
		rs1("user_name")=rs_user("user_name")
		rs1("from_who")="交友中心管理员"
		rs1("title")="交友中心公告"
		rs1("other_note")=Request("public_note")
		rs1("time")=now()
		rs1.update
	rs_user.MoveNext
	 wend 

 end if

end if
 if Request("object")=1 then
	 Response.Redirect "system_party.asp"
else
	Response.Redirect "manager_note.asp"
end if
%>