I have some code within a DIV that I would like to try and populate a table with columns and rows. The first column will have check boxes with the 2nd column containing all Red Line subway stations. The next two rows will have check boxes and the list of orange line stations. So, that will leave the green, blue and silver line stations to be shown.
Well, the code that I have is great for populating data in a row-like fashion, but I need to change it for the purposes of what I am trying to do. Any ideas or more information needed to explain my problem.
Todd
Well, the code that I have is great for populating data in a row-like fashion, but I need to change it for the purposes of what I am trying to do. Any ideas or more information needed to explain my problem.
Todd
Code:
<DIV id="Destination" STYLE="display: <%if tab <> "Destination" then%> none <% end if%>; width: 100%;">
<table border="0" cellspacing="0" cellpadding="0" class="box" height="297">
<tr><td height="4"></td></tr>
<tr>
<td width="2" rowspan="4"><img src="images/space.gif" width="2" height="1"></td>
<td></td>
<td width="2" rowspan="4"><img src="images/space.gif" width="2" height="1"></td>
</tr>
<tr><td height="8"><img src="images/space.gif" width="1" height="8"></td></tr>
<tr>
<td width="2" rowspan="4"><img src="images/space.gif" width="2" height="1"></td>
<td></td>
<td width="2" rowspan="4"><img src="images/space.gif" width="2" height="1"></td>
<tr>
<td colspan="1" class="canvas" align="top">
<div class="scrollTable" id="testScrollTable" style="overflow: auto; width: 822; height: 326; border-right: 0px;">
<span class="scrollTableHead">
<table width="100%" cellspacing="0" frame="border">
<tr>
<td width="18"><nobr> </nobr></td>
<td width="141"><nobr> <b>Red Line</b></nobr></td>
<td width="18"><nobr> </nobr></td>
<!--<td width="56"><nobr> </nobr></td>-->
<td width="141"><nobr> <b>Orange Line</b></nobr></td>
<td width="19"><nobr> </nobr></td>
<!--<td width="56"><nobr> </nobr></td>-->
<td width="141"><nobr> <b>Blue Line</b></nobr></td>
<td width="19"><nobr> </nobr></td>
<!--<td width="56"><nobr> </nobr></td>-->
<td width="141"><nobr> <b>Green Line</b></nobr></td>
<td width="19"><nobr> </nobr></td>
<!--<td width="56"><nobr> </nobr></td>-->
<td width="141"><nobr> <b>Silver Line</b></nobr></td>
<td width="19"><nobr> </nobr></td>
<!--<td width="56"><nobr> </nobr></td>-->
<td width="141"><nobr> <b>Domain/Station Group</b></nobr></td>
<td></td>
</tr>
</table>
</span>
<span id="sTable" class="scrollTableBody" style="width: 820; height: 300px; overflow-x: hidden;">
<table width="100%" cellspacing="0" cellpadding="0" style="border-collapse: collapse;">
<%
Set cn = GetDBConnection()
Set SQLStmt = Server.CreateObject("ADODB.Command")
Set RS = Server.CreateObject("ADODB.Recordset")
SQLStmt.CommandText = "SELECT a.location_id, a.name, a.station_id, " & _
" b.domain_id, c.domain_name " & _
"FROM LOCATION_STATION_NODE_V a, " & _
" DOMAIN_STATION_XREF b, " & _
" DOMAIN c " & _
"WHERE is_station='Y' AND " & _
" a.STATION_ID = b.STATION_ID AND " & _
" b.DOMAIN_ID = c.DOMAIN_ID " & _
"ORDER BY domain_id, station_id"
SQLStmt.CommandType = 1
Set SQLStmt.ActiveConnection = cn
RS.Open SQLStmt
count = 0
Do While Not RS.EOF
count = count + 1
%>
<tr class="item" height="19">
<td class="frowdata" width="20" nowrap>
<%
chkd = ""
IF Not IsEmpty(stations) THEN
IF IsArray(stations) THEN
FOR EACH sid in stations
IF CInt(sid) = CInt(RS("STATION_ID")) THEN
chkd = " checked"
END IF
NEXT
ELSEIF CInt(stations) = CInt(RS("STATION_ID")) THEN
chkd = " checked"
END IF
END IF
%>
<input type="checkbox" name="station" id="station<%=count%>" value="<%=RS("STATION_ID")%>" <%=chkd%> onClick="checkItems(this);">
</td>
<!--<td class="rowdata" align="center" width="60" nowrap> <nobr><%=RS("LOCATION_ID")%></nobr></td>-->
<td class="rowdata" width="145" nowrap> <nobr><%=RS("NAME")%></nobr></td>
<td class="rowdata" width="20" nowrap>
<%
chkd = ""
IF Not IsEmpty(stations) THEN
IF IsArray(stations) THEN
FOR EACH sid in stations
IF CInt(sid) = CInt(RS("STATION_ID")) THEN
chkd = " checked"
END IF
NEXT
ELSEIF CInt(stations) = CInt(RS("STATION_ID")) THEN
chkd = " checked"
END IF
END IF
%>
<input type="checkbox" name="station" id="station<%=count%>" value="<%=RS("STATION_ID")%>" <%=chkd%> onClick="checkItems(this);">
</td>
<!--<td class="rowdata" align="center" width="60" nowrap> <nobr><%=RS("LOCATION_ID")%></nobr></td>-->
<td class="rowdata" width="145" nowrap> <nobr><%=RS("NAME")%></nobr></td>
<td class="rowdata" width="20" nowrap>
<%
chkd = ""
IF Not IsEmpty(stations) THEN
IF IsArray(stations) THEN
FOR EACH sid in stations
IF CInt(sid) = CInt(RS("STATION_ID")) THEN
chkd = " checked"
END IF
NEXT
ELSEIF CInt(stations) = CInt(RS("STATION_ID")) THEN
chkd = " checked"
END IF
END IF
%>
<input type="checkbox" name="station" id="station<%=count%>" value="<%=RS("STATION_ID")%>" <%=chkd%> onClick="checkItems(this);">
</td>
<!--<td class="rowdata" align="center" width="60" nowrap> <nobr><%=RS("LOCATION_ID")%></nobr></td>-->
<td class="rowdata" width="145" nowrap> <nobr><%=RS("NAME")%></nobr></td>
<td class="rowdata" width="20" nowrap>
<%
chkd = ""
IF Not IsEmpty(stations) THEN
IF IsArray(stations) THEN
FOR EACH sid in stations
IF CInt(sid) = CInt(RS("STATION_ID")) THEN
chkd = " checked"
END IF
NEXT
ELSEIF CInt(stations) = CInt(RS("STATION_ID")) THEN
chkd = " checked"
END IF
END IF
%>
<input type="checkbox" name="station" id="station<%=count%>" value="<%=RS("STATION_ID")%>" <%=chkd%> onClick="checkItems(this);">
</td>
<!--<td class="rowdata" align="center" width="60" nowrap> <nobr><%=RS("LOCATION_ID")%></nobr></td>-->
<td class="rowdata" width="145" nowrap> <nobr><%=RS("NAME")%></nobr></td>
<td class="rowdata" width="20" nowrap>
<%
chkd = ""
IF Not IsEmpty(stations) THEN
IF IsArray(stations) THEN
FOR EACH sid in stations
IF CInt(sid) = CInt(RS("STATION_ID")) THEN
chkd = " checked"
END IF
NEXT
ELSEIF CInt(stations) = CInt(RS("STATION_ID")) THEN
chkd = " checked"
END IF
END IF
%>
<input type="checkbox" name="station" id="station<%=count%>" value="<%=RS("STATION_ID")%>" <%=chkd%> onClick="checkItems(this);">
</td>
<!--<td class="rowdata" align="center" width="60" nowrap> <nobr><%=RS("LOCATION_ID")%></nobr></td>-->
<td class="rowdata" width="145" nowrap> <nobr><%=RS("NAME")%></nobr></td>
<td class="rowdata" width="20" nowrap>
<%
chkd = ""
IF Not IsEmpty(domains) THEN
IF IsArray(domains) THEN
FOR EACH did in domains
IF CInt(did) = CInt(RS("DOMAIN_ID")) THEN
chkd = " checked"
END IF
NEXT
ELSEIF CInt(domains) = CInt(RS("DOMAIN_ID")) THEN
chkd = " checked"
END IF
END IF
%>
<input type="checkbox" name="domain" id="domain<%=count%>" value="<%=RS("DOMAIN_ID")%>" <%=chkd%> onClick="checkItems(this);">
</td>
<td class="lrowdata" width="140" nowrap> <nobr><%=RS("DOMAIN_NAME")%></nobr></td>
<td></td>
</tr>
<%
RS.MoveNext
Loop
RS.Close
%>
<%
FOR row = count to 12 %>
<tr class="item" height="19">
<td class="frowdata" width="20" nowrap> </td>
<td class="rowdata" width="145" nowrap> </td>
<td class="rowdata" width="20" nowrap> </td>
<td class="rowdata" width="145" nowrap> </td>
<td class="rowdata" width="20" nowrap> </td>
<td class="rowdata" width="145" nowrap> </td>
<td class="rowdata" width="20" nowrap> </td>
<td class="rowdata" width="145" nowrap> </td>
<td class="rowdata" width="20" nowrap> </td>
<td class="rowdata" width="145" nowrap> </td>
<td class="rowdata" width="20" nowrap> </td>
<td class="lrowdata" width="140" nowrap> </td>
<!--<td></td>-->
</tr>
<% NEXT %>
</table>
</div>
</td>
<td><img src="images/space.gif" width="32" height="1"></td>
<input type="hidden" id="numstations" name="numstations" value="<%=count%>">
<td align="left" valign="top" width="120">
<font size="1" style="font-size: 1pt;">
<img src="images/space.gif" height="2" width="84">
<input class="dlgbutton" type="button" name="SELECTALL" value="Select All" title="Select All Station Zones" onClick="selectAll();" <% if count = selcnt then %> disabled<% end if %>>
<img src="images/space.gif" height="1" width="84">
<input class="dlgbutton" type="button" name="UNSELECTALL" value="Unselect All" title="Unselect All Stations Zones" onClick="unselectAll();" <% if selcnt = 0 then %> disabled<% end if %>>
<img src="images/space.gif" height="1" width="84">
<input class="dlgbutton" type="reset" name="reset" value="Reset" title="Reset">
<img src="images/space.gif" height="1" width="84">
</font>
</td>
<td><img src="images/space.gif" width="6" height="1"></td>
</tr>
<tr><td height="4"></td></tr>
</table>
</div>