<!--#include file="Conn.asp"-->
<%	
	Set rsNews=Server.CreateObject("ADODB.RecordSet")
	Id=Request.Form("Id")
	if request("Star")="" or request("Star")>5 then
	Star=0
	else
	Star=request("Star")
	end if
	If Id="" Then
		rsNews.Open "Select * from Teacher",conn,1,3
		rsNews.Addnew
	Else
		rsNews.Open "Select * from Teacher where Id="&Id,conn,1,3
	End If
	rsNews("TId")=Request.Form("TId")
	rsNews("Name")=Request.Form("Name")
	rsNews("Class")=Request.Form("Class")
	rsNews("Num")=Request.Form("Num")
	rsNews("Star")=Star
	rsNews.Update
	If Id="" Then
		Response.Write "<script language=javascript>alert('添加家教信息成功!!');location.href='../Teacher.asp';</script>"
	Else
		Response.Write "<script language=javascript>alert('修改家教信息成功!!');location.href='../Teacher.asp';</script>"
	End If
%>