dc221d7a766c8251a81cc0f27d97fdfd862a7691
[old-projects.git] / depview / file.php
1 <?php
2 require("config.inc.php");
3 require("header.inc.php");
4 $res = mysql_query("select path from file where id=$id");
5 if (!list($page)=mysql_fetch_row($res)) {
6 echo "file $id not found";
7 include("footer.inc.php");
8 exit;
9 }
10 ?>
11
12 <h1>Dependencies for <?php echo $page; ?></h1>
13 <p>
14 Current context is highlighted in yellow.<br />
15 <a href="list.php">back to file list</a>
16 </p>
17
18 <h2>files that <?php echo $page; ?> depends on</h2>
19 <table>
20 <tr>
21 <th>relation</th>
22 <th>context</th>
23 <th>file</th>
24 </tr>
25 <?php
26 $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");
27 while (list($dir,$type,$cid,$cpath)=mysql_fetch_row($res)) {
28 $res2 = mysql_query("select path from dir where id=$dir");
29 list($dirname)=mysql_fetch_row($res2);
30 ?>
31 <tr <?php if ($d==$dir) echo 'class="current"'; ?>>
32 <td><?php echo $type; ?></td>
33 <td><?php echo $dirname; ?></td>
34 <td><a href="file.php?id=<?php echo $cid; ?>&d=<?php echo $dir; ?>"><?php echo $cpath; ?></a></td>
35 </tr>
36 <?php
37 }
38 ?>
39 </table>
40
41 <h2>files that depend on <?php echo $page; ?></h2>
42 <table>
43 <tr>
44 <th>relation</th>
45 <th>context</th>
46 <th>file</th>
47 </tr>
48 <?php
49 $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");
50 while (list($dir,$type,$pid,$ppath)=mysql_fetch_row($res)) {
51 $res2 = mysql_query("select path from dir where id=$dir");
52 list($dirname)=mysql_fetch_row($res2);
53 ?>
54 <tr <?php if ($d==$dir) echo 'class="current"'; ?>>
55 <td><?php echo $type; ?></td>
56 <td><?php echo $dirname; ?></td>
57 <td><a href="file.php?id=<?php echo $pid; ?>&d=<?php echo $dir; ?>"><?php echo $ppath; ?></a></td>
58 </tr>
59 <?php
60 }
61 ?>
62 </table>
63
64
65 <?php
66 require("footer.inc.php");
67 ?>