<h1>Dependencies for <?php echo $page; ?></h1>
+<h2>files that <?php echo $page; ?> depends on</h2>
<table>
<tr>
+ <th>relation</th>
<th>context</th>
<th>file</th>
</tr>
+<?php
+$res = mysql_query("select dep.dir,dep.type,dep.dep,file.path from dep left join file on dep.dep=file.id where page=$id order by dep.dir");
+while (list($dir,$type,$cid,$cpath)=mysql_fetch_row($res)) {
+$res2 = mysql_query("select path from dir where id=$dir");
+list($dirname)=mysql_fetch_row($res2);
+?>
+<tr>
+ <td><?php echo $type; ?></td>
+ <td><?php echo $dirname; ?></td>
+ <td><a href="file.php?id=<?php echo $cid; ?>"><?php echo $cpath; ?></a></td>
+</tr>
+<?php
+}
+?>
+</table>
+<h2>files that depend on <?php echo $page; ?></h2>
+<table>
+<tr>
+ <th>relation</th>
+ <th>context</th>
+ <th>file</th>
+</tr>
<?php
-$res = mysql_query("select dep.id,dep.dir,dep.dep,file.path from dep left join file on dep.dep=file.id where page=$id order by dep.dir");
-while (list($id,$dir,$dep,$path)=mysql_fetch_row($res)) {
+$res = mysql_query("select dep.dir,dep.type,dep.page,file.path from dep left join file on dep.page=file.id where dep=$id order by dep.dir");
+while (list($dir,$type,$pid,$ppath)=mysql_fetch_row($res)) {
$res2 = mysql_query("select path from dir where id=$dir");
list($dirname)=mysql_fetch_row($res2);
?>
<tr>
+ <td><?php echo $type; ?></td>
<td><?php echo $dirname; ?></td>
- <td><a href="file.php?id=<?php echo $dep; ?>"><?php echo $path; ?></a></td>
+ <td><a href="file.php?id=<?php echo $pid; ?>"><?php echo $ppath; ?></a></td>
</tr>
<?php
}
?>
</table>
+
<?php
require("footer.inc.php");
?>
<table>
<tr>
<th>id</th>
+ <th>type</th>
<th>path</th>
</tr>
<?php
-$res = mysql_query("select id,path from file where type='page'");
-while (list($id,$path)=mysql_fetch_row($res)) {
+$res = mysql_query("select id,path,type from file");
+while (list($id,$path,$type)=mysql_fetch_row($res)) {
?>
-<tr>
+<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