<?php //require_once 'installedcheck.php' ?>
<?php require_once 'usercheck.php' ?>
<?php require_once 'database.php' ?>
<?php define("MAX_NUM_DEFECTS_FRONT_PAGE", 8); ?>
<html>
<link rel="stylesheet" href="style.css">
<body>
<div align="center">
<table width="730" border="0" cellpadding="0" cellspacing="5">
<tr valign="middle">
<td colspan="3" height="120">
<h1 align="center"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="5">DRUiD
Defect Control</font></b></h1>
<p align="center"><font size="1">you are logged in as <?=$ddts_username?><?php
if (!ttdb_connect($db)) {
echo "<br><br><b>ERROR: Connection to database backend (".
DATABASE_BACKEND.") failed. Check config.php for settings, and ".
"the specified user can access the database.<b>".
"<br><br>";
exit;
}
if (ttus_userIsAdmin($db) == "t")
echo ", and you have administrator privilege.";
?>
</font></p>
</td>
</tr>
<tr valign="top">
<td> <img src="<?php
$images = file("hempel/imagelist.txt");
$image = $images[rand(0, count($images) - 1)];
echo "hempel/$image";
?>" width="346" height="346"> </td>
<td width="44">
<p> </p>
</td>
<td width="346">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td height=35>
<p align="center"><b><font size="2" color="#999999" class="frontpageTableHeader">latest
additions </font></b></p>
</td>
</tr>
<tr>
<td><img src="images/header2.gif" width="346" height="14"></td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<?php
$query = 'select * from defect order by iid desc';
$res = ttdb_execQuery($db, $query);
$fields = ttdb_getArray($res);
if (!is_array($fields)) {
echo "<tr><td><p class='frontpageTableContent'>".
"<br>Defect database is empty.</td></tr> ";
} else {
for ($i = 0; ($i < MAX_NUM_DEFECTS_FRONT_PAGE); $i++) {
?>
<tr>
<td valign="top"> </td>
<td> </td>
</tr>
<tr>
<td valign="top" width="10"><img src="images/divider.gif" width="20" height="11"></td>
<td>
<p class="frontpageTableContent"><b><?php echo $fields['iid']; ?>
</b>- <a href="visualize.php?iddefect=<?php echo $fields['iid']; ?>"><?php echo htmlspecialchars($fields['sheadline']); ?></a></p>
</td>
</tr>
<?php
if ( ($fields = ttdb_getArray($res)) == false)
break; // for
} // for
} // if
?>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr valign="bottom">
<td colspan="3" height="45">
<div align="center">
<table width="90%" border="0">
<tr>
<td>
<div align="center"><b><font size="2">main</font></b></div>
</td>
<td>
<div align="center"><b><font size="2"><a href="newdefect.php">submit
</a></font></b></div>
</td>
<td>
<div align="center"><b><font size="2"><a href="useroptions.php">options</a></font></b></div>
</td>
<td>
<div align="center"><font size="2"><b><a href="statistics.php">statistics</a></b></font></div>
</td>
<?php
if (ttus_userIsAdmin($db) == "t") {
?>
<td>
<div align="center"><b><font size="2"><a href="administration.php">administer</a></font></b></div>
</td>
<?php
}
ttdb_close($db);
?>
<td>
<div align="center"><b><font size="2"><a href="query.php">search
</a></font></b></div>
</td>
<td>
<div align="center"><b><font size="2">logout</font></b></div>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
<p align="center"> </p>
<?php include 'footer.php' ?>
</html>