[Mono-list] Mono-list Digest, Vol 28, Issue 14

Ashish Goyal agoyal at transitchicago.com
Fri Aug 10 11:37:07 EDT 2007


Hello Rolf,

I am using apache integrated with mono 2.0. I am loading my SUN One asp
pages thru' browser.

Following is an example of  my source code:

<!-- %@LANGUAGE="VBSCRIPT"%-->
<!--#include file="Connections/cpc1.asp" -->
<%
Sub arrow()
  If ((rail_current_month.Fields.Item("CHANGE").Value)<0) Then %> <img
src="images/down_arrow.gif" width="7" height="7"><%
    Else If ((rail_current_month.Fields.Item("CHANGE").Value)>=0) Then %>
<img src="images/up_arrow.gif" width="7" height="
7"><%
    Else If ((rail_current_month.Fields.Item("CHANGE").Value)=0.00) Then %>
&nbsp;<%
         Else %>&nbsp;<%
    End If
    End If
    End If
End Sub

Sub arrow2()
  If ((rail_current_month.Fields.Item("CHANGE2").Value)<=-0.01) Then %> <img
src="images/down_arrow.gif" width="7" height="
7"><%
    Else If ((rail_current_month.Fields.Item("CHANGE2").Value)>=0.01) Then
%> <img src="images/up_arrow.gif" width="7" heig
ht="7"><%
    Else If ((rail_current_month.Fields.Item("CHANGE2").Value)=0.00) Then %>
&nbsp;<%
         Else %>&nbsp;<%
    End If
    End If
    End If
End Sub

Dim rail_current_month
Dim rail_current_month_numRows

Set rail_current_month = Server.CreateObject("ADODB.Recordset")
rail_current_month.ActiveConnection = MM_cpc1_STRING
rail_current_month.Source = "select * from rail_current_month"
rail_current_month.CursorType = 0
rail_current_month.CursorLocation = 2
rail_current_month.LockType = 1
rail_current_month.Open()

rail_current_month_numRows = 0
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL
and Form parameters

' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" &
MM_paramName & "="
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""

' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
  NextItem = "&" & Item & "="
  If (InStr(1,MM_removeList,NextItem,1) = 0) Then
    MM_keepURL = MM_keepURL & NextItem &
Server.URLencode(Request.QueryString(Item))
  End If
Next

' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
  NextItem = "&" & Item & "="
  If (InStr(1,MM_removeList,NextItem,1) = 0) Then
    MM_keepForm = MM_keepForm & NextItem &
Server.URLencode(Request.Form(Item))
  End If
Next

' create the Form + URL string and remove the intial '&' from each of the
strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth,
Len(MM_keepBoth) - 1)
if (MM_keepURL <> "")  Then MM_keepURL  = Right(MM_keepURL,
Len(MM_keepURL) - 1)
if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm,
Len(MM_keepForm) - 1)

' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
  If (firstItem <> "") Then
    MM_joinChar = "&"
  Else
    MM_joinChar = ""
  End If
End Function
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
rail_current_month_numRows = rail_current_month_numRows + Repeat1__numRows
%>
<%
Dim daysapart
Dim daysapart_numRows

Set daysapart = Server.CreateObject("ADODB.Recordset")
daysapart.ActiveConnection = MM_cpc1_STRING
daysapart.Source = "select * from rail_current_daysapart"
daysapart.CursorType = 0
daysapart.CursorLocation = 2
daysapart.LockType = 1
daysapart.Open()

daysapart_numRows = 0
%>
<!-- Begin rail_current_month -->
<% If Not rail_current_month.EOF Or Not rail_current_month.BOF Then %>
<div align="center">
  <table border="0" cellspacing="0" cellpadding="0" class="menuborder"
width="100%">
    <tr>
      <td background="images/title_bg.jpg"><img
src="images/left_curve.gif"><font color="#FFFFFF"><b>Current
        Rail Ridership</b></font> <font class="navigation"
color="#FFFFFF">(<%=(daysapart.Fields.Item("RAIL_CURR_SDATE").Va
lue)%> to
<%=(daysapart.Fields.Item("RAIL_CURR_EDATE").Value)%>)&nbsp;&nbsp;&nbsp;&nbs
p;&nbsp;<a href="rides/danryan.asp"><
font color="#FFAAAA">Dan
        Ryan Effects</font></a></font></td>
      <td width=3
                background="images/new/topright2.gif"><img
                  height=0
                  src="images/new/spacer.gif"
                width=3></td>
    </tr>
  </table>
  <table cellpadding="0" cellspacing="0" width="100%" class="main_nav">
    <tr height="20">
      <td width="8"></td>
      <td width="*" class="navigation">Shows current month only, not the
latest
        official month <em><br>
        </em></td>
      <td width=3
                background="images/new/right.gif"><img
                  height=0
                  src="images/new/spacer.gif"
                width=3></td>
    </tr>
  </table>
  <table cellpadding="0" cellspacing="0" width="100%" class="main_table">
    <tr height="20">
      <td><table cellspacing=1 cellpadding=1 width="430" align=center
border=0>
          <tr>
            <td align="left" valign="bottom" bgcolor="#FFFFFF"
class="navigation"><strong>Day<br>
              Types</strong> (<a href="#" onMouseOver="doTooltip(event,
officialTip)" onMouseOut="hideTip()">+</a>)</td>
            <td align="right" valign="bottom" bgcolor="#FFFFFF"
class="navigation"><strong>This
              Year</strong></td>
            <td align="right" valign="bottom" bgcolor="#FFFFFF"
class="navigation"><strong>Last
              Year*</strong></td>
            <td align="right" valign="bottom" bgcolor="#FFFFFF"
class="navigation"><strong>Change</strong></td>
            <td colspan="2" align="right" valign="bottom"
class="navigation"><strong><em>Last
              Year<br>
              Entire Month</em></strong></td>
          </tr>
          <%
While ((Repeat1__numRows <> 0) AND (NOT rail_current_month.EOF))
%>
          <tr<%
                bgImage = 0
        RecordCounter = RecordCounter + 1
        If RecordCounter Mod 2 = 1 Then
                bgImage = "background=images/t_bg.jpg"
                ELSE
                bgImage = "background="
        End If
        %>>
            <%
        dayType = rail_current_month.Fields.Item("DAY").Value
        IF dayType = "Weekdays" THEN
        dayType = "<a
href=http://planning/rail_sys_rolling_averages.asp?daytype=W&VTF=12>Wkday</a
>"
        ELSE
        IF dayType = "Saturdays" THEN dayType = "<a
href=http://planning/rail_sys_rolling_averages.asp?daytype=A&VTF=12>Sat
</a>" END IF
        IF dayType = "Sunday/Holidays" THEN dayType = "<a
href=http://planning/rail_sys_rolling_averages.asp?daytype=U&VTF=
12>Sun/Hol</a>" END IF
        END IF
    %>
            <td align="left" class="navigation"
<%=bgImage%>><%=dayType%></td>
            <td align="right" class="navigation"
<%=bgImage%>><%=FormatNumber((rail_current_month.Fields.Item("THISYEAR").V
alue), 0, -2, -2, -2)%></td>
            <td align="right" class="navigation"
<%=bgImage%>><%=FormatNumber((rail_current_month.Fields.Item("LASTYEAR").V
alue), 0, -2, -2, -2)%></td>
            <td align="right" class="navigation"
<%=bgImage%>><%=FormatPercent((rail_current_month.Fields.Item("CHANGE").Va
lue))%><% call arrow() %></td>
            <td align="right" bgcolor="#f8f8f8" class="navigation"
<%=bgImage%>><em><%=FormatNumber((rail_current_month.Fie
lds.Item("LASTYEAR2").Value), 0, -2, -2, -2)%></em></td>
            <td align="right" bgcolor="#f8f8f8" class="navigation"
<%=bgImage%>><em><%=FormatPercent((rail_current_month.Fi
elds.Item("CHANGE2").Value))%></em><% call arrow2() %></td>
          </tr>
          <%
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  rail_current_month.MoveNext()
Wend
%>
          <tr>
            <td colspan=6 class="navigation">&nbsp;</td>
          </tr>
          <tr>
            <td colspan=6 class="navigation">Figures are station entries
only; rail-to-rail transfers are not included.<br>
<em>*Last Year is an average through
              the same number of days as This Year <br>
              &nbsp;All monthly totals are adjusted for calendar
differences</em></td>
          </tr>
        </table></td>
      <td width=3
                background="images/new/right.gif"><img
                  height=0
                  src="images/new/spacer.gif"
                width=3></td>
    </tr>
  </table>
  <table cellpadding="0" cellspacing="0" width="100%" bgcolor="#FFFFFF">
    <tr>
      <td width=14><img height=3
                  src="images/new/bottomleft.gif"
                  width=14></td>
      <td width=100%
                background="images/new/bottom.gif"><img
                  height=3
                  src="images/new/spacer.gif"
                width=0></td>
      <td width=3><img height=3
                  src="images/new/bottomright.gif"
                  width=3></td>
    </tr>
  </table>
</div>
<% End If%>
<!-- End rail_current_month -->
<%
rail_current_month.Close()
Set rail_current_month = Nothing
daysapart.Close()
Set daysapart = Nothing
%>


Ashish




More information about the Mono-list mailing list