a0c99a365e6d39be59d52545a656ae53bd1f0800
[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 "page not found";
7 include("footer.inc.php");
8 exit;
9 }
10 ?>
11
12 <h1>Dependencies for <?php echo $page; ?></h1>
13
14 <h2>files that <?php echo $page; ?> depends on</h2>
15 <table>
16 <tr>
17 <th>relation</th>
18 <th>context</th>
19 <th>file</th>
20 </tr>
21 <?php
22 $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");
23 while (list($dir,$type,$cid,$cpath)=mysql_fetch_row($res)) {
24 $res2 = mysql_query("select path from dir where id=$dir");
25 list($dirname)=mysql_fetch_row($res2);
26 ?>
27 <tr>
28 <td><?php echo $type; ?></td>
29 <td><?php echo $dirname; ?></td>
30 <td><a href="file.php?id=<?php echo $cid; ?>"><?php echo $cpath; ?></a></td>
31 </tr>
32 <?php
33 }
34 ?>
35 </table>
36
37 <h2>files that depend on <?php echo $page; ?></h2>
38 <table>
39 <tr>
40 <th>relation</th>
41 <th>context</th>
42 <th>file</th>
43 </tr>
44 <?php
45 $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");
46 while (list($dir,$type,$pid,$ppath)=mysql_fetch_row($res)) {
47 $res2 = mysql_query("select path from dir where id=$dir");
48 list($dirname)=mysql_fetch_row($res2);
49 ?>
50 <tr>
51 <td><?php echo $type; ?></td>
52 <td><?php echo $dirname; ?></td>
53 <td><a href="file.php?id=<?php echo $pid; ?>"><?php echo $ppath; ?></a></td>
54 </tr>
55 <?php
56 }
57 ?>
58 </table>
59
60
61 <?php
62 require("footer.inc.php");
63 ?>