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