$sLastSiteCode = '';
//loop through, echoing the rows ...
if ($sLastSiteCode == $row['site_code'])
{
$row['site_code'] = ' ';
}
else
{
// End the table and print new headers
}
$sLastSiteCode = $row['site_code'];
// Print the row details as normal.
<?php
$conn = odbc_connect("counts", "", "") or die(odbc_error());
$sql = "SELECT
fctrafic.site_code,
fctrafic.location,
fctrafic.location2,
fctrafic.distance,
fctrafic.direction,
trafficcountsFiles.fdate,
trafficcountsFiles.types,
trafficcountsFiles.aadt,
trafficcountsFiles.filename
FROM trafficcountsFiles,fctrafic
WHERE fctrafic.site_code = trafficcountsFiles.sitecode
AND fctrafic.site_code = '".$_GET["site_Code"]."'";
$results = odbc_exec($conn,$sql);
for($count=0; $row = odbc_fetch_array($results); $count++)
{
?>
<html>
<head>
<title>Trafic Counts</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body bgcolor="#6270B5">
<div align="center">
<table cellpadding="2" cellspacing="2">
<tr>
<td class="header"><font size="-3">SITE CODE</font></td>
<td class="name"><font size="-3"><?=$row["site_code"]?></font></td>
<td class="header"><font size="-3"> TYPE</font></td>
<td class="name"><font size="-3"><?=$row["types"]?></font></td>
</tr>
<tr>
<td class="header"><font size="-3">AADT</font></td>
<td class="name"><font size="-3"><?=$row["aadt"]?></font></td>
<td class="header"><font size="-3">DATE</font></td>
<td class="name"><font size="-3"><?=$row["fdate"]?></font></td>
</tr>
<tr>
<td class="header"><font size="-3">LOCATION</font></td>
<td class="name"><font size="-3"><?=$row["location"]?></font></td>
<td class="header"><font size="-3">DISTANCE</font></td>
<td class="name"><font size="-3"><?=$row["distance"]?></font></td>
</tr>
<tr>
<td class="header"><font size="-3">REF LOCATION</font></td>
<td class="name"><font size="-3"><?=$row["location2"]?></font></td>
<td class="header"><font size="-3">DIRECTION</font></td>
<td class="name"><font size="-3"><?=$row["direction"]?></font></td>
</tr>
<tr>
<td class="header"><font size="-3">FILE NAME</font></td>
<td class="name"><font size="-3"><a href='["site_code"]?>'><?=$row["filename"]?></a></font></td>
</tr>
</table>
<br>
<button name="close" value="Close" onClick="window.close()">Close</button>
</div>
<?
}
?>
</body>
</html>
I got great help in getting the above code to work.
The only problem that I have right now is to change the way data is displayed.
For instance, since more than one file can be associated with one site code, I will like to see the data display like this:
We would prefer one site code with all files together like below:
SITE CODE 31700020401 TYPE Volume
AADT NA DATE 5/20/2002
LOCATION Northside Drive DISTANCE
REF LOCATION Old Powers Ferry Road DIRECTION E
FILE NAME Riverview Rd EB 5-02.pdf
Northside Dr NB 5-02.pdf
Old Powers Ferry Rd WB 5-02.pdf
Northside Dr SB 5-02.pdf
Currently, it displays like below (which I would like to change to look like above:
SITE CODE 31700020401 TYPE Volume
AADT NA DATE 5/20/2002
LOCATION Northside Drive DISTANCE 1
REF LOCATION Old Powers Ferry Road DIRECTION S
FILE NAME Riverview Rd EB 5-02.pdf
Close
SITE CODE 31700020401 TYPE Volume
AADT NA DATE 5/20/2002
LOCATION Northside Drive DISTANCE
REF LOCATION Old Powers Ferry Road DIRECTION N
FILE NAME Northside Dr NB 5-02.pdf
Close
SITE CODE 31700020401 TYPE Volume
AADT NA DATE 5/20/2002
LOCATION Northside Drive DISTANCE
REF LOCATION Old Powers Ferry Road DIRECTION S
FILE NAME Northside Dr SB 5-02.pdf
Close
SITE CODE 31700020401 TYPE Volume
AADT NA DATE 5/20/2002
LOCATION Northside Drive DISTANCE
REF LOCATION Old Powers Ferry Road DIRECTION E
FILE NAME Old Powers Ferry Rd WB 5-02.pdf
Close
If you look at the above, you can see that the same site code is displayed 4 different types because it is associated with 4 different filenames.
Any help would be greatly appreciated.
//loop through, echoing the rows ...
if ($sLastSiteCode == $row['site_code'])
{
$row['site_code'] = ' ';
}
else
{
// End the table and print new headers
}
$sLastSiteCode = $row['site_code'];
// Print the row details as normal.
<?php
$conn = odbc_connect("counts", "", "") or die(odbc_error());
$sql = "SELECT
fctrafic.site_code,
fctrafic.location,
fctrafic.location2,
fctrafic.distance,
fctrafic.direction,
trafficcountsFiles.fdate,
trafficcountsFiles.types,
trafficcountsFiles.aadt,
trafficcountsFiles.filename
FROM trafficcountsFiles,fctrafic
WHERE fctrafic.site_code = trafficcountsFiles.sitecode
AND fctrafic.site_code = '".$_GET["site_Code"]."'";
$results = odbc_exec($conn,$sql);
for($count=0; $row = odbc_fetch_array($results); $count++)
{
?>
<html>
<head>
<title>Trafic Counts</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body bgcolor="#6270B5">
<div align="center">
<table cellpadding="2" cellspacing="2">
<tr>
<td class="header"><font size="-3">SITE CODE</font></td>
<td class="name"><font size="-3"><?=$row["site_code"]?></font></td>
<td class="header"><font size="-3"> TYPE</font></td>
<td class="name"><font size="-3"><?=$row["types"]?></font></td>
</tr>
<tr>
<td class="header"><font size="-3">AADT</font></td>
<td class="name"><font size="-3"><?=$row["aadt"]?></font></td>
<td class="header"><font size="-3">DATE</font></td>
<td class="name"><font size="-3"><?=$row["fdate"]?></font></td>
</tr>
<tr>
<td class="header"><font size="-3">LOCATION</font></td>
<td class="name"><font size="-3"><?=$row["location"]?></font></td>
<td class="header"><font size="-3">DISTANCE</font></td>
<td class="name"><font size="-3"><?=$row["distance"]?></font></td>
</tr>
<tr>
<td class="header"><font size="-3">REF LOCATION</font></td>
<td class="name"><font size="-3"><?=$row["location2"]?></font></td>
<td class="header"><font size="-3">DIRECTION</font></td>
<td class="name"><font size="-3"><?=$row["direction"]?></font></td>
</tr>
<tr>
<td class="header"><font size="-3">FILE NAME</font></td>
<td class="name"><font size="-3"><a href='["site_code"]?>'><?=$row["filename"]?></a></font></td>
</tr>
</table>
<br>
<button name="close" value="Close" onClick="window.close()">Close</button>
</div>
<?
}
?>
</body>
</html>
I got great help in getting the above code to work.
The only problem that I have right now is to change the way data is displayed.
For instance, since more than one file can be associated with one site code, I will like to see the data display like this:
We would prefer one site code with all files together like below:
SITE CODE 31700020401 TYPE Volume
AADT NA DATE 5/20/2002
LOCATION Northside Drive DISTANCE
REF LOCATION Old Powers Ferry Road DIRECTION E
FILE NAME Riverview Rd EB 5-02.pdf
Northside Dr NB 5-02.pdf
Old Powers Ferry Rd WB 5-02.pdf
Northside Dr SB 5-02.pdf
Currently, it displays like below (which I would like to change to look like above:
SITE CODE 31700020401 TYPE Volume
AADT NA DATE 5/20/2002
LOCATION Northside Drive DISTANCE 1
REF LOCATION Old Powers Ferry Road DIRECTION S
FILE NAME Riverview Rd EB 5-02.pdf
Close
SITE CODE 31700020401 TYPE Volume
AADT NA DATE 5/20/2002
LOCATION Northside Drive DISTANCE
REF LOCATION Old Powers Ferry Road DIRECTION N
FILE NAME Northside Dr NB 5-02.pdf
Close
SITE CODE 31700020401 TYPE Volume
AADT NA DATE 5/20/2002
LOCATION Northside Drive DISTANCE
REF LOCATION Old Powers Ferry Road DIRECTION S
FILE NAME Northside Dr SB 5-02.pdf
Close
SITE CODE 31700020401 TYPE Volume
AADT NA DATE 5/20/2002
LOCATION Northside Drive DISTANCE
REF LOCATION Old Powers Ferry Road DIRECTION E
FILE NAME Old Powers Ferry Rd WB 5-02.pdf
Close
If you look at the above, you can see that the same site code is displayed 4 different types because it is associated with 4 different filenames.
Any help would be greatly appreciated.