<!--#include file="CommonCode.asp"-->
<%
'**************************************************************
' Software name: PowerEasy SiteWeaver
' Web: http://www.powereasy.net
' Copyright (C) 2005－2008 佛山市动易网络科技有限公司 版权所有
'**************************************************************

Dim rsa, sqla, rs, sql
Dim ClassroomID, lessonYear, lessonMonth, lessonDay, lessonDate, lessonNumber
Dim strSort '保留所选的类的所有子类
Dim StartDay
StartDay="2008-2-25" '室场登记时间初始化，当每学期开学时修改此设置

Sub Execute()
    ClassroomID = PE_CLng(Request("ClassroomID"))
    lessonYear = PE_CLng(Request("lessonYear"))
    lessonMonth = PE_CLng(Request("lessonMonth"))
    lessonDay = PE_CLng(Request("lessonDay"))
    lessonDate = Trim(Request("lessonDate"))
    lessonNumber = PE_CLng(Request("lessonNumber"))
    strSort = ClassroomID
    Call getSort(ClassroomID)
    strFileName = "User_Enrol.asp?ClassroomID=" & ClassroomID & " &lessonYear=" & lessonYear & " & lessonMonth=" & lessonMonth & " &lessonDay=" & lessonDay & " & lessonNumber=" & lessonNumber
    If Request("page") <> "" Then
        CurrentPage = PE_CLng(Request("page"))
    Else
        CurrentPage = 1
    End If
    Response.Write "<table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border2'>" & vbCrLf
    Response.Write "  <tr class='topbg'>" & vbCrLf
    Response.Write "    <td height='22' colspan='2' align='center'><strong>使 用 设 备 登 记</strong></td>" & vbCrLf
    Response.Write "  </tr>" & vbCrLf
    Response.Write "  <tr class='tdbg'>" & vbCrLf
    Response.Write "    <td width='70' height='30'><strong>管理导航：</strong></td>" & vbCrLf
    Response.Write "    <td width='617' >" & vbCrLf
    Response.Write "  <a href='User_Enrol.asp?Action=FixTimeAdd'>登记方式一（固定时间）</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href='User_Enrol.asp?Action=FixEquipAdd'>登记方式二（固定设备）</a>" & vbCrLf
    Response.Write "    </td>" & vbCrLf
    Response.Write "  </tr>" & vbCrLf
    Response.Write "</table>" & vbCrLf
    Select Case Action
    Case "SaveFixTime"
        Call SaveFixTimeEnrol
    Case "ShowFixTime"
        Call ShowFixTimeResult
    Case "SearchResult"
        Call SearchResult
    Case "SaveFixEquip"
        Call SaveFixEquipEnrol
    Case "ShowFixEquip"
        Call ShowFixEquipResult
    Case "SaveBatchEnrol"
        Call SaveBatchEnrol
    Case "ShowBatchResult"
        Call ShowBatchResult
    Case "FixEquipAdd"
        Call FixEquipAdd
    Case Else
        Call FixTimeAdd
    End Select
    If FoundErr = True Then
        Call WriteErrMsg(ErrMsg, ComeUrl)
    End If
End Sub

Sub FixEquipAdd()
    Response.Write "<form name='myform' method='post' action='User_Enrol.asp?action=SearchResult'>" & vbCrLf
    Dim str1, str2, str3, str4, str5, str6, str7
    Dim str11, str22, str33, str44, str55, str66, str77
    Dim i, j, Num
    If Weekday(StartDay) < 7 Then
        Num = 7 - Weekday(StartDay)
    Else
        Num = 7
    End If
    i = 2
    Select Case Weekday(StartDay)
        Case 1
            str11 = TransformDay(DateAdd("d", 1, CDate(StartDay)), 1)
            str1 = "<td align='center' id='sstr" & TransformDay(DateAdd("d", 1, CDate(StartDay)), 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(DateAdd("d", 1, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(DateAdd("d", 1, CDate(StartDay)), 2) & "</a></td>"
            str22 = TransformDay(DateAdd("d", 2, CDate(StartDay)), 1)
            str2 = "<td align='center' id='sstr" & TransformDay(DateAdd("d", 2, CDate(StartDay)), 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(DateAdd("d", 2, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(DateAdd("d", 2, CDate(StartDay)), 2) & "</a></td>"
            str33 = TransformDay(DateAdd("d", 3, CDate(StartDay)), 1)
            str3 = "<td align='center' id='sstr" & TransformDay(DateAdd("d", 3, CDate(StartDay)), 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(DateAdd("d", 3, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(DateAdd("d", 3, CDate(StartDay)), 2) & "</a></td>"
            str44 = TransformDay(DateAdd("d", 4, CDate(StartDay)), 1)
            str4 = "<td align='center' id='sstr" & TransformDay(DateAdd("d", 4, CDate(StartDay)), 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(DateAdd("d", 4, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(DateAdd("d", 4, CDate(StartDay)), 2) & "</a></td>"
            str55 = TransformDay(DateAdd("d", 5, CDate(StartDay)), 1)
            str5 = "<td align='center' id='sstr" & TransformDay(DateAdd("d", 5, CDate(StartDay)), 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(DateAdd("d", 5, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(DateAdd("d", 5, CDate(StartDay)), 2) & "</a></td>"
            str66 = TransformDay(DateAdd("d", 6, CDate(StartDay)), 1)
            str6 = "<td align='center' id='sstr" & TransformDay(DateAdd("d", 6, CDate(StartDay)), 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(DateAdd("d", 6, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(DateAdd("d", 6, CDate(StartDay)), 2) & "</a></td>"
            str7 = "<td align='center' id='sstr" & TransformDay(StartDay, 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(StartDay, 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(StartDay, 2) & "</a></td>"
            str77 = TransformDay(StartDay, 1)
        Case 2
            str1 = "<td align='center' id='sstr" & TransformDay(StartDay, 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(StartDay, 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(StartDay, 2) & "</a></td>"
            str11 = TransformDay(StartDay, 1)
            str22 = TransformDay(DateAdd("d", 1, CDate(StartDay)), 1)
            str2 = "<td align='center' id='sstr" & TransformDay(DateAdd("d", 1, CDate(StartDay)), 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(DateAdd("d", 1, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(DateAdd("d", 1, CDate(StartDay)), 2) & "</a></td>"
            str33 = TransformDay(DateAdd("d", 2, CDate(StartDay)), 1)
            str3 = "<td align='center' id='sstr" & TransformDay(DateAdd("d", 2, CDate(StartDay)), 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(DateAdd("d", 2, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(DateAdd("d", 2, CDate(StartDay)), 2) & "</a></td>"
            str44 = TransformDay(DateAdd("d", 3, CDate(StartDay)), 1)
            str4 = "<td align='center' id='sstr" & TransformDay(DateAdd("d", 3, CDate(StartDay)), 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(DateAdd("d", 3, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(DateAdd("d", 3, CDate(StartDay)), 2) & "</a></td>"
            str55 = TransformDay(DateAdd("d", 4, CDate(StartDay)), 1)
            str5 = "<td align='center' id='sstr" & TransformDay(DateAdd("d", 4, CDate(StartDay)), 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(DateAdd("d", 4, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(DateAdd("d", 4, CDate(StartDay)), 2) & "</a></td>"
            str66 = TransformDay(DateAdd("d", 5, CDate(StartDay)), 1)
            str6 = "<td align='center' id='sstr" & TransformDay(DateAdd("d", 5, CDate(StartDay)), 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(DateAdd("d", 5, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(DateAdd("d", 5, CDate(StartDay)), 2) & "</a></td>"
            str77 = ""
            str7 = "<td>&nbsp;&nbsp;</td>"
        Case 3
            str11 = ""
            str1 = "<td>&nbsp;&nbsp;</td>"
            str2 = "<td align='center' id='sstr" & TransformDay(StartDay, 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(StartDay, 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(StartDay, 2) & "</a></td>"
            str22 = TransformDay(StartDay, 1)
            str33 = TransformDay(DateAdd("d", 1, CDate(StartDay)), 1)
            str3 = "<td align='center' id='sstr" & TransformDay(DateAdd("d", 1, CDate(StartDay)), 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(DateAdd("d", 1, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(DateAdd("d", 1, CDate(StartDay)), 2) & "</a></td>"
            str44 = TransformDay(DateAdd("d", 2, CDate(StartDay)), 1)
            str4 = "<td align='center' id='sstr" & TransformDay(DateAdd("d", 2, CDate(StartDay)), 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(DateAdd("d", 2, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(DateAdd("d", 2, CDate(StartDay)), 2) & "</a></td>"
            str55 = TransformDay(DateAdd("d", 3, CDate(StartDay)), 1)
            str5 = "<td align='center' id='sstr" & TransformDay(DateAdd("d", 3, CDate(StartDay)), 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(DateAdd("d", 3, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(DateAdd("d", 3, CDate(StartDay)), 2) & "</a></td>"
            str66 = TransformDay(DateAdd("d", 4, CDate(StartDay)), 1)
            str6 = "<td align='center' id='sstr" & TransformDay(DateAdd("d", 4, CDate(StartDay)), 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(DateAdd("d", 4, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(DateAdd("d", 4, CDate(StartDay)), 2) & "</a></td>"
            str77 = ""
            str7 = "<td>&nbsp;&nbsp;</td>"
            
        Case 4
            str11 = ""
            str1 = "<td>&nbsp;&nbsp;</td>"
            str22 = ""
            str2 = "<td>&nbsp;&nbsp;</td>"
            str3 = "<td align='center' id='sstr" & TransformDay(StartDay, 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(StartDay, 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(StartDay, 2) & "</a></td>"
            str33 = TransformDay(StartDay, 1)
            str44 = TransformDay(DateAdd("d", 1, CDate(StartDay)), 1)
            str4 = "<td align='center' id='sstr" & TransformDay(DateAdd("d", 1, CDate(StartDay)), 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(DateAdd("d", 1, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(DateAdd("d", 1, CDate(StartDay)), 2) & "</a></td>"
            str55 = TransformDay(DateAdd("d", 2, CDate(StartDay)), 1)
            str5 = "<td align='center' id='sstr" & TransformDay(DateAdd("d", 2, CDate(StartDay)), 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(DateAdd("d", 2, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(DateAdd("d", 2, CDate(StartDay)), 2) & "</a></td>"
            str66 = TransformDay(DateAdd("d", 3, CDate(StartDay)), 1)
            str6 = "<td align='center' id='sstr" & TransformDay(DateAdd("d", 3, CDate(StartDay)), 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(DateAdd("d", 3, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(DateAdd("d", 3, CDate(StartDay)), 2) & "</a></td>"
            str77 = ""
            str7 = "<td>&nbsp;&nbsp;</td>"
        Case 5
            str11 = ""
            str1 = "<td>&nbsp;&nbsp;</td>"
            str22 = ""
            str2 = "<td>&nbsp;&nbsp;</td>"
            str33 = ""
            str3 = "<td>&nbsp;&nbsp;</td>"
            str4 = "<td align='center' id='sstr" & TransformDay(StartDay, 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(StartDay, 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(StartDay, 2) & "</a></td>"
            str44 = TransformDay(StartDay, 1)
            str55 = TransformDay(DateAdd("d", 1, CDate(StartDay)), 1)
            str5 = "<td align='center' id='sstr" & TransformDay(DateAdd("d", 1, CDate(StartDay)), 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(DateAdd("d", 1, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(DateAdd("d", 1, CDate(StartDay)), 2) & "</a></td>"
            str66 = TransformDay(DateAdd("d", 2, CDate(StartDay)), 1)
            str6 = "<td align='center' id='sstr" & TransformDay(DateAdd("d", 2, CDate(StartDay)), 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(DateAdd("d", 2, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(DateAdd("d", 2, CDate(StartDay)), 2) & "</a></td>"
            str77 = ""
            str7 = "<td>&nbsp;&nbsp;</td>"
        Case 6
            str11 = ""
            str1 = "<td>&nbsp;&nbsp;</td>"
            str22 = ""
            str2 = "<td>&nbsp;&nbsp;</td>"
            str33 = ""
            str3 = "<td>&nbsp;&nbsp;</td>"
            str44 = ""
            str4 = "<td>&nbsp;&nbsp;</td>"
            str5 = "<td align='center' id='sstr" & TransformDay(StartDay, 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(StartDay, 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(StartDay, 2) & "</a></td>"
            str55 = TransformDay(StartDay, 1)
            str66 = TransformDay(DateAdd("d", 1, CDate(StartDay)), 1)
            str6 = "<td align='center' id='sstr" & TransformDay(DateAdd("d", 1, CDate(StartDay)), 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(DateAdd("d", 1, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(DateAdd("d", 1, CDate(StartDay)), 2) & "</a></td>"
            str77 = ""
            str7 = "<td>&nbsp;&nbsp;</td>"
        Case 7
            str11 = ""
            str1 = "<td>&nbsp;&nbsp;</td>"
            str22 = ""
            str2 = "<td>&nbsp;&nbsp;</td>"
            str33 = ""
            str3 = "<td>&nbsp;&nbsp;</td>"
            str44 = ""
            str4 = "<td>&nbsp;&nbsp;</td>"
            str55 = ""
            str5 = "<td>&nbsp;&nbsp;</td>"
            str6 = "<td align='center' id='sstr" & TransformDay(StartDay, 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" width='70' height='25'><a class='Date' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(StartDay, 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & TransformDay(StartDay, 2) & "</a></td>"
            str66 = TransformDay(StartDay, 1)
            str77 = ""
            str7 = "<td>&nbsp;&nbsp;</td>"

    End Select

    'Response.Write "<form name='myform' method='post' action='test6.asp'>" & vbCrLf
    Response.Write "<table align='center' width='740' border='0' align='center' cellpadding='2' cellspacing='1' class='border2'>" & vbCrLf
    Response.Write "  <tr class='title'>" & vbCrLf
    Response.Write "    <td colspan='2' align='center'>" & vbCrLf
    Response.Write "      <strong>室场设备使用登记</strong>" & vbCrLf
    Response.Write "    </td>" & vbCrLf
    Response.Write "  </tr>" & vbCrLf
    Response.Write "  <tr class='tdbg2'>" & vbCrLf
    Response.Write "    <td width='150'>" & vbCrLf
    Response.Write "        <strong>使用设备：</strong>" & vbCrLf
    Response.Write "    </td>" & vbCrLf
    Response.Write "    <td>" & vbCrLf
    Response.Write "            <div align='left'>" & vbCrLf
    Response.Write "              <select name='EquipmentID'>" & vbCrLf
    Dim sql
    Dim rs
    Dim rsID, rsName
    Set rs = Server.CreateObject("adodb.recordset")
    sql = "select E.ID,E.EquipmentName,C.ClassroomName from PE_Equipment E left join PE_Classroom C on E.ClassroomID=C.ID  order by E.ClassroomID asc,E.id asc"
    rs.Open sql, Conn, 1, 1
    If rs.EOF Then
            Response.Write "<option value=''>尚未添加室场设备"
            Response.Write "</option>"
    Else
        Do While Not rs.EOF
            rsID = rs("id")
            rsName = rs("EquipmentName")
            Response.Write "<option value=" & rsID
            Response.Write ">"
            Response.Write rsName & "(" & rs("ClassroomName") & ")</option>"
            rs.MoveNext
        Loop
    End If
    Response.Write "              </select>" & vbCrLf
    Response.Write "            </div>" & vbCrLf
    Response.Write "    </td>" & vbCrLf
    Response.Write "  </tr>" & vbCrLf
    Response.Write "  <tr class='tdbg'>" & vbCrLf
    Response.Write "    <td width='150'>" & vbCrLf
    Response.Write "        <strong>使用班级：</strong>" & vbCrLf
    Response.Write "    </td>" & vbCrLf
    Response.Write "    <td>" & vbCrLf
    Response.Write "      <input type='text' name='EnrolClass'>" & vbCrLf
    Response.Write "    </td>" & vbCrLf
    Response.Write "  </tr>" & vbCrLf
    Response.Write "  <tr class='tdbg2'>" & vbCrLf
    Response.Write "    <td width='150'>" & vbCrLf
    Response.Write "        <strong>课程信息：</strong>" & vbCrLf
    Response.Write "    </td>" & vbCrLf
    Response.Write "    <td>" & vbCrLf
    Response.Write "     <textarea name='LessonInfo' rows='4' cols='70'></textarea>" & vbCrLf
    Response.Write "    </td>" & vbCrLf
    Response.Write "  </tr>" & vbCrLf
    Response.Write "  <tr class='tdbg'>" & vbCrLf
    Response.Write "    <td width='150'>" & vbCrLf
    Response.Write "       <strong> 指定时间：</strong>" & vbCrLf
    Response.Write "        <br><div align='left'><font color='#006600'>注：<br>&nbsp;&nbsp;1、点击单个的日期可以选取当天的课时，支持多选；<br>&nbsp;&nbsp;2、点击左边的周次会选中此周所有日期选取课时；<br>&nbsp;&nbsp;3、点击顶部的星期将选中所有周次的这个星期选取课时；<br>&nbsp;&nbsp;4、选中后皆支持再修改。</font></div>" & vbCrLf
    Response.Write "    </td>" & vbCrLf
    Response.Write "    <td align='left'>" & vbCrLf

    Response.Write "<table align='center' width='580'  border='1' cellspacing='0' cellpadding='0' style='WORD-BREAK: break-all;' class='Date_border'>" & vbCrLf
    Response.Write "  <tr align='center' class='Date_title' height='30'>" & vbCrLf
    Response.Write "    <td >周次</td>" & vbCrLf
    Response.Write "    <td><a class='title' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=1&DaySelect=str" & TransformDay(DateAdd("d", Num + 1, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">日</a></td>" & vbCrLf
    Response.Write "    <td><a class='title' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=1&DaySelect=str" & TransformDay(DateAdd("d", Num + 2, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">一</a></td>" & vbCrLf
    Response.Write "    <td><a class='title' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=1&DaySelect=str" & TransformDay(DateAdd("d", Num + 3, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">二</a></td>" & vbCrLf
    Response.Write "    <td><a class='title' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=1&DaySelect=str" & TransformDay(DateAdd("d", Num + 4, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">三</a></td>" & vbCrLf
    Response.Write "    <td><a class='title' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=1&DaySelect=str" & TransformDay(DateAdd("d", Num + 5, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">四</a></td>" & vbCrLf
    Response.Write "    <td><a class='title' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=1&DaySelect=str" & TransformDay(DateAdd("d", Num + 6, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">五</a></td>" & vbCrLf
    Response.Write "    <td><a class='title' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=1&DaySelect=str" & TransformDay(DateAdd("d", Num + 7, CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">六</a></td>" & vbCrLf
    Response.Write "  </tr>" & vbCrLf
    Response.Write "  <tr>" & vbCrLf
    Response.Write "    <td align='center' class='Date_tdbg'>1</td>" & vbCrLf
    Response.Write str7 & vbCrLf
    Response.Write str1 & vbCrLf
    Response.Write str2 & vbCrLf
    Response.Write str3 & vbCrLf
    Response.Write str4 & vbCrLf
    Response.Write str5 & vbCrLf
    Response.Write str6 & vbCrLf
    Response.Write "  </tr>" & vbCrLf
    For i = 2 To 22

        Response.Write "  <tr>" & vbCrLf
        Response.Write "    <td align='center' class='Date_tdbg' id='s" & i & "str" & TransformDay(DateAdd("d", Num + 1 + 7 * (i - 2), CDate(StartDay)), 1) & "'>" & vbCrLf
        Response.Write "      <a class='lefts' href='#' onclick=""window.open('User_SelectTime.asp?ShowStyle=2&DaySelect=str" & TransformDay(DateAdd("d", Num + 1 + 7 * (i - 2), CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & vbCrLf
        Response.Write i
        Response.Write "      </a>" & vbCrLf
        Response.Write "    </td>" & vbCrLf
        For j = 1 To 7
            Response.Write "        <td align='center' id='sstr" & TransformDay(DateAdd("d", Num + j + 7 * (i - 2), CDate(StartDay)), 1) & "' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"" onclick="""" width='70' height='25'>" & vbCrLf
            Response.Write "          <a href='#' class='Date' onclick=""window.open('User_SelectTime.asp?ShowStyle=0&DaySelect=str" & TransformDay(DateAdd("d", Num + j + 7 * (i - 2), CDate(StartDay)), 1) & "', 'strLesson', 'width=400,height=100,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no');"">" & vbCrLf
            Response.Write "            " & TransformDay(DateAdd("d", Num + j + 7 * (i - 2), CDate(StartDay)), 2)
            Response.Write "            " & vbCrLf
            Response.Write "          </a>" & vbCrLf
            Response.Write "        </td>" & vbCrLf
        Next
        Response.Write "  </tr>" & vbCrLf
      
    Next


    Response.Write "</table>" & vbCrLf
    Response.Write "    </td>" & vbCrLf
    Response.Write "  </tr>" & vbCrLf
    Response.Write "  <tr class='tdbg2'>" & vbCrLf
    Response.Write "    <td colspan='2' align='center'>" & vbCrLf
    Response.Write "      <input type='submit' name='Submit' value='搜索'>" & vbCrLf
    Response.Write "    </td>" & vbCrLf
    Response.Write "  </tr>" & vbCrLf
    Response.Write "" & vbCrLf
    Response.Write "</table>" & vbCrLf
    Response.Write "" & vbCrLf
    Response.Write "<table width='60%'  border='1' cellspacing='0' cellpadding='0' style='display:none'>" & vbCrLf
    Response.Write "  <tr>" & vbCrLf
    Response.Write "    <td align='center'>1</td>" & vbCrLf
    Response.Write "    <td><input type='text' name='str" & str77 & "' value=''></td>" & vbCrLf
    Response.Write "    <td><input type='text' name='str" & str11 & "' value=''></td>" & vbCrLf
    Response.Write "    <td><input type='text' name='str" & str22 & "' value=''></td>" & vbCrLf
    Response.Write "    <td><input type='text' name='str" & str33 & "' value=''></td>" & vbCrLf
    Response.Write "    <td><input type='text' name='str" & str44 & "' value=''></td>" & vbCrLf
    Response.Write "    <td><input type='text' name='str" & str55 & "' value=''></td>" & vbCrLf
    Response.Write "    <td><input type='text' name='str" & str66 & "' value=''></td>" & vbCrLf
    Response.Write "  </tr>" & vbCrLf

    i = 2
    For i = 2 To 22

        Response.Write "  <tr>" & vbCrLf
        Response.Write "    <td align='center'>" & i & "</td>" & vbCrLf
        For j = 1 To 7
            Response.Write "        <td>" & vbCrLf
            Response.Write "          <input type='text' name='str" & TransformDay(DateAdd("d", Num + j + 7 * (i - 2), CDate(StartDay)), 1) & "' id='str" & TransformDay(DateAdd("d", Num + j + 7 * (i - 2), CDate(StartDay)), 1) & "' value=''>" & vbCrLf
            Response.Write "        </td>" & vbCrLf
        Next
        Response.Write "  </tr>" & vbCrLf
      
    Next


    Response.Write "</table>" & vbCrLf
    Response.Write "</form>" & vbCrLf
End Sub

Sub FixTimeAdd()
    Response.Cookies("Enrol") = "No"
    Response.Write "<br><table width='100%'><tr><td align='left'>您现在的位置：专用室场使用 &nbsp;&gt;&gt;&nbsp;使用设备查询"
    Response.Write "</td><td align='right'>"
    Set rs = Server.CreateObject("adodb.recordset")
    sql = "select F.id, F.EquipmentName, F.EquipmentSituation, C.ClassroomName from PE_Equipment F left join PE_Classroom C on F.ClassroomID =C.id where 1=1"
    If ClassroomID > 0 Then
        sql = sql & " and F.ClassroomID in (" & strSort & ")"
    End If
    sql = sql & " order by F.ID asc"
    rs.Open sql, Conn, 1, 1
    rs.pagesize = MaxPerPage
    If rs.BOF And rs.EOF Then
        Response.Write "共找到 <font color=red>0</font> 台设备</td></tr></table>"
    Else
        totalPut = rs.RecordCount
        If lessonYear = 0 Then
            Response.Write "没有指定查询条件!</td></tr></table>"
        Else
            Response.Write "共找到 <font color=red>" & totalPut & "</font> 台设备</td></tr></table>"
        End If
    End If
    If CurrentPage < 1 Then
        CurrentPage = 1
    End If
    If (CurrentPage - 1) * MaxPerPage > totalPut Then
        If (totalPut Mod MaxPerPage) = 0 Then
            CurrentPage = totalPut \ MaxPerPage
        Else
            CurrentPage = totalPut \ MaxPerPage + 1
        End If
    End If
    If CurrentPage > 1 Then
        If (CurrentPage - 1) * MaxPerPage < totalPut Then
            rs.Move (CurrentPage - 1) * MaxPerPage
        Else
            CurrentPage = 1
        End If
    End If
    Response.Write "    <table width='100%' class='border2' border='0' cellspacing='1' cellpadding='4' align='center'>" & vbCrLf
    Response.Write "      <tr class='title'>" & vbCrLf
    Response.Write "        <td width='12%' nowrap> " & vbCrLf
    Response.Write "          <div align='center'><b>设备名称</b></div>" & vbCrLf
    Response.Write "        </td>" & vbCrLf
    Response.Write "        <td width='12%' nowrap> " & vbCrLf
    Response.Write "          <div align='center'><b>所属室场</b></div>" & vbCrLf
    Response.Write "        </td>" & vbCrLf
    Response.Write "        <td width='10%' nowrap> " & vbCrLf
    Response.Write "          <div align='center'><b>设备状态</b></div>" & vbCrLf
    Response.Write "        </td>   " & vbCrLf
    Response.Write "        <td width='24%' nowrap>  " & vbCrLf
    Response.Write "          <div align='center'><b>具体使用时间</b></div>" & vbCrLf
    Response.Write "        </td>    " & vbCrLf
    Response.Write "        <td width='12%' nowrap> " & vbCrLf
    Response.Write "          <div align='center'><b>登记状态</b></div>" & vbCrLf
    Response.Write "        </td>" & vbCrLf
    Response.Write "        <td width='18%' nowrap> " & vbCrLf
    Response.Write "          <div align='center'><b>使用人</b></div>" & vbCrLf
    Response.Write "        </td>" & vbCrLf

    Response.Write "        <td width='12%' nowrap> " & vbCrLf
    Response.Write "          <div align='center'><b>登记</b></div>" & vbCrLf
    Response.Write "        </td>" & vbCrLf
    Response.Write "      </tr>" & vbCrLf
    If lessonYear = 0 Then
        Response.Write "          <tr class='tdbg'><td colspan='11' align='center'>" & vbCrLf
        Response.Write "请指定查询条件!"
        Response.Write "            </td><tr>" & vbCrLf
    Else
        Dim i, rs1, sql1
        i = 0
        Do While Not rs.EOF
            Response.Write "<tr class='tdbg' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"">" & vbCrLf
            Response.Write "  <td width='12%' align='center'>" & rs("EquipmentName") & "</td>" & vbCrLf
            Response.Write "  <td width='12%' align='center'>" & rs("ClassroomName") & "</td>" & vbCrLf
            Response.Write "  <td width='10%' align='center'>" & vbCrLf
            If rs("EquipmentSituation") = 1 Then
                Response.Write ("正常")
            Else
                Response.Write ("不正常")
            End If
            Response.Write "  </td><td width='24%' align='center'>" & lessonYear & "年" & vbCrLf
            Response.Write lessonMonth & "月"
            Response.Write lessonDay & "日&nbsp;&nbsp;第"
            Response.Write lessonNumber & "节课</td>"
         
            Set rs1 = Server.CreateObject("adodb.recordset")
            sql1 = "select * from PE_UsedDetail where lessonYear=" & lessonYear & " and lessonMonth=" & lessonMonth & " and lessonDay=" & lessonDay & " and lessonNumber=" & lessonNumber & " and EquipmentID =" & rs("id")
            rs1.Open sql1, Conn, 1, 1
            If rs1.EOF Then
                Response.Write "<td width='12%' align='center'>未登记</td>" & vbCrLf
                Response.Write "<td width='18%' align='center'>无人用</td>" & vbCrLf
                Response.Write "<td width='12%' align='center'><a href='User_Enrol.asp?Action=SaveFixTime&id=" & rs("id") & "&lessonYear=" & lessonYear & "&lessonMonth=" & lessonMonth & "&lessonDay=" & lessonDay & "&lessonNumber=" & lessonNumber & "'><font color='#0000ff'>我要用</font></a></td>" & vbCrLf
            Else
                If rs1.RecordCount = 1 Then
                    If rs1("Used") = 2 Then
                        Response.Write "<td width='12%' align='center'>已使用</td>" & vbCrLf
                    ElseIf rs1("Used") = 1 Then
                        Response.Write "<td width='12%' align='center'>已确认</td>" & vbCrLf
                    Else
                        Response.Write "<td width='12%' align='center'>已登记</td>" & vbCrLf
                    End If
                    Response.Write "<td width='18%' align='center'>" & rs1("UserName") & "</td>" & vbCrLf
                    If rs1("Used") <> 2 And rs1("Used") <> 1 Then
                        Response.Write "<td width='12%' align='center'><a href='User_Enrol.asp?Action=SaveFixTime&id=" & rs("id") & "&lessonYear=" & lessonYear & "&lessonMonth=" & lessonMonth & "&lessonDay=" & lessonDay & "&lessonNumber=" & lessonNumber & "'><font color='#0000ff'>我要用</font></a></td>" & vbCrLf
                    Else
                        Response.Write "<td width='12%' align='center'>&nbsp;</td>" & vbCrLf
                    End If
                Else
                    Dim strUserName
                    Do While Not rs1.EOF
                        If strUserName = "" Then
                            strUserName = rs1("UserName")
                        Else
                            strUserName = strUserName & "," & rs1("UserName")
                        End If
                        rs1.MoveNext
                    Loop
                    Response.Write "<td width='12%' align='center'>已登记</td>" & vbCrLf
                    Response.Write "<td width='18%' align='center'>" & strUserName & "</td>" & vbCrLf
                    Response.Write "<td width='12%' align='center'><a href='User_Enrol.asp?Action=SaveFixTime&id=" & rs("id") & "&lessonYear=" & lessonYear & "&lessonMonth=" & lessonMonth & "&lessonDay=" & lessonDay & "&lessonNumber=" & lessonNumber & "'><font color='#0000ff'>我要用</font></a></td>" & vbCrLf
                End If

            End If
            i = i + 1
            If i > MaxPerPage Then
                Exit Do
            End If
            rs.MoveNext
        Loop
    End If
    Response.Write "</table>" & vbCrLf
    If totalPut > 0 Then
        Response.Write ShowPage(strFileName, totalPut, MaxPerPage, CurrentPage, True, True, "台设备", True)
    End If
    Response.Write ShowSearch()
End Sub
Function TransResult(ByVal strDay, ByVal strRequest)
    Dim arrHour, strTemp, i
    arrHour = Split(strRequest, ",")
    For i = 0 To UBound(arrHour)
        If i = 0 Then
            strTemp = strDay & "$" & arrHour(i)
        Else
            If arrHour(i) > arrHour(i - 1) Then
                strTemp = strTemp & "|||" & strDay & "$" & arrHour(i)
            Else
                strTemp = strDay & "$" & arrHour(i) & "|||" & strTemp
            End If
        End If
    Next
    TransResult = strTemp
End Function

Sub SearchResult()
    Dim i, j, strNum, EquipmentID, CollectionDay, arrCollectionDay, EnrolClass, LessonInfo
    EquipmentID = Trim(Request("EquipmentID"))
    EnrolClass = Trim(Request("EnrolClass"))
    LessonInfo = Trim(Request("LessonInfo"))

    If LessonInfo = "" Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>请填写课程信息！</li>"
        Exit Sub
    End If
    If EnrolClass = "" Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>请指定要使用的班级！</li>"
        Exit Sub
    'else
        'EnrolClass=PE_clng(EnrolClass)
    End If
    If EquipmentID = "" Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>请指定要使用的设备ID！</li>"
        Exit Sub
    Else
        EquipmentID = PE_CLng(EquipmentID)
    End If
    If Weekday(StartDay) < 7 Then
        strNum = Weekday(StartDay) - 1
    Else
        strNum = -1
    End If
    j = 0
    CollectionDay = Trim(Request("CollectionDay"))
    If CollectionDay = "" Then
        For i = 0 To 22 * 7 - strNum
            Dim tempDay
            tempDay = TransformDay(DateAdd("d", i, CDate(StartDay)), 1)
            If Request("str" & tempDay) <> "" Then
                If CollectionDay = "" Then
                    CollectionDay = TransResult(tempDay, Request("str" & tempDay))
                Else
                    CollectionDay = CollectionDay & "|||" & TransResult(tempDay, Request("str" & tempDay))
                End If
            End If
        Next
    End If

    If CollectionDay = "" Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>请指定要搜索的时间！</li>"
        Exit Sub
    End If
    Response.Cookies("Enrol") = "No"
    Response.Write "<br><table width='100%'><tr><td align='left'>您现在的位置：专用室场使用 &nbsp;&gt;&gt;&nbsp;使用室场查询"
    Response.Write "</td><td align='right'>"
    Dim rsEName
    Set rsEName = Conn.Execute("select F.EquipmentName, F.EquipmentSituation, C.ClassroomName from PE_Equipment F left join PE_Classroom C on F.ClassroomID =C.id where F.id=" & EquipmentID & "")
    If rsEName.EOF Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>请指定要搜索的室场！</li>"
        Exit Sub
    End If

    arrCollectionDay = Split(CollectionDay, "|||")

    totalPut = UBound(arrCollectionDay)
    totalPut = totalPut + 1
    Response.Write "共指定了 <font color=red>" & totalPut & "</font> 个时间</td></tr></table>"
    If CurrentPage < 1 Then
        CurrentPage = 1
    End If
    If (CurrentPage - 1) * MaxPerPage > totalPut Then
        If (totalPut Mod MaxPerPage) = 0 Then
            CurrentPage = totalPut \ MaxPerPage
        Else
            CurrentPage = totalPut \ MaxPerPage + 1
        End If
    End If
    If CurrentPage > 1 Then
        If (CurrentPage - 1) * MaxPerPage < totalPut Then
            j = (CurrentPage - 1) * MaxPerPage
        Else
            CurrentPage = 1
        End If
    End If
    Call ShowJS_Main("室场")
    Response.Write "<SCRIPT language=javascript>" & vbCrLf
    Response.Write "function ConfirmEnrol(){" & vbCrLf
    Response.Write " if(document.myform.Action.value=='SaveBatchEnrol'){" & vbCrLf
    Response.Write "     if(confirm('确定要预约选中的时间使用该室场吗？'))" & vbCrLf
    Response.Write "         return true;" & vbCrLf
    Response.Write "     else" & vbCrLf
    Response.Write "         return false;" & vbCrLf
    Response.Write " }}" & vbCrLf
    Response.Write "</SCRIPT>" & vbCrLf
    Response.Write "    <table width='100%' class='border2' border='0' cellspacing='1' cellpadding='4' align='center'>" & vbCrLf
    Response.Write "    <form name='myform' name='myform' method='Post' action='User_Enrol.asp' onsubmit='return ConfirmEnrol();'>"
    Response.Write "      <tr class='title'>" & vbCrLf
    Response.Write "    <td width='6%' align='center'><strong>选中</strong></td>"
    Response.Write "        <td width='12%' nowrap> " & vbCrLf
    Response.Write "          <div align='center'><b>设备名称</b></div>" & vbCrLf
    Response.Write "        </td>" & vbCrLf
    Response.Write "        <td width='12%' nowrap> " & vbCrLf
    Response.Write "          <div align='center'><b>所属室场</b></div>" & vbCrLf
    Response.Write "        </td>" & vbCrLf
    Response.Write "        <td width='10%' nowrap> " & vbCrLf
    Response.Write "          <div align='center'><b>设备状态</b></div>" & vbCrLf
    Response.Write "        </td>   " & vbCrLf
    Response.Write "        <td width='18%' nowrap>  " & vbCrLf
    Response.Write "          <div align='center'><b>具体使用时间</b></div>" & vbCrLf
    Response.Write "        </td>    " & vbCrLf
    Response.Write "        <td width='12%' nowrap> " & vbCrLf
    Response.Write "          <div align='center'><b>登记状态</b></div>" & vbCrLf
    Response.Write "        </td>" & vbCrLf
    Response.Write "        <td width='18%' nowrap> " & vbCrLf
    Response.Write "          <div align='center'><b>使用人</b></div>" & vbCrLf
    Response.Write "        </td>" & vbCrLf

    Response.Write "        <td width='12%' nowrap> " & vbCrLf
    Response.Write "          <div align='center'><b>登记</b></div>" & vbCrLf
    Response.Write "        </td>" & vbCrLf
    Response.Write "      </tr>" & vbCrLf

    Dim rs1, sql1, TempDate

    Do While j < totalPut
        Response.Write "<tr class='tdbg' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"">" & vbCrLf
        TempDate = Split(arrCollectionDay(j), "$")
        Set rs1 = Server.CreateObject("adodb.recordset")
        sql1 = "select * from PE_UsedDetail where lessonYear=" & Year(TempDate(0)) & " and lessonMonth=" & Month(TempDate(0)) & " and lessonDay=" & Day(TempDate(0)) & " and lessonNumber=" & PE_CLng(TempDate(1)) & " and EquipmentID =" & EquipmentID
        rs1.Open sql1, Conn, 1, 1
        If rs1.EOF Then
            Response.Write "  <td width='6%' align='center'><input name='strDateID' type='checkbox' onclick='unselectall()' value='" & arrCollectionDay(j) & "'></td>" & vbCrLf
            Response.Write "  <td width='12%' align='center'>" & rsEName("EquipmentName") & "</td>" & vbCrLf
            Response.Write "  <td width='12%' align='center'>" & rsEName("ClassroomName") & "</td>" & vbCrLf
            Response.Write "  <td width='10%' align='center'>" & vbCrLf
            If rsEName("EquipmentSituation") = 1 Then
                Response.Write ("正常")
            Else
                Response.Write ("不正常")
            End If
            Response.Write "  </td>" & vbCrLf
            Response.Write " <td width='18%' align='center'>" & vbCrLf
            Response.Write TempDate(0) & "  第" & TempDate(1) & "节课"
            Response.Write "</td>"
            Response.Write "<td width='12%' align='center'>未登记</td>" & vbCrLf
            Response.Write "<td width='18%' align='center'>无人用</td>" & vbCrLf
            Response.Write "<td width='12%' align='center'><a href='User_Enrol.asp?Action=SaveFixEquip&EnrolClass=" & EnrolClass & "&LessonInfo=" & LessonInfo & "&id=" & EquipmentID & "&lessonDate=" & TempDate(0) & "&lessonNumber=" & TempDate(1) & "'><font color='#0000ff'>我要用</font></a></td>" & vbCrLf
        Else
            If rs1.RecordCount = 1 Then
                If rs1("Used") <> 2 And rs1("Used") <> 1 Then
                    Response.Write "  <td width='6%' align='center'><input name='strDateID' type='checkbox' onclick='unselectall()' value='" & arrCollectionDay(j) & "'></td>" & vbCrLf
                Else
                    Response.Write "  <td width='6%' align='center'><input name='strDateID' disabled type='checkbox' onclick='unselectall()' value='" & arrCollectionDay(j) & "'></td>" & vbCrLf
                End If
                Response.Write "  <td width='12%' align='center'>" & rsEName("EquipmentName") & "</td>" & vbCrLf
                Response.Write "  <td width='12%' align='center'>" & rsEName("ClassroomName") & "</td>" & vbCrLf
                Response.Write "  <td width='10%' align='center'>" & vbCrLf
                If rsEName("EquipmentSituation") = 1 Then
                    Response.Write ("正常")
                Else
                    Response.Write ("不正常")
                End If
                Response.Write "  </td>" & vbCrLf
                Response.Write " <td width='18%' align='center'>" & vbCrLf
                Response.Write TempDate(0) & "  第" & TempDate(1) & "节课"
                Response.Write "</td>"
                If rs1("Used") = 2 Then
                    Response.Write "<td width='12%' align='center'>已使用</td>" & vbCrLf
                ElseIf rs1("Used") = 1 Then
                    Response.Write "<td width='12%' align='center'>已确认</td>" & vbCrLf
                Else
                    Response.Write "<td width='12%' align='center'>已登记</td>" & vbCrLf
                End If
                Response.Write "<td width='18%' align='center'>" & rs1("UserName") & "</td>" & vbCrLf
                If rs1("Used") <> 2 And rs1("Used") <> 1 Then
                    Response.Write "<td width='12%' align='center'><a href='User_Enrol.asp?Action=SaveFixEquip&EnrolClass=" & EnrolClass & "&LessonInfo=" & LessonInfo & "&id=" & EquipmentID & "&lessonDate=" & TempDate(0) & "&lessonNumber=" & TempDate(1) & "'><font color='#0000ff'>我要用</font></a></td>" & vbCrLf
                Else
                    Response.Write "<td width='12%' align='center'>&nbsp;</td>" & vbCrLf
                End If
            Else
                Dim strUserName
                Do While Not rs1.EOF
                    If strUserName = "" Then
                        strUserName = rs1("UserName")
                    Else
                        strUserName = strUserName & "," & rs1("UserName")
                    End If
                    rs1.MoveNext
                Loop
                Response.Write "  <td width='6%' align='center'><input name='strDateID' type='checkbox' onclick='unselectall()' value='" & arrCollectionDay(j) & "'></td>" & vbCrLf
                Response.Write "  <td width='12%' align='center'>" & rsEName("EquipmentName") & "</td>" & vbCrLf
                Response.Write "  <td width='12%' align='center'>" & rsEName("ClassroomName") & "</td>" & vbCrLf
                Response.Write "  <td width='10%' align='center'>" & vbCrLf
                If rsEName("EquipmentSituation") = 1 Then
                    Response.Write ("正常")
                Else
                    Response.Write ("不正常")
                End If
                Response.Write "  </td>" & vbCrLf
                Response.Write " <td width='18%' align='center'>" & vbCrLf
                Response.Write TempDate(0) & "  第" & TempDate(1) & "节课"
                Response.Write "</td>"
                Response.Write "<td width='12%' align='center'>已登记</td>" & vbCrLf
                Response.Write "<td width='18%' align='center'>" & strUserName & "</td>" & vbCrLf
                Response.Write "<td width='12%' align='center'><a href='User_Enrol.asp?Action=SaveFixEquip&EnrolClass=" & EnrolClass & "&LessonInfo=" & LessonInfo & "&id=" & EquipmentID & "&lessonDate=" & TempDate(0) & "&lessonNumber=" & TempDate(1) & "'><font color='#0000ff'>我要用</font></a></td>" & vbCrLf
            End If

        End If
        j = j + 1
        If j - (CurrentPage - 1) * MaxPerPage >= MaxPerPage Then
            Exit Do
        End If
    Loop
    Set rsEName = Nothing
    Response.Write "</table>" & vbCrLf

    Response.Write "<table width='100%' border='0' cellpadding='0' cellspacing='0'>"
    Response.Write "  <tr>"
    Response.Write "    <td width='200' height='30'><input name='chkAll' type='checkbox' id='chkAll' onclick='CheckAll(this.form)' value='checkbox'>选中本页显示的所有时间</td><td>"
    Response.Write "<input name='submit1' type='submit' value='预约选定的所有时间' onClick=""document.myform.Action.value='SaveBatchEnrol'"">"
    Response.Write "<input name='Action' type='hidden' id='Action' value=''>"
    Response.Write "<input name='id' type='hidden' id='id' value='" & EquipmentID & "'>"
    Response.Write "<input name='EnrolClass' type='hidden' value='" & EnrolClass & "'>"
    Response.Write "<input name='LessonInfo' type='hidden' value='" & LessonInfo & "'>"
    Response.Write "  </td></tr>"
    Response.Write "</form></table>"
    Response.Write "</td>"
    Response.Write "</tr></table>"
    If totalPut > 0 Then
        strFileName = "User_Enrol.asp?Action=SearchResult&EquipmentID=" & EquipmentID & "&EnrolClass=" & EnrolClass & "&LessonInfo=" & LessonInfo & "&CollectionDay=" & CollectionDay
        Response.Write ShowPage(strFileName, totalPut, MaxPerPage, CurrentPage, True, True, "个时间", True)
    End If
    'Response.Write ShowSearch()
End Sub

Function ShowSearch()
    Response.Write "    <form method='post' action='User_Enrol.asp' name='form1'>" & vbCrLf
    Response.Write "      <table width='100%' border='0' cellspacing='1' cellpadding='2' class='border2' align='center'>" & vbCrLf
    Response.Write "        <tr class='tdbg'> " & vbCrLf
    Response.Write "          <td width='100'><strong>指定查询条件：</strong></td>" & vbCrLf
    Response.Write "          <td width='250'> " & vbCrLf
    Response.Write "            <p align='left'>使用时间：  " & vbCrLf
    Dim i
    Response.Write "        <select name='lessonYear'>"
    For i = 2005 To 2012
        If i = Year(Date) Then
            Response.Write "<option value='" & i & "' selected>" & i & "</option>"
        Else
            Response.Write "<option value='" & i & "'>" & i & "</option>"
        End If
    Next
    Response.Write "              </select>年" & vbCrLf
    Response.Write "              <select name='lessonMonth'>" & vbCrLf
    For i = 1 To 12
        Response.Write "<option value='" & i & "'>" & i & "</option>"
    Next
    Response.Write "              </select>月" & vbCrLf
    Response.Write "              <select name='lessonDay'>" & vbCrLf
    For i = 1 To 31
        Response.Write "<option value='" & i & "'>" & i & "</option>"
    Next
    Response.Write "              日</td>" & vbCrLf
    Response.Write "          <td width='100'> " & vbCrLf
    Response.Write "            <p align='left'>第          " & vbCrLf
    Response.Write "              <select name='lessonNumber'>            " & vbCrLf
    'Response.Write "                <option value='0'>不限</option>" & vbCrLf
    Response.Write "                <option value='1'>1</option>" & vbCrLf
    Response.Write "                <option value='2'>2</option>" & vbCrLf
    Response.Write "                <option value='3'>3</option>" & vbCrLf
    Response.Write "                <option value='4'>4</option>" & vbCrLf
    Response.Write "                <option value='5'>5</option>" & vbCrLf
    Response.Write "                <option value='6'>6</option>" & vbCrLf
    Response.Write "                <option value='7'>7</option>" & vbCrLf
    Response.Write "                <option value='8'>8</option>" & vbCrLf
    Response.Write "              </select>" & vbCrLf
    Response.Write "              节课</td>" & vbCrLf
    Response.Write "          <td> " & vbCrLf
    Response.Write "            <div align='left'>使用室场：" & vbCrLf
    Response.Write "              <select name='ClassroomID'>" & vbCrLf
    Response.Write "                <option value='0'>全部分类</option>" & vbCrLf
    Call selectTreeList(0, 0)
    Response.Write "              </select>" & vbCrLf
    Response.Write "              <input type='submit' name='Submit' value='搜索'>" & vbCrLf
    Response.Write "            </div>" & vbCrLf
    Response.Write "          </td>" & vbCrLf
    Response.Write "        </tr>" & vbCrLf
    Response.Write "      </table>" & vbCrLf
    Response.Write "    </form>" & vbCrLf
    Response.Write "" & vbCrLf

End Function

Function selectTreeList(i, deep)
    Dim sql
    Dim rs
    Dim tempi
    Dim rsID, rsName
    Set rs = Server.CreateObject("adodb.recordset")
    sql = "select * from PE_Classroom where fatherID=" & i
    rs.Open sql, Conn, 1, 1
    If rs.EOF Then
        Exit Function
    Else
        Do While Not rs.EOF
            rsID = rs("id")
            rsName = rs("ClassroomName")
            Response.Write "<option value=" & rsID
            If rsID = ClassroomID Then Response.Write " selected"
            Response.Write ">"
            For tempi = 1 To deep
                Response.Write "&nbsp;"
            Next
            Response.Write rsName & "</option>"
            Call selectTreeList(rsID, deep + 1)
            rs.MoveNext
        Loop
    End If
End Function

    '1---2005-08-15
    '2---8-15
    '3---15
    '4---2005-8-15
Function TransformDay(ByVal strDay, ByVal Num)
    Dim strTemp, strNum
    strNum = CInt(Num)
    If Not IsDate(strDay) Then
        TransformDay = ""
        Exit Function
    End If
    If strNum = 2 Then
        If Day(strDay) = 1 Then
            strTemp = Month(strDay) & "/" & Day(strDay)
        Else
            strTemp = Day(strDay)
        End If
    ElseIf strNum = 4 Then
        strTemp = Year(strDay) & "-" & Right("0" & Month(strDay), 2) & "-" & Right("0" & Day(strDay), 2)
    Else
        strTemp = Year(strDay) & "-" & Month(strDay) & "-" & Day(strDay)
    End If
    TransformDay = strTemp
End Function


Function getSort(i) '该函数获取类别下的所有子类
    Dim rs, sql
    Set rs = Server.CreateObject("adodb.recordset")
    sql = "select * from PE_Classroom where fatherID=" & i
    rs.Open sql, Conn, 1, 1
    Do While Not rs.EOF
        strSort = strSort & "," & rs("id")
        Call getSort(rs("id"))
        rs.MoveNext
    Loop
End Function

Sub WriteErr()
    Dim strErr
    strErr = strErr & "<html><head><title>错误信息</title><meta http-equiv='Content-Type' content='text/html; charset=gb2312'>" & vbCrLf
    strErr = strErr & "<link href='../Images/style.css' rel='stylesheet' type='text/css'></head><body>" & vbCrLf
    strErr = strErr & "<table cellpadding=2 cellspacing=1 border=0 width=400 class='border2' align=center>" & vbCrLf
    strErr = strErr & "  <tr align='center'><td height='22' class='title'><strong>错误信息</strong></td></tr>" & vbCrLf
    strErr = strErr & "  <tr><td height='100' class='tdbg' valign='top'><b>产生错误的可能原因：</b><br><li>您不是本校的老师或学生，不能使用专用室场！！！</li></td></tr>" & vbCrLf
    strErr = strErr & "  <tr align='center'><td class='tdbg'>不是我校的成员不能使用该项！</td></tr>" & vbCrLf
    strErr = strErr & "</table>" & vbCrLf
    strErr = strErr & "</body></html>" & vbCrLf
    Response.Write strErr
End Sub

Sub SaveBatchEnrol()
    Dim strDateID, rsID, arrEnrolDate, arrEnrolDate1, cmdTemp, i, EnrolClass, LessonInfo
    strDateID = Trim(Request("strDateID"))
    rsID = Trim(Request("id"))
    If strDateID = "" Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>请指定时间</li>"
    End If
    If rsID = "" Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>参数不足！</li>"
    Else
        rsID = PE_CLng(rsID)
    End If
    If Not (InStr(strDateID, "$") > 0) Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>参数不足！</li>"
    End If
    EnrolClass = PE_HTMLEncode(Trim(Request("EnrolClass")))
    LessonInfo = PE_HTMLEncode(Trim(Request("LessonInfo")))

    If EnrolClass = "" Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>请指定要使用的班级！</li>"
        Exit Sub
    End If
    If EnrolClass = "" Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>请填写课程信息！</li>"
        Exit Sub
    End If
    If FoundErr = True Then
        Exit Sub
    End If
    arrEnrolDate = Split(strDateID, ",")
    Set rs = Server.CreateObject("ADODB.Recordset")
    cmdTemp = "SELECT * FROM PE_UsedDetail "
    rs.Open cmdTemp, Conn, 1, 3
    For i = 0 To UBound(arrEnrolDate)
        arrEnrolDate1 = Split(arrEnrolDate(i), "$")
        rs.addnew
        rs("EquipmentID") = rsID
        rs("lessonYear") = Year(arrEnrolDate1(0))
        rs("lessonMonth") = Month(arrEnrolDate1(0))
        rs("lessonDay") = Day(arrEnrolDate1(0))
        rs("lessonNumber") = arrEnrolDate1(1)
        'rs("UserName") = Session("db_User_TureName")
        rs("UserName") = UserName
        'rs("UserType") = Session("db_User_Type")
        'rs("UserYear") = Session("db_User_Year")
        rs("UserClass") = EnrolClass
        rs("LessonInfo") = LessonInfo
        rs("RegisterTime") = Now()
        rs("RegisterIP") = UserTrueIP
        rs.Update
    Next
    Call WriteFixEquipMsg("成功登记使用专用室场信息！", strDateID, rsID, EnrolClass, LessonInfo)
    rs.Close
    Set rs = Nothing

End Sub

Sub SaveFixEquipEnrol()
    Dim sql
    Dim rsID, cmdTemp, EnrolClass, LessonInfo
    rsID = Request("id")
    If Request.Cookies("Enrol") = "Yes" Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>错误，请不要重复登记！</li>"
        Exit Sub
    End If
    Session("UsedEnrolid") = rsID
    EnrolClass = PE_HTMLEncode(Trim(Request("EnrolClass")))
    LessonInfo = PE_HTMLEncode(Trim(Request("LessonInfo")))

    If EnrolClass = "" Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>请指定要使用的班级！</li>"
        Exit Sub
    'else
        'EnrolClass=PE_clng(EnrolClass)
    End If
    Set rs = Server.CreateObject("ADODB.Recordset")
    cmdTemp = "SELECT * FROM PE_UsedDetail "
    rs.Open cmdTemp, Conn, 1, 3
    rs.addnew
    rs("EquipmentID") = PE_CLng(rsID)
    rs("lessonYear") = Year(lessonDate)
    rs("lessonMonth") = Month(lessonDate)
    rs("lessonDay") = Day(lessonDate)
    rs("lessonNumber") = lessonNumber
    'rs("UserName") = Session("db_User_TureName")
    rs("UserName") = UserName
    'rs("UserType") = Session("db_User_Type")
    'rs("UserYear") = Session("db_User_Year")
    rs("UserClass") = EnrolClass
    rs("LessonInfo") = LessonInfo
    rs("RegisterTime") = Now()
    rs("RegisterIP") = UserTrueIP
    rs.Update
    Call WriteFixEquipMsg("成功登记使用专用室场信息！", lessonDate, lessonNumber, EnrolClass, LessonInfo)
    rs.Close
    Set rs = Nothing
    Response.Cookies("Enrol") = "Yes"
End Sub

Sub ShowFixEquipResult()
    Dim sql, rsID, InsertCursor, EnrolClass, LessonInfo
    LessonInfo = Trim(Request("LessonInfo"))
    EnrolClass = Trim(Request("EnrolClass"))
    rsID = Session("UsedEnrolid")
    Set InsertCursor = Server.CreateObject("ADODB.Recordset")
    sql = "SELECT F.EquipmentName,F.EquipmentSituation,C.ClassroomName FROM PE_Equipment F left join PE_Classroom C on F.ClassroomID = C.ID WHERE F.id=" & PE_CLng(rsID)
    InsertCursor.Open sql, Conn, 1, 3
    Response.Write "<br><table width='100%'><tr><td align='left'>您现在的位置：专用室场设备使用 &nbsp;&gt;&gt;&nbsp;登记结果如下："
    Response.Write "</td></tr></table>" & vbCrLf
    Response.Write "      <br><table width='100%' class='border2' border='0' cellspacing='1' cellpadding='4' align='center'>" & vbCrLf
    Response.Write "        <tr  height='22' class='title'><td align='center' width='100%' colspan='2'><b>登  记  结  果</b></td></tr>" & vbCrLf
    Response.Write "        <tr class='tdbg'>" & vbCrLf
    Response.Write "          <td width='30%'><b>使用人：</b></td>" & vbCrLf
    Response.Write "          <td width='70%'>" & UserName & "    </td>" & vbCrLf
    Response.Write "        </tr>" & vbCrLf
    Response.Write "        <tr class='tdbg'>" & vbCrLf
    Response.Write "          <td width='30%'><b>班级：</b></td>" & vbCrLf
    Response.Write "          <td width='70%'>" & EnrolClass & "    </td>" & vbCrLf
    Response.Write "        </tr>" & vbCrLf
    Response.Write "        <tr class='tdbg'>" & vbCrLf
    Response.Write "          <td width='30%'><b>课程信息：</b></td>" & vbCrLf
    Response.Write "          <td width='70%'>" & LessonInfo & "    </td>" & vbCrLf
    Response.Write "        </tr>" & vbCrLf
    Response.Write "        <tr class='tdbg'>" & vbCrLf
    Response.Write "          <td width='30%'><b>使用日期：</b></td>      <td width='70%'>" & Year(lessonDate) & "年" & Month(lessonDate) & "月" & Day(lessonDate) & "日</td>" & vbCrLf
    Response.Write "         </tr><tr class='tdbg'>" & vbCrLf
    Response.Write "           <td width='30%'><b>第几节课：</b></td>" & vbCrLf
    Response.Write "           <td width='70%'>第" & lessonNumber & "节课</td>" & vbCrLf
    Response.Write "         </tr>" & vbCrLf
    Response.Write "         <tr class='tdbg'>" & vbCrLf
    Response.Write "           <td width='30%'><b>室场：</b></td>" & vbCrLf
    Response.Write "           <td width='70%'>" & InsertCursor("ClassroomName") & "</td>" & vbCrLf
    Response.Write "         </tr>" & vbCrLf
    Response.Write "         <tr class='tdbg'>" & vbCrLf
    Response.Write "           <td width='30%'><b>设备：</b></td>" & vbCrLf
    Response.Write "           <td width='70%'>" & InsertCursor("EquipmentName") & "</td>" & vbCrLf
      
    Response.Write "         </tr>" & vbCrLf
    Response.Write "         <tr class='tdbg'>" & vbCrLf
    Response.Write "           <td width='30%'><b>设备情况：</b></td>" & vbCrLf
    Response.Write "           <td width='70%'>" & vbCrLf
    If InsertCursor("EquipmentSituation") = 1 Then Response.Write ("正常") Else Response.Write ("不正常")
    Response.Write "        </td></tr>" & vbCrLf
    Response.Write "        <tr class='tdbg'><td colspan='2' align='center'><font color='#0000ff'>请记清您的登记结果，准时使用该室场固定设备！</font></td>" & vbCrLf
    Response.Write "        </tr>" & vbCrLf
    Response.Write "      </table>" & vbCrLf
    InsertCursor.Close
    Set InsertCursor = Nothing
End Sub

Sub ShowBatchResult()
    Dim strlessonDate, rsID, arrEnrolDate, i, EnrolClass, LessonInfo
    LessonInfo = Trim(Request("LessonInfo"))
    EnrolClass = Trim(Request("EnrolClass"))
    strlessonDate = Trim(Request("lessonDate"))
    rsID = Trim(Request("id"))
    If strlessonDate = "" Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>请指定时间</li>"
    End If
    If Not (InStr(strlessonDate, "$") > 0) Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>参数不足！</li>"
    End If
    If rsID = "" Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>请指定市场ID！</li>"
    End If
    If FoundErr = True Then
        Exit Sub
    End If
    Dim sql, InsertCursor

    Set InsertCursor = Server.CreateObject("ADODB.Recordset")
    sql = "SELECT F.EquipmentName,F.EquipmentSituation,C.ClassroomName FROM PE_Equipment F left join PE_Classroom C on F.ClassroomID = C.ID WHERE F.id=" & PE_CLng(rsID)
    InsertCursor.Open sql, Conn, 1, 3
    Response.Write "<br><table width='100%'><tr><td align='left'>您现在的位置：专用室场设备使用 &nbsp;&gt;&gt;&nbsp;登记结果如下："
    Response.Write "</td></tr></table>" & vbCrLf
    Response.Write "      <br><table width='100%' class='border2' border='0' cellspacing='1' cellpadding='4' align='center'>" & vbCrLf
    Response.Write "        <tr  height='22' class='title'><td align='center' width='100%' colspan='2'><b>登  记  结  果</b></td></tr>" & vbCrLf
    Response.Write "        <tr class='tdbg'>" & vbCrLf
    Response.Write "          <td width='30%'><b>使用人：</b></td>" & vbCrLf
    Response.Write "          <td width='70%'>" & UserName & "    </td>" & vbCrLf
    Response.Write "        </tr>" & vbCrLf
    Response.Write "        <tr class='tdbg'>" & vbCrLf
    Response.Write "          <td width='30%'><b>班级：</b></td>" & vbCrLf
    Response.Write "          <td width='70%'>" & EnrolClass & "    </td>" & vbCrLf
    Response.Write "        </tr>" & vbCrLf
    Response.Write "        <tr class='tdbg'>" & vbCrLf
    Response.Write "          <td width='30%'><b>课程信息：</b></td>" & vbCrLf
    Response.Write "          <td width='70%'>" & LessonInfo & "    </td>" & vbCrLf
    Response.Write "        </tr>" & vbCrLf
    Response.Write "         <tr class='tdbg'>" & vbCrLf
    Response.Write "           <td width='30%'><b>室场：</b></td>" & vbCrLf
    Response.Write "           <td width='70%'>" & InsertCursor("ClassroomName") & "</td>" & vbCrLf
    Response.Write "         </tr>" & vbCrLf
    Response.Write "         <tr class='tdbg'>" & vbCrLf
    Response.Write "           <td width='30%'><b>设备：</b></td>" & vbCrLf
    Response.Write "           <td width='70%'>" & InsertCursor("EquipmentName") & "</td>" & vbCrLf
    Response.Write "         </tr>" & vbCrLf
    Response.Write "         <tr class='tdbg'>" & vbCrLf
    Response.Write "           <td width='30%'><b>设备情况：</b></td>" & vbCrLf
    Response.Write "           <td width='70%'>" & vbCrLf
    If InsertCursor("EquipmentSituation") = 1 Then Response.Write ("正常") Else Response.Write ("不正常")
    Response.Write "        </td></tr>" & vbCrLf

    Response.Write "        <tr class='tdbg'>" & vbCrLf
    Response.Write "          <td width='30%'><b>使用时间：</b></td>" & vbCrLf
    Response.Write "          <td width='70%'>" & vbCrLf
    Response.Write "            <table  width='100%' class='border2' border='0' cellspacing='1' cellpadding='4' align='center'><tr>" & vbCrLf
    arrEnrolDate = Split(strlessonDate, ",")
    For i = 1 To UBound(arrEnrolDate) + 1
        strlessonDate = Split(arrEnrolDate(i - 1), "$")
        Response.Write "<td align='center'>&nbsp;&nbsp;" & strlessonDate(0) & "  第" & strlessonDate(1) & "节课</td>"
        'if i<>0 then
            If i Mod 4 = 0 Then Response.Write "</tr><tr>"
        'end if
    Next
    Response.Write "            </table>" & vbCrLf
    Response.Write "          </td>" & vbCrLf
    Response.Write "         </tr>" & vbCrLf


    Response.Write "        <tr class='tdbg'><td colspan='2' align='center'><font color='#0000ff'>请记清您的登记结果，准时使用该室场固定设备！</font></td>" & vbCrLf
    Response.Write "        </tr>" & vbCrLf
    Response.Write "      </table>" & vbCrLf
    InsertCursor.Close
    Set InsertCursor = Nothing
End Sub

Sub WriteFixEquipMsg(ByVal SuccessMsg, ByVal strlessonDate, ByVal strNumber, ByVal EnrolClass, ByVal LessonInfo)
    Dim strSuccess
    strSuccess = strSuccess & "<html><head><title>成功信息</title><meta http-equiv='Content-Type' content='text/html; charset=gb2312'>" & vbCrLf
    strSuccess = strSuccess & "<link href='../Images/Admin_Style.css' rel='stylesheet' type='text/css'></head><body><br><br>" & vbCrLf
    strSuccess = strSuccess & "<table cellpadding=2 cellspacing=1 border=0 width=400 class='border2' align=center>" & vbCrLf
    strSuccess = strSuccess & "  <tr align='center' class='title'><td height='22'><strong>恭喜你！</strong></td></tr>" & vbCrLf
    strSuccess = strSuccess & "  <tr class='tdbg'><td height='100' valign='top'><br>" & SuccessMsg & "</td></tr>" & vbCrLf
    strSuccess = strSuccess & "  <tr align='center' class='tdbg'><td>"
    If InStr(strlessonDate, "$") > 0 Then
        strSuccess = strSuccess & "<a href='User_Enrol.asp?Action=ShowBatchResult&lessonDate=" & strlessonDate & "&id=" & strNumber & "&EnrolClass=" & EnrolClass & "&LessonInfo=" & LessonInfo & "'>&lt;&lt; 点此查看登记结果详情</a>" & vbCrLf
    Else
        strSuccess = strSuccess & "<a href='User_Enrol.asp?Action=ShowFixEquip&lessonDate=" & strlessonDate & "&lessonNumber=" & strNumber & "&EnrolClass=" & EnrolClass & "&LessonInfo=" & LessonInfo & "'>&lt;&lt; 点此查看登记结果详情</a>" & vbCrLf
    End If
    strSuccess = strSuccess & "</td></tr>" & vbCrLf
    strSuccess = strSuccess & "</table>" & vbCrLf
    strSuccess = strSuccess & "</body></html>" & vbCrLf
    Response.Write strSuccess
End Sub

Sub SaveFixTimeEnrol()
    Dim sql
    Dim rsID, cmdTemp, EnrolClass, LessonInfo
    rsID = Request("id")
    If Request.Cookies("Enrol") = "Yes" Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>错误，请不要重复登记！</li>"
        Exit Sub
    End If
    Session("UsedEnrolid") = rsID
    EnrolClass = PE_HTMLEncode(Trim(Request("EnrolClass")))
    LessonInfo = PE_HTMLEncode(Trim(Request("LessonInfo")))
    If EnrolClass = "" Or LessonInfo = "" Then
        Call EnrolOtherinfo(lessonYear, lessonMonth, lessonDay, lessonNumber)
    Else
        Set rs = Server.CreateObject("ADODB.Recordset")
        cmdTemp = "SELECT * FROM PE_UsedDetail "
        rs.Open cmdTemp, Conn, 1, 3
        rs.addnew
        rs("EquipmentID") = PE_CLng(rsID)
        rs("lessonYear") = lessonYear
        rs("lessonMonth") = lessonMonth
        rs("lessonDay") = lessonDay
        rs("lessonNumber") = lessonNumber
        'rs("UserName") = Session("db_User_TureName")
        rs("UserName") = UserName
        'rs("UserType") = Session("db_User_Type")
        'rs("UserYear") = Session("db_User_Year")
        rs("UserClass") = EnrolClass
        rs("LessonInfo") = LessonInfo
        rs("RegisterTime") = Now()
        rs("RegisterIP") = UserTrueIP
        rs.Update
        Call WriteFixTimeMsg("成功登记使用专用室场信息！", lessonYear, lessonMonth, lessonDay, lessonNumber)
        rs.Close
        Set rs = Nothing
        Response.Cookies("Enrol") = "Yes"
    End If
End Sub

Sub EnrolOtherinfo(lessonYear, lessonMonth, lessonDay, lessonNumber)
    Response.Write "<form name='myform' method='post' action='User_Enrol.asp?action=SaveFixTime'>" & vbCrLf
    Response.Write "<table align='center' width='740' border='0' align='center' cellpadding='2' cellspacing='1' class='border2'>" & vbCrLf
    Response.Write "  <tr class='title'>" & vbCrLf
    Response.Write "    <td colspan='2' align='center'>" & vbCrLf
    Response.Write "      <strong>其他信息填写（必填）</strong>" & vbCrLf
    Response.Write "    </td>" & vbCrLf
    Response.Write "  </tr>" & vbCrLf
    Response.Write "  <tr class='tdbg'>" & vbCrLf
    Response.Write "    <td width='150'>" & vbCrLf
    Response.Write "        <strong>使用班级：</strong>" & vbCrLf
    Response.Write "    </td>" & vbCrLf
    Response.Write "    <td>" & vbCrLf
    Response.Write "      <input type='text' name='EnrolClass'>" & vbCrLf
    Response.Write "    </td>" & vbCrLf
    Response.Write "  </tr>" & vbCrLf
    Response.Write "  <tr class='tdbg2'><td>" & vbCrLf
    Response.Write "        <strong>课程信息：</strong>" & vbCrLf
    Response.Write "    </td>" & vbCrLf
    Response.Write "    <td>" & vbCrLf
    Response.Write "     <textarea name='LessonInfo' rows='4' cols='70'></textarea>" & vbCrLf
    Response.Write "    </td>" & vbCrLf
    Response.Write "  </tr>" & vbCrLf

    Set rs = Server.CreateObject("ADODB.Recordset")
    sql = "SELECT F.EquipmentName,F.EquipmentSituation,C.ClassroomName FROM PE_Equipment F left join PE_Classroom C on F.ClassroomID = C.ID WHERE F.id=" & PE_CLng(Session("UsedEnrolid"))
    rs.Open sql, Conn, 1, 3
    Response.Write "        <tr class='tdbg'>" & vbCrLf
    Response.Write "          <td width='150'><b>使用人：</b></td>" & vbCrLf
    Response.Write "          <td>" & UserName & "    </td>" & vbCrLf
    Response.Write "        </tr>" & vbCrLf

    Response.Write "        <tr class='tdbg'>" & vbCrLf
    Response.Write "          <td width='150'><b>使用日期：</b></td>      <td>" & lessonYear & "年" & lessonMonth & "月" & lessonDay & "日</td>" & vbCrLf
    Response.Write "         </tr><tr class='tdbg'>" & vbCrLf
    Response.Write "           <td width='150'><b>第几节课：</b></td>" & vbCrLf
    Response.Write "           <td>第" & lessonNumber & "节课</td>" & vbCrLf
    Response.Write "         </tr>" & vbCrLf
    Response.Write "         <tr class='tdbg'>" & vbCrLf
    Response.Write "           <td width='150'><b>室场：</b></td>" & vbCrLf
    Response.Write "           <td>" & rs("ClassroomName") & "</td>" & vbCrLf
    Response.Write "         </tr>" & vbCrLf
    Response.Write "         <tr class='tdbg'>" & vbCrLf
    Response.Write "           <td width='150'><b>设备：</b></td>" & vbCrLf
    Response.Write "           <td>" & rs("EquipmentName") & "</td>" & vbCrLf
      
    Response.Write "         </tr>" & vbCrLf
    Response.Write "         <tr class='tdbg'>" & vbCrLf
    Response.Write "           <td width='150'><b>设备情况：</b></td>" & vbCrLf
    Response.Write "           <td>" & vbCrLf
    If rs("EquipmentSituation") = 1 Then Response.Write ("正常") Else Response.Write ("不正常")
    Response.Write "<input name='id' type='hidden' value='" & Session("UsedEnrolid") & "'>"
    Response.Write "<input name='lessonYear' type='hidden' value='" & lessonYear & "'>"
    Response.Write "<input name='lessonMonth' type='hidden' value='" & lessonMonth & "'>"
    Response.Write "<input name='lessonDay' type='hidden' value='" & lessonDay & "'>"
    Response.Write "<input name='lessonNumber' type='hidden' value='" & lessonNumber & "'>"
    Response.Write "        </td></tr>" & vbCrLf
    Response.Write "  <tr class='tdbg'>" & vbCrLf
    Response.Write "    <td colspan='2' align='center'>" & vbCrLf
    Response.Write "      <input type='submit' name='Submit' value='提交'>" & vbCrLf
    Response.Write "    </td>" & vbCrLf
    Response.Write "  </tr>" & vbCrLf
    Response.Write "</table></form>" & vbCrLf
End Sub

Sub ShowFixTimeResult()
    Dim sql, rsID, InsertCursor
    rsID = Session("UsedEnrolid")
    Set InsertCursor = Server.CreateObject("ADODB.Recordset")
    sql = "SELECT F.EquipmentName,F.EquipmentSituation,C.ClassroomName FROM PE_Equipment F left join PE_Classroom C on F.ClassroomID = C.ID WHERE F.id=" & PE_CLng(rsID)
    InsertCursor.Open sql, Conn, 1, 3
    Response.Write "<br><table width='100%'><tr><td align='left'>您现在的位置：专用室场设备使用 &nbsp;&gt;&gt;&nbsp;登记结果如下："
    Response.Write "</td></tr></table>" & vbCrLf
    Response.Write "      <br><table width='100%' class='border2' border='0' cellspacing='1' cellpadding='4' align='center'>" & vbCrLf
    Response.Write "        <tr  height='22' class='title'><td align='center' width='100%' colspan='2'><b>登  记  结  果</b></td></tr>" & vbCrLf
    Response.Write "        <tr class='tdbg'>" & vbCrLf
    Response.Write "          <td width='30%'><b>使用人：</b></td>" & vbCrLf
    Response.Write "          <td width='70%'>" & UserName & "    </td>" & vbCrLf
    Response.Write "        </tr>" & vbCrLf

    Response.Write "        <tr class='tdbg'>" & vbCrLf
    Response.Write "          <td width='30%'><b>使用日期：</b></td>      <td width='70%'>" & lessonYear & "年" & lessonMonth & "月" & lessonDay & "日</td>" & vbCrLf
    Response.Write "         </tr><tr class='tdbg'>" & vbCrLf
    Response.Write "           <td width='30%'><b>第几节课：</b></td>" & vbCrLf
    Response.Write "           <td width='70%'>第" & lessonNumber & "节课</td>" & vbCrLf
    Response.Write "         </tr>" & vbCrLf
    Response.Write "         <tr class='tdbg'>" & vbCrLf
    Response.Write "           <td width='30%'><b>室场：</b></td>" & vbCrLf
    Response.Write "           <td width='70%'>" & InsertCursor("ClassroomName") & "</td>" & vbCrLf
    Response.Write "         </tr>" & vbCrLf
    Response.Write "         <tr class='tdbg'>" & vbCrLf
    Response.Write "           <td width='30%'><b>设备：</b></td>" & vbCrLf
    Response.Write "           <td width='70%'>" & InsertCursor("EquipmentName") & "</td>" & vbCrLf
      
    Response.Write "         </tr>" & vbCrLf
    Response.Write "         <tr class='tdbg'>" & vbCrLf
    Response.Write "           <td width='30%'><b>设备情况：</b></td>" & vbCrLf
    Response.Write "           <td width='70%'>" & vbCrLf
    If InsertCursor("EquipmentSituation") = 1 Then Response.Write ("正常") Else Response.Write ("不正常")
    Response.Write "        </td></tr>" & vbCrLf
    Response.Write "        <tr class='tdbg'><td colspan='2' align='center'><font color='#0000ff'>请记清您的登记结果，准时使用该室场固定设备！</font></td>" & vbCrLf
    Response.Write "        </tr>" & vbCrLf
    Response.Write "      </table>" & vbCrLf
    InsertCursor.Close
    Set InsertCursor = Nothing
End Sub


Sub WriteFixTimeMsg(SuccessMsg, lessonYear, lessonMonth, lessonDay, lessonNumber)
    Dim strSuccess
    strSuccess = strSuccess & "<html><head><title>成功信息</title><meta http-equiv='Content-Type' content='text/html; charset=gb2312'>" & vbCrLf
    strSuccess = strSuccess & "<link href='../Images/Admin_Style.css' rel='stylesheet' type='text/css'></head><body><br><br>" & vbCrLf
    strSuccess = strSuccess & "<table cellpadding=2 cellspacing=1 border=0 width=400 class='border2' align=center>" & vbCrLf
    strSuccess = strSuccess & "  <tr align='center' class='title'><td height='22'><strong>恭喜你！</strong></td></tr>" & vbCrLf
    strSuccess = strSuccess & "  <tr class='tdbg'><td height='100' valign='top'><br>" & SuccessMsg & "</td></tr>" & vbCrLf
    strSuccess = strSuccess & "  <tr align='center' class='tdbg'><td>"
    
    strSuccess = strSuccess & "<a href='User_Enrol.asp?Action=ShowFixTime&lessonYear=" & lessonYear & "&lessonMonth=" & lessonMonth & "&lessonDay=" & lessonDay & "&lessonNumber=" & lessonNumber & "'>&lt;&lt; 点此查看登记结果详情</a>" & vbCrLf
    strSuccess = strSuccess & "</td></tr>" & vbCrLf
    strSuccess = strSuccess & "</table>" & vbCrLf
    strSuccess = strSuccess & "</body></html>" & vbCrLf
    Response.Write strSuccess
End Sub

%>
