<?php
include('config.php');
$result = mysql_query('
SELECT *
FROM stats_reports
ORDER BY stats_reports_id DESC');
while ($row = mysql_fetch_array($result)) {
$list .= '<div class="nowrap"><a href="reports.php?id=' . $row['stats_reports_id'] . '">' . date('M j, Y',strtotime($row['stats_reports_date'])) . ' at ' . date('g:i A',strtotime($row['stats_reports_date'])) . '</a></div>';
}
if ($_GET['id'] != '') {
$result = mysql_query('
SELECT *
FROM stats_reports
WHERE stats_reports_id = "' . $_GET['id'] . '"');
$row = mysql_fetch_array($result);
$display = $row['stats_reports_content'];
} else {
$display = '<p>Please click on a report to the left to view it</p>';
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Stats Montage Reports</title>
<link href="<?php echo $css_file_location; ?>" rel="stylesheet" type="text/css"></link>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table>
<tr>
<td class="report-table-left nowrap"><?php echo $list; ?></td>
<td class="report-table-right"><?php echo $display; ?></td>
</tr>
</table>
</body>
</html>