<%if Session("weight")<>5 then 
Response.Redirect "error.asp?cause=4"
 end if
%>
<HTML><HEAD><TITLE>会员管理</TITLE>
<LINK href="css/css.css" rel=stylesheet>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2505.0" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<object runat="server" id="connpic" progid="adodb.connection"></object>
<object runat="server" id="conn1" progid="adodb.connection"></object>
<%application.Lock 
	connpic.Open Application("p_pic")
	conn1.Open Application("p_jyzx")
	Application.UnLock
%>

<%	user_name=Request("user_name")
	Set rs11 = Server.CreateObject("ADODB.Recordset")
	sql="select * from user where user_name='"&Request("user_name")&"'"
	rs11.open sql,conn1,3
	if rs11.RecordCount =0 then
	
	Response.Redirect "error.asp?cause=0"  'cause=0 表示没有这个会员
	elseif rs11("photo")=0 then
		Response.Redirect "error.asp?cause=8"  'cause=8 表示这个会员没有照片
	else
		user_name=rs11("user_name")
		
		nickname=rs11("nickname")
		age=year(date)-rs11("byear")
		work_province=rs11("work_province")
		
		myrnd=myrnd-1
		pic_id=""
		Set rs11 = Server.CreateObject("ADODB.Recordset")
		sql="select id from pic where selected=1 and user_name='"&user_name&"'"
		
		rs11.open sql,connpic,3
		pic_id=rs11("id")
		
		
		if pic_id<>"" then
			
			update_sql="update today_star set user_name='"&user_name&"',nickname='"&nickname&"',age="&age&",work_province='"&work_province&"',pic_id="&pic_id&",my_date="&date
			update_sql=update_sql&" where id="&Request("flag")
			conn1.Execute(update_sql)
		
		end if
	end if
  'Response.Redirect "star_manage.asp"
%>

  <BR><BR><BR><BR><BR>
  <table width="100%" border="0" >
        <tr> 
         <TD height=30 align=center><br><FONT color=red size=5><b>通告</b></FONT></TD>
        <td></td>
        </tr>
      <tr><td align=center><br>
              
    <B><FONT color=#003399 size=2>首页今日之星设定成功！</font>
      </td>
    
      <td >
      <a href="star_manage.asp" ><big><big><big>返回</big></big></big></a></td>
      </tr>
 </table>   



<p align=center>&nbsp;</p>
</BODY></HTML>
