⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pingjiaone.asp

📁 教师教学质量评价系统 教师教学质量评价系统 asp 源代码
💻 ASP
字号:
<!--#include file="top.asp"-->
<!--#include file="incsub.asp"-->
<%
If session("UserID")=""  Or session("usertype")="" Or  session("UserNAME")=""  THEN
response.write"<script>alert('请不要非法登陆!');location='index.asp'</script>"	
END IF
If Closeok=1 then
response.write"<script>alert('系统现在不能开始评价\n请等待开通...');location='index.asp'</script>"	
end if
'-------------------------------------------------------------
Dim Depart,Teacher,Depart1,Teacher1,Term,Course
Depart=request("depart")
Teacher=request("Teacher")
'------------------------------------------------------
Depart1=Depart
Teacher1=Teacher
'------------------------------------------------------
if Depart<>"" and Teacher<>"" and Depart<>"请选择教师院系" and Teacher<>"请选择教师" then
strsql="select * from department where id="&depart
set rs=db.execute(strsql)
depart=rs("department")
strsql="select * from teacher where id="&teacher
set rs=db.execute(strsql)
teacher=rs("teachername")
else
Depart=""
Teacher=""
end if
'-------------------------------------------------------
'----------------将院别和教师编号转化成真实的名称
Term=request("Term")
Course=request("Course")
Term1=Term
Course1=Course
if Term<>"" and Course<>"" and Term<>"请选择教师开课学期" and Course<>"请选择教师课程" then
strsql="select * from term where id="&term
set rs=db.execute(strsql)
term=cstr(rs("term"))
strsql="select * from TEACHERCOURSE where id="&course
set rs=db.execute(strsql)
course=cstr(rs("course"))
else
Term=""
Course=""
end if
%>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="wangye9pt.css" rel="stylesheet" type="text/css">
<script language="javascript">
function allok()
{
return window.confirm("数据提交后不能修改,是否继续?")
}
</script>
</head>




<body>
<table width="786" height="500" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="188" rowspan="4" valign="top" background="images/lefttiao.jpg"><!--#include file="left.asp"--></td>
    <td height="20" colspan="2"><img src="images/righttop.jpg" width="598" height="20"></td>
  </tr>
  <tr>
    <td height="50" align="center" valign="top" background="images/rightbg.jpg"><form action="" method="post" name="addform" id="addform">
      <table width="95%"  border="0" cellpadding="0" cellspacing="1" bgcolor="#336699" class="w9pt">
        <tr align="center" bgcolor="#FFFFFF">
          <td height="25" colspan="5" class="9ptred">欢迎
              <%
			usertype=session("usertype")
			if usertype=1 then
			response.Write "领导"
			elseif usertype=2 then
			response.Write "督导"
			elseif usertype=3 then
			response.Write "学生"
			else
			response.Write "教师"
			end if
			%>
        参加投票</td>
        </tr>
        <tr align="center" bgcolor="#FFFFFF">
          <td height="20" colspan="2" ><table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#336699" class="w9pt">
            <tr align="center" valign="middle" bgcolor="#B7B700">
              <td height="25" colspan="5" >目前参加<%=Wtitle%>投票人数:
                  <%
			 strsql="select count(*) as total from TEACHERSCORE where usertype=1"
		     set rs=db.execute(strsql)
			 scorel=rs("total")
			 strsql="select count(*) as total from TEACHERSCORE where usertype=2"
		     set rs=db.execute(strsql)
			 scoret=rs("total")
			 strsql="select count(*) as total from TEACHERSCORE where usertype=3"
		     set rs=db.execute(strsql)
			 scores=rs("total")
			 strsql="select count(*) as total from TEACHERSCORE where usertype=4"
		     set rs=db.execute(strsql)
			 scorett=rs("total")
			 scoresum=scorel+scoret+scores+scorett
			  response.Write scoresum
			 if scoresum=0 then
			 scoresum=1 
			 end if
			
			 tablewid=400
			 tablel=scorel/scoresum*tablewid
			 tablet=scoret/scoresum*tablewid
			 tables=scores/scoresum*tablewid
			 tablett=scorett/scoresum*tablewid
			 
			 '---------------------------------------------------------
			 '显示已经投票的总人数
			 
			%>
                  人</td>
            </tr>
            <tr align="center" valign="middle" bgcolor="#FFFFFF">
              <td height="25" colspan="3" align="left" bgcolor="#FFFFFF" >
                <% response.write "学生:"&scores&"人&nbsp;&nbsp;占"&formatnumber((scores/scoresum*100),2)&"%"%></td>
              <td width="74%" align="left" bgcolor="#FFFFFF" ><table width=<%=tables%> height="10" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td background="images/display3.gif"></td>
                </tr>
              </table></td>
            </tr>
            <tr align="center" valign="middle" bgcolor="#FFFFFF">
              <td height="25" colspan="3" align="left" bgcolor="#FFFFFF" ><% response.write "教师:"&scorett&"人&nbsp;&nbsp;占"&formatnumber((scorett/scoresum*100),2)&"%"%></td>
              <td align="left" bgcolor="#FFFFFF" ><table width=<%=tablett%> height="10" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td background="images/display4.gif"></td>
                </tr>
              </table></td>
            </tr>
            <tr align="center" valign="middle" bgcolor="#FFFFFF">
              <td height="25" colspan="3" align="left" bgcolor="#FFFFFF" >
                <% response.write "督导:"&scoret&"人&nbsp;&nbsp;占"&formatnumber((scoret/scoresum*100),2)&"%"%></td>
              <td height="25" align="left" bgcolor="#FFFFFF" ><table width=<%=tablet%> height="10" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td background="images/display2.gif"></td>
                  </tr>
              </table></td>
            </tr>
            <tr align="center" valign="middle" bgcolor="#FFFFFF">
              <td height="25" colspan="3" align="left" bgcolor="#FFFFFF" ><% response.write "领导:"&scorel&"人&nbsp;&nbsp;占"&formatnumber((scorel/scoresum*100),2)&"%"%></td>
              <td height="25" align="left" bgcolor="#FFFFFF" ><table width=<%=tablel%> height="10" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td background="images/display1.gif"></td>
                  </tr>
                </table></td>
            </tr>
          </table></td>
        </tr>
        <tr align="center" bgcolor="#B7B700">
          <td height="25" colspan="2" valign="middle" ><a href="pingjiaone.asp" target="_self">【重新评价】</a>            <%
sql = "select * FROM TEACHER order by ID asc"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,db,1,1%>
            <script language = "JavaScript">
var onecount1;
onecount1=0;
subcat1 = new Array();
<%count = 0
do while not rs.eof%>
subcat1[<%=count%>] = new Array("<%= trim(rs("TEACHERNAME"))%>","<%= trim(rs("DEPARTID"))%>","<%= trim(rs("ID"))%>");
        <%count = count + 1
        rs.movenext
        loop
        rs.close
        set rs=nothing%>
onecount1=<%=count%>;
function changelocation1(addone)
    {
    document.addform.teacher.length = 0; 
   
    var addone_id=addone_id;
    var i;
	
	
    document.addform.teacher.options[0] = new Option('请选择教师','请选择教师');
    for (i=0;i < onecount1; i++)
        {
            if (subcat1[i][1] == addone)
            { 
                document.addform.teacher.options[document.addform.teacher.length] = new Option(subcat1[i][0], subcat1[i][2]);
            }        
        }
		
        
    }
        </script>          </td>
        </tr>
        <tr align="center" valign="bottom" bgcolor="#FFFFFF">
          <td width="19%" height="25" align="right" valign="middle" class="9ptred" >请选择教师院系:</td>
          <td width="81%" height="25" align="left" valign="middle" class="9ptred" >
		   <%
			if Depart<>"" then
			response.Write Depart
			response.Write "<input name='Depart' type='hidden' value='"&Depart1&"'>"
			else
			%>
		  <select name="depart" id="select7" onChange="changelocation1(document.addform.depart.options[document.addform.depart.selectedIndex].value)">
          
			  <option value="请选择教师院系" selected>请选择教师院系</option>
              <%
sql="select * from DEPARTMENT order by ID desc"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,db,1,1
while not rs.eof%>
              <option value="<%=rs("id")%>"><%=rs("DEPARTMENT")%></option>
              <%rs.movenext
wend
rs.Close()
%>
            </select>
			*
          <% end if%>        
          </td>
        </tr>
        <tr align="center" valign="bottom" bgcolor="#FFFFFF">
          <td height="25" align="right" valign="middle" class="9ptred" >请选择教师:</td>
          <td height="25" align="left" valign="middle" class="9ptred" >
		  <%
			if Teacher<>"" then
			response.Write Teacher
			response.Write "<input name='Teacher' type='hidden' value='"&Teacher1&"'>"
			else
			%>
		  
		  
		  
		  <select name="teacher" id="select8">
              <option selected value="请选择教师">请选择教师</option>
            </select>
        ***
        <input type="submit" name="Submit2" value="选择学期和课程">
		<%end if%>
		</td>
        </tr>
		
		<%
		if teacher<>"" and depart<>"" then
		classterm()
		end if
		'------------------------------------------------选择教师的课程
sub classterm()
sql = "select * FROM TEACHERCOURSE where teachername='"&teacher&"' and  department='"&depart& "' order by ID desc"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,db,1,1%>
<script language = "JavaScript">
var onecount2;
onecount2=0;
subcat2 = new Array();
<%count1 = 0
do while not rs.eof%>
subcat2[<%=count1%>] = new Array("<%= trim(rs("COURSE"))%>","<%= trim(rs("TERMID"))%>","<%= trim(rs("ID"))%>");
        <%count1 = count1 + 1
        rs.movenext
        loop
        rs.close
        set rs=nothing%>
onecount2=<%=count1%>;
function changelocation2(addone)
    {
    document.addform.course.length = 0; 
	var addone_id=addone_id;
    var i;
	
	
    document.addform.course.options[0] = new Option('请选择教师课程','');
    for (i=0;i < onecount2; i++)
        {
            if (subcat2[i][1] == addone)
            { 
                document.addform.course.options[document.addform.course.length] = new Option(subcat2[i][0], subcat2[i][2]);
            }        
        }
		
        
    }
</script>	
        <tr align="center" valign="bottom" bgcolor="#FFFFFF">
          <td height="25" align="right" valign="middle" class="9ptred" >请选择开课学期:</td>
          <td height="25" align="left" valign="middle" class="9ptred" >
		  
		  <%
			if Term<>"" then
			response.Write Term
			response.Write "<input name='Term' type='hidden' value='"&Term1&"'>"
			else
			%>
		  <select name="term" id="term" onChange="changelocation2(document.addform.term.options[document.addform.term.selectedIndex].value)">
<option value="" selected>请选择教师开课学期</option>
                    <%
sql="select * from TERM order by ID desc"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,db,1,1
while not rs.eof%>
<option value="<%=rs("id")%>"><%=rs("TERM")%></option>
<%rs.movenext
wend
rs.Close()
%> 
</select>
          *<%end if%></td>
        </tr>
		
		
        <tr align="center" valign="bottom" bgcolor="#FFFFFF">
          <td height="25" align="right" valign="middle" class="9ptred" >请选择课程:</td>
          <td height="25" align="left" valign="middle" class="9ptred" >
		  
		  <%
			if Course<>"" then
			response.Write Course
			
			response.Write "<input name='Course' type='hidden' value='"&Course1&"'>"
			else
			%>
		  
		  
		  <select name="course" id="course">
<option selected value="">请选择教师课程</option>
</select>
            ***
            <input name="Submit1" type="submit" id="Submit1" value="开始评价">
			<%end if%>
			
			</td>
        </tr>
		<% end sub%>
      </table>
    </form></td>
  </tr>
  <tr>
    <td height="400" align="center" valign="top" background="images/rightbg.jpg">
	 <% 
		  if depart<>"" and teacher<>"" and term<>"" and course<>"" then
		  strsql="select * from TEACHERCOURSE where term='"&term&"' and course='"&course&"' and teachername='"&teacher&"' and department='"&Depart&"'"
		    set rs=db.execute(strsql)
			classok=rs("class")
			'-----------------------------------------------------是否可以投票
			usertype=session("usertype")
			shuliang=cint(session("jishu"))
			userID=session("UserID")
	        IP=REQUEST.ServerVariables("REMOTE_ADDR")
	        Userclass=session("Userclass")
	        Userdepartment=session("Userdepartment")
			USERNAME=session("UserNAME")
			'------------------------------------------------------------------------
			if usertype=3 then
			classokqu=split(classok,"*")
			pingjiaok=0
			len2=ubound(classokqu)
			for t=0 to len2
			if cstr(Userclass)=classokqu(t) then
			pingjiaok=1
			exit for
			end if
			next
			if pingjiaok=0 then
			response.write"<script>alert('此教师的课程你没有学,不能评价!');location='pingjiaone.asp'</script>"	
			response.end()
			end if
			end if
			''学生只能评价自己学过的老师的课程!!!!!!
			'----------------------------------------------------------------------
		    strsql="select count(*) as total from  TEACHERSCORE where term='"&term&"' and teacherid='"&teacher&"' and course='"&course&"' and depart='"&depart&"' and userid='"&userid&"'"
			set rs=db.execute(strsql)
			total1=cint(rs("total"))
			
			if  total1<>0 then
			response.write"<script>alert('"&teach&"老师的"&course&"\n您已经投过票了,不能重复投票"&"');location='pingjiaone.asp'</script>"	
			response.End()
			end if
			
		  
		  %>
	<form action="pingjiaok.asp" method="post" name="FRM" id="FRM" onSubmit="return allok()">
      <table width="95%"  border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td align="center">
		 
		  <%
			usertype=session("usertype")
			if usertype=1 then
			call display3()
			elseif usertype=2 then
			call display2()
			elseif usertype=3 then
			call display1()
			else
			call display4()
			end if
			%>
		  </td>
        </tr>
        <tr>
          <td height="40" align="center"><input name="depart" type="hidden" id="depart" value="<%=depart%>">
            <input name="teacher" type="hidden" id="teacher" value="<%=teacher%>">
            <input name="term" type="hidden" id="term" value="<%=term%>">
            <input name="course" type="hidden" id="course" value="<%=course%>">
            <input type="submit" name="Submit" value="提交结果">              
            <input type="reset" name="Submit3" value="重置"></td></tr>
      </table>
    </form>
	<%end if%></td>
  </tr>
  <tr>
    <td height="30" align="center" valign="top" background="images/rightbg.jpg">&nbsp;</td>
  </tr>
</table>
</body>
</html>

<!--#include file="foot.asp"-->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -