Liste hvor hveranden linje er med baggrundsfarve
Hej Experter,Jeg har forsøgt at omskrive nedenstående kode, således at hveranden linje på den liste der bliver vist, får en baggrundsfarve. Da jeg ikke har haft held med det, har jeg indsat den originale kode uden mine forfejlede forsøg. Håber en hjælpsom Expert vil assistere mig med kode:
**********
<?php
// Include Files
include "c:/Apache2/data/x.php";
include "./includes/MySQL.php";
// Start Session
session_name('session_x');
session_start();
// Database Connection. The values of the parameters are set in the file x.php included above
$db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, false);
// Check User Level
if(!isset($_SESSION['username']) | ($_SESSION['group'] != 2))
{
echo "Unautherized Access.";
}
else
{
$sql = "SELECT linkname, ipaddress, clidport1, clidport2, clidport3, clidport4 FROM postpaid ORDER BY clidport1";
if ( !($result = $db->sql_query($sql)) )
{
die('Error in obtaining userdata');
}
while( $row[] = $db->sql_fetchrow($result));
include "./includes/header.php";
?>
<table align="center" cellpadding="0" cellspacing="0" width="966">
<tr colspan="2" height="20"><td class="headerL">Employee, CLID List</td><td class="headerR"><a class="top" href="logout.php">Logout</a></td></tr>
<tr height="300" valign="top">
<td class="form" colspan="2">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr height="20">
<td class="reference"><a class="action" href="./postpaidList.php?Action=2">Go back to Postpaid List</a></td>
</tr>
</table>
<table align="center">
<tr height="20">
<td colspan="6"> </td></tr>
<tr><td class="listheading">Link Name</td><td class="listheading">IP Address</td><td class="listheading">CLID Port 1</td><td class="listheading">CLID Port 2</td><td class="listheading">CLID Port 3</td><td class="listheading">CLID Port 4</td></tr>
<?php
for($i = 0; $i < count($row)-1; $i++)
{
echo "<tr>";
echo "<td class='tablelist1'>".$row[$i]['linkname']."</td>";
echo "<td class='tablelist1'>".$row[$i]['ipaddress']."</td>";
echo "<td class='tablelist1'>".$row[$i]['clidport1']."</td>";
echo "<td class='tablelist1'>".$row[$i]['clidport2']."</td>";
echo "<td class='tablelist1'>".$row[$i]['clidport3']."</td>";
echo "<td class='tablelist1'>".$row[$i]['clidport4']."</td></tr>";
}
?>
<tr height="20"><td colspan="6"> </td></tr>
</table>
<tr height="20">
<td class="footerL" colspan="2">Navigation --> <a class="top" href="./login.php">Login</a> :: <a class="top" href="./employee.php">Employee Menu</a> :: <a class="top" href="./postpaidList.php?Action=2">Postpaid List</a></td>
</tr>
<tr height="20">
<td class="bottom" align="center" colspan="2"><?php echo "Welcome ".$_SESSION['username'].", please select one of the actions above";?></td>
</tr>
</table>
</body>
</html>
<?php
}
$db->sql_close();
?>
**********
/Greg
