<!--#include file="inc/conn.asp"-->
<!--#include file="inc/safe.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="inc/UpLoadClass.asp"-->
<!--#include file="inc/chkimage.asp"-->
<%
if MemberName="" then
  response.Redirect("userlogin.asp")
  response.end
end if
%>
<%
dim errmsg,s,bdname,tname,sortid
errmsg=""

s=request.QueryString("s")

'on error resume next

select case s
  case "1"
    bdname="shipin"
    tname="sppho"
	sortid=5
	

end select

 zjphoto bdname,tname,sortid

Sub zjphoto(bd,t,x)
  dim request2
  set request2=New UpLoadClass
  request2.SavePath="uppic/zj/"
  request2.maxsize=307200
  request2.FileType = "gif/jpg"
  request2.open()
  
  image=request2.form(""& bdname &"")  
 if image<>"" then
  select case Request2.form(""& bdname &"_Err")			
	case 1:
		errmsg=errmsg+"<br><li>文件太大，拒绝上传"		
	case 2:
		errmsg=errmsg+"<br><li>文件格式不对，拒绝上传"		
	case 3:
		errmsg=errmsg+"<br><li>文件太大且格式不对，拒绝上传"
  end select
 end if
 imagepath="uppic/zj/"& image
 Checkimg(imagepath)
 
 if errmsg<>"" then 
  response.Write "<table><tr><td style='font-size:14px'>错误信息：<br></td></tr>"
  response.write("<tr><td style='font-size:12px'><br>"+ errmsg+"<br><br></td></tr>")
  response.Write "<tr><td align='center'><input type='button' value='返回修改' onClick='javascript:window.history.back();'>"
  response.Write "<input type='button' value='关闭窗口' onClick='javascript:window.close();'></td></tr></table>"
  response.end
 end if
 set rs=server.CreateObject("adodb.recordset") 
 sql="select "& tname &",honornew from user_info where userid="& userid &""
 rs.open sql,conn,1,3
 rs(""& tname &"")=image
 honornew=split(rs("honornew"),",")
 
  
 honornew(x-1)=1
 rs("honornew")=honornew(0)&","& honornew(1) &","& honornew(2) &","&honornew(3)&","&honornew(4)
 rs.update
 rs.close
 set rs=nothing
 conn.close
 set conn=nothing
  BackInfo("shipin.asp")
End Sub
%>