<!-- #include file="conn.asp" -->
<!-- #include file="inc.asp" -->
<%
 Call Check_Session("Tch")
 iname=trim(request.form("iname"))
 sex=request.form("sex")
 teach=trim(request.form("teach"))
 school=trim(request.form("school"))
 tschool=request.form("tschool")
 shenfen=request.form("shenfen")
 spec=trim(request.form("spec"))
 edu=request.form("edu")
 tage=request.form("tage")
 tel=trim(request.form("tel"))
 email=trim(request.form("email"))
 qq=trim(request.form("qq"))
 ttime=trim(request.form("ttime"))
 tarea=trim(request.form("tarea"))
 pay=trim(request.form("pay"))
 content=trim(request.form("content"))
 color_value=request.form("color_value")
 color_value_add=request.form("color_value_add")
 top_used=cint(request.form("top_used"))
 top_used_add=cint(request.form("top_used_add"))
 index_time=cint(request.form("index_time"))
 index_time_add=cint(request.form("index_time_add"))
 ip = Request.ServerVariables("HTTP_X_FORWARDED_FOR") 
 If ip = "" Then ip = Request.ServerVariables("REMOTE_ADDR") 
 if qq="" then qq=0 end if
 if content="" then content="无" end if
 if pay="" then pay="面议" end if
 if ttime="" then ttime="不限" end if
 if tarea="" then tarea="不限" end if
 if spec="" then spec="-" end if
 if edu="" then edu="-" end if
 if tage="" then tage="-" end if
 if shenfen="" then shenfen="-" end if
 if tschool="" then tschool="-" end if
 if email="" then email="-" end if

 if color_value<>"-" and Request.Form("color_add")="OK" then
 color_date=1
 else
 color_date=0
 end if
 
 if Cint(Request.Form("tch_id"))=Cint(Session("Tch_id")) then
 set rs=server.createobject("adodb.recordset")
 sql="select * from teacher where id="&makeid("tch","in",Session("Tch_ID"))&""
 rs.open sql,conn,1,3
 rs("iname")=iname
 rs("sex")=sex
 rs("teach")=teach
 rs("school")=school
 rs("tschool")=tschool
 rs("shenfen")=shenfen
 rs("spec")=spec
 rs("edu")=edu
 rs("tage")=tage
 rs("tel")=tel
 rs("email")=email
 rs("qq")=qq
 rs("ttime")=ttime
 rs("tarea")=tarea
 rs("content")=content
 rs("pay")=pay
 rs("pas")=1
 rs("ip")=ip
 rs("idate")=now()
 rs("color_num")=rs("color_num") - color_date
 rs("color_value")=color_value
 if color_date=1 then
 rs("color_time")=dateadd("d",3,now())
 end if
 
 if top_used>0 then
 rs("top_num")=rs("top_num") - top_used
 rs("top_used")=rs("top_used") + top_used
 end if
 if top_used_add>0 then
 rs("top_num")=rs("top_num") - top_used_add
 rs("top_used")=top_used_add
 rs("top_time")=dateadd("d",top_used_add*3,now())
 end if
 
 if index_time>0 then
 rs("index_num")=rs("index_num") - index_time
 rs("index_time")=dateadd("d",index_time,rs("index_time"))
 end if
 if index_time_add>0 then
 rs("index_num")=rs("index_num") - index_time_add
 rs("index_time")=dateadd("d",index_time_add,now())
 end if
 
 rs.update
 rs.close
 set rs=nothing
response.write"<SCRIPT language=JavaScript>alert('教员信息登记成功！');"
response.write"this.location.href='index.asp';</SCRIPT>" 
response.end
else
response.write"<SCRIPT language=JavaScript>alert('非法修改！');"
response.write"this.location.href='index.asp';</SCRIPT>" 
response.end
end if
conn.close
set conn=nothing
%>