2012-11-06 19 views
0

我已完成活動服務器頁面。它正在門廳顯示器上運行。 ASP在該顯示器上顯示會議。我將顯示會議限制爲10個。顯示屏一次可顯示5-6個會議。我想要的是,如果顯示屏顯示前6次會議,則顯示屏應該「更改」到顯示最後4次會議的第二頁。這應該每10秒發生一次。 10秒前6次會議,10秒4次會議等。我怎樣才能做到這一點?如何修改活動服務器頁面

到目前爲止我的代碼:

<table cellpadding="0" style="table-layout:fixed;width:800px;"> 
<tr height="15"> <td colspan="6" class="underline"></td> </tr> 
    <colgroup> 
    <col style="width:830px" > 
    </colgroup> 
    <tr><td> </td></tr> 
</table> 

<table cellpadding="0" border = "1" style="background-color:white; dotted black;border-collapse:collapse;table-layout:fixed;width:1270px;"> 


    <colgroup> 
    <col style="width:445px" > 
    <col style="width:275px" > 
    <col style="width:125px" > 
    <col style="width:125px" > 
    <col style="width:150px" > 
    <col style="width:150px" > 
    </colgroup> 

    <br></br> 

    <tr style="background-color:blue; height="50"> 
        <th align="left">Seminartitel</th> 
        <th align="left">Zusatz-Info</th> 
        <th align="absmiddle">von</th> 
        <th align="absmiddle">bis</th> 
        <th align="absmiddle">Gebäude</th> 
        <th align="absmiddle">Raum</th> 

    </tr> 
<% 
set rs=Server.CreateObject("ADODB.recordset") 
set rsRaum=Server.CreateObject("ADODB.recordset") 

rs.Open "select distinct buchung_id, von, bis, abteilung, veranstalter, THEMA, THEMA_ENABLED " & _ 
     " from RESERVIERUNGRAUM r " & _ 
     "  ,BUCHUNG b " & _ 
     " where r.BUCHUNG_ID = b.ID " & _ 
     " and von >= convert(date, getdate(), 4) " & _ 
     " and von < convert(date, dateadd(day,1, GETDATE()), 4) " & _ 
     " and BIS >= getdate() " & _ 
     " and STORNO is null " & _ 
     " order by von, bis" _ 
     ,objConn 

' Anzahl der darzustellenden Veranstaltungs-Zeilen 
lineMax = 10 
lineCount = 1 
color = "color1" 
do until rs.EOF 

    ' Buchungen anzeigen oder nicht 

    rsRaum.open "select DISPLAY_ENABLED from Buchung where ID = " & rs("buchung_id"), objConn 
      displayanzeige = rsRaum("DISPLAY_ENABLED") 
    rsRaum.close 



    ' Hole für lfd. Buchung aus erster Reservierung Raum ID und Indikator für Kopplung 
    rsRaum.open "select raum_id, KOPPELBESTUHLUNG_ID from RESERVIERUNGRAUM where buchung_id = " & rs("buchung_id"), objConn 
     raum_id = rsRaum("raum_id") 
     KOPPELBESTUHLUNG_ID = rsRaum("KOPPELBESTUHLUNG_ID") 
    rsRaum.close 

    'Gebäude 

    rsRaum.open  "select distinct g.BEZEICHNUNG " & _ 
        "from GEBAEUDE g, ETAGE e, RAUM r " & _ 
        "Where g.ID = e.GEBAEUDE_ID and e.GEBAEUDE_ID = r.GEBAEUDE_ID and r.ID = " & raum_id, objConn 

        GebaeudeBezeichnung = rsRaum("BEZEICHNUNG") 

    rsRaum.close 

    'Hole Terminal Hinweistext 

    rsRaum.open "select KSTR from Buchung where ID = " & rs("buchung_id"), objConn 

       Hinweistext = rsRaum("KSTR") 

    rsRaum.close 


    ' falls Kopplung, hole ID des "Parent"-Raumes 
    if not isNull(KOPPELBESTUHLUNG_ID) then 
    rsRaum.open "select parent_id from KOPPELN where CHILD_ID = " & raum_id, objConn 
      if not rsRaum.EOF then 
      raum_id = rsRaum("parent_id") 
      end if 
    rsRaum.close 
    end if 

    ' hole Raum Details 
    rsRaum.open "select bezeichnung from Raum where ID = " & raum_id, objConn 

     raumname = rsRaum("bezeichnung") 

    rsRaum.close 

    ' Beende, falls Display voll 
    If lineCount > lineMax Then 
    exit do 
    End If 


    ' optionale Unterdrückung der Titelanzeige 
    if ucase(rs("thema_enabled")) = "Y" or isnull(rs("thema_enabled")) then 
    thema = rs("thema") 
    else 
    thema = "" 
    end if 




    if ucase(displayanzeige) = "Y" or isnull(displayanzeige) then 
%> 
<tr "margin-bottom:100px" height="70" valign="top"> 
    <td style="overflow:hidden;" class="<% =color%>"><% =thema %></td> 
    <td class="<% =color%>"><% =Hinweistext %></td> 
    <td align="center"; class="<% =color%>"><% =FormatDateTime(rs("von"), 4)%></td> 
    <td align="center"; class="<% =color%>"><% =FormatDateTime(rs("bis"), 4) %></td> 
    <td align="center"; class="<% =color%>"><% =GebaeudeBezeichnung %><br></td> 
    <td align="center"; class="<% =color%>"><% =raumname %><br></td> 
    </tr> 
<% 

    ' jede zweite Zeile mit anderer Schriftfarbe 

    If lineCount mod 2 = 1 Then 
    color = "color2" 
    Else 
    color = "color1" 
    End If 
    lineCount = lineCount + 1 


    end if 
    rs.moveNext 

loop 
rs.close 
%> 

如何修改我的代碼?

回答

1

創建一個重複頁面,並從當前頁面將參數(GETPOST)作爲RemainingItems傳遞給它。 RemainingItems這裏是4,改變當前頁面如下:

If lineCount > lineMax Then 

是:

If lineCount > firstPageItems Then 

明顯:

lineMax = firstPageItems + RemainingItems 

在頁面之間切換,在特定的時間間隔,你應該使用兩個頁面上的JavaScript計時器。經過一段時間後,將客戶端重定向到其他頁面(每個頁面都知道另一個頁面的地址)。

可以在一個頁面上完成所有的工作,但由於需要更多的工作,根據問題我建議這一個。

相關問題