<!--#include file="../checkLogin.asp"-->
<!--#include file="../SQLconn.asp"-->

<% Tno=request("Tno")
   Tname=request("Tname")
   powdername=request("powdername")
   check=true
 
 
 
	 '检查权限
		 
		   Set MyOAASPObj= Server.CreateObject("YFSchoolOApro.YFSchoolDll")
			   if MyOAASPObj.QuanXian(request.cookies("tname"),"系统参数")=0 then 
				response.redirect  "../NoPower.asp"
			   end if 
			   set MyOAASPObj=nothing
	
	'检查权限结束
	 
 
   if Tname=""   then
      check=false
   end if
 
   set RScheck = Conn.Execute("select * from Teachers where   Tno='"&Tno& "'")
       if not RScheck.bof and  not RScheck.eof then
	       check=false
		   response.write("<script>alert('存在重复用户');window.history.back();</script>")
	   end if
    RScheck.Close
	set RScheck = Conn.Execute("select * from Teachers where   Tname='"&Tname& "'")
       if not RScheck.bof and  not RScheck.eof then
	       check=false
		   response.write("<script>alert('已经存在这个姓名的用户了');window.history.back();</script>")
	   end if
    RScheck.Close
   if check=true  then
   set RsPlan=server.createobject("adodb.recordset")
       RsPlansql="select * from Teachers where (Tid is null)" 
       RsPlan.open RsPlansql,conn,1,3
       RsPlan.addnew

       RsPlan("Tno")=Tno
	   RsPlan("Tname")=Tname
	   RsPlan("imgdir")="006Lan"
	   RsPlan("powdergroup")=powdername

       RsPlan.update
       RsPlan.close
	end if 
%>

<link rel="stylesheet" type="text/css" href="../images/<%=request.cookies("imgdir")%>/css/style.css" media="all"/>

 <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p>
<div align="center" title="提示信息框">
<span style="BACKGROUND:#EEEEFF;COLOR:#FF6633;margin: 10px;border:1px dotted #FF6633;font-weight:bold;padding:8px;width=140">
保存成功</span>
</div>
<br><center>
  <p>&nbsp;</p>
  <p>
    <input type="button" class="topanniu" value="继续新建" onclick="location='newUser.asp?'">
  </p>
</center>
 