--- /dev/null
+/* text definitions */
+body {
+ font-family: Arial,Helvetica,sans-serif;
+}
+
+/* table definitions */
+tr.dead {
+ background-color: red;
+}
+
+tr.image {
+ background-color: yellow;
+}
+
+tr.include {
+ background-color: #00bbff;
+}
+
+tr.page {
+ background-color: #00ffbb;
+}
+
+tr.current {
+ background-color: yellow;
+}
require("header.inc.php");
$res = mysql_query("select path from file where id=$id");
if (!list($page)=mysql_fetch_row($res)) {
- echo "page not found";
+ echo "file $id not found";
include("footer.inc.php");
exit;
}
?>
<h1>Dependencies for <?php echo $page; ?></h1>
+<p>
+ Current context is highlighted in yellow.<br />
+ <a href="list.php">back to file list</a>
+</p>
<h2>files that <?php echo $page; ?> depends on</h2>
<table>
$res2 = mysql_query("select path from dir where id=$dir");
list($dirname)=mysql_fetch_row($res2);
?>
-<tr>
+<tr <?php if ($d==$dir) echo 'class="current"'; ?>>
<td><?php echo $type; ?></td>
<td><?php echo $dirname; ?></td>
- <td><a href="file.php?id=<?php echo $cid; ?>"><?php echo $cpath; ?></a></td>
+ <td><a href="file.php?id=<?php echo $cid; ?>&d=<?php echo $dir; ?>"><?php echo $cpath; ?></a></td>
</tr>
<?php
}
$res2 = mysql_query("select path from dir where id=$dir");
list($dirname)=mysql_fetch_row($res2);
?>
-<tr>
+<tr <?php if ($d==$dir) echo 'class="current"'; ?>>
<td><?php echo $type; ?></td>
<td><?php echo $dirname; ?></td>
- <td><a href="file.php?id=<?php echo $pid; ?>"><?php echo $ppath; ?></a></td>
+ <td><a href="file.php?id=<?php echo $pid; ?>&d=<?php echo $dir; ?>"><?php echo $ppath; ?></a></td>
</tr>
<?php
}
-<html>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>depview</title>
+<link href="depview.css" rel="STYLESHEET" type="text/css" />
+</head>
<body>
+
require("header.inc.php");
?>
-<table>
-<tr>
- <th>id</th>
- <th>type</th>
- <th>path</th>
-</tr>
+<h1>depview main menu</h1>
-<?php
-$res = mysql_query("select id,path,type from file");
-while (list($id,$path,$type)=mysql_fetch_row($res)) {
-?>
-<tr<?php if ($type=="dead") echo ' bgcolor="red"'; ?>>
- <td><?php echo $id; ?></td>
- <td><?php echo $type; ?></td>
- <td><a href="file.php?id=<?php echo $id; ?>"><?php echo $path; ?></a></td>
-</tr>
-<?php
-}
-?>
-</table>
+<ul>
+ <li><a href="list.php">file list</a></li>
+</ul>
<?php
require("footer.inc.php");
--- /dev/null
+<?php
+require("config.inc.php");
+require("header.inc.php");
+switch ($order) {
+ case "i":
+ $sql_suffix = "order by id";
+ break;
+ case "t":
+ $sql_suffix = "order by type";
+ break;
+ case "p":
+ default:
+ $sql_suffix = "order by path";
+ break;
+}
+?>
+
+<table>
+<tr>
+ <th><a href="<?php echo $PHP_SELF; ?>?order=i">id</a></th>
+ <th><a href="<?php echo $PHP_SELF; ?>?order=t">type</a></th>
+ <th><a href="<?php echo $PHP_SELF; ?>?order=p">path</a></th>
+</tr>
+
+<?php
+$res = mysql_query("select id,path,type from file $sql_suffix");
+while (list($id,$path,$type)=mysql_fetch_row($res)) {
+?>
+<tr class="<?php echo $type; ?>">
+ <td><?php echo $id; ?></td>
+ <td><?php echo $type; ?></td>
+ <td><a href="file.php?id=<?php echo $id; ?>"><?php echo $path; ?></a></td>
+</tr>
+<?php
+}
+?>
+</table>
+
+<?php
+require("footer.inc.php");
+?>