Редакция 140 | Редакция 144 | К новейшей редакции | Содержимое файла | Сравнить с предыдущей | Последнее изменение | Открыть журнал | RSS
Редакция | Автор | № строки | Строка |
---|---|---|---|
30 | diffor | 1 | <?php |
2 | require_once dirname(__FILE__)."/lib/init.php"; |
||
3 | include "./inc/header.htm"; |
||
4 | |||
5 | $net = abs(intval($_GET["net"])); |
||
6 | |||
7 | if($net==0) { |
||
34 | diffor | 8 | echo "<table>\n"; |
9 | echo "<tr>\n"; |
||
10 | echo "<th>Сеть</th><th>Подсети</th><th colspan='2'>Ресурсы</th>\n"; |
||
11 | echo "</tr>\n"; |
||
30 | diffor | 12 | |
13 | $nets =& $db->query("SELECT * FROM networks"); |
||
14 | while ($nets->fetchInto($info_nets, DB_FETCHMODE_ASSOC)) { |
||
15 | |||
34 | diffor | 16 | $first = true; |
30 | diffor | 17 | $res =& $db->query("SELECT * |
18 | FROM res_net_stat |
||
19 | JOIN resources ON resources.id = res_net_stat.resource_id |
||
20 | WHERE res_net_stat.network_id=".$info_nets['id']); |
||
21 | while ($res->fetchInto($info_res, DB_FETCHMODE_ASSOC)) { |
||
34 | diffor | 22 | echo "<tr>\n"; |
23 | |||
24 | if ($first) { |
||
25 | echo " <td rowspan='".$res->numRows()."'><a href='./networks.php?net=".$info_nets['id']."'>".$info_nets['network']."</a></td>\n"; |
||
26 | echo " <td rowspan='".$res->numRows()."'>"; |
||
27 | $snets =& $db->query("SELECT * FROM subnets WHERE network_id=".$info_nets['id']); |
||
35 | diffor | 28 | if ($snets->numRows()==0) echo "<i>Нет данных.</i>"; |
34 | diffor | 29 | while ($snets->fetchInto($info_snets, DB_FETCHMODE_ASSOC)) { |
30 | echo $info_snets['subnet']."<br>"; |
||
31 | } |
||
32 | echo " </td>\n"; |
||
33 | $first = false; |
||
30 | diffor | 34 | } |
34 | diffor | 35 | |
36 | echo " <td><img src='".$info_res['picture']."' alt='logo'></td>\n<td><a href='./details.php?res=".$info_res['id']."'>".$info_res['resource']."</a></td>\n"; |
||
37 | echo "</tr>\n"; |
||
38 | } |
||
30 | diffor | 39 | } |
40 | echo "</table>"; |
||
41 | } |
||
42 | else { |
||
32 | diffor | 43 | $nets =& $db->query("SELECT * FROM networks WHERE id=".$net); |
44 | while ($nets->fetchInto($info_nets, DB_FETCHMODE_ASSOC)) { |
||
130 | alex-w | 45 | echo "<div id='infocard' class='network-ic'><h4>niX-FILES в ".$info_nets['network']."</h4>"; |
46 | echo "<p>Сайт: <a href='".$info_nets['link']."'>".$info_nets['link']."</a></p>"; |
||
32 | diffor | 47 | |
130 | alex-w | 48 | echo "<div class='projects'><p>Проекты: "; |
32 | diffor | 49 | $ress =& $db->query("SELECT * FROM res_net_stat JOIN resources ON resources.id=res_net_stat.resource_id WHERE network_id=".$net); |
50 | while ($ress->fetchInto($info_ress, DB_FETCHMODE_ASSOC)) { |
||
143 | alex-w | 51 | echo "<span class='".$info_ress['resource']."-small'><a href='./details.php?res=".$info_ress['id']."'>".$info_ress['resource']."</a></span> "; |
32 | diffor | 52 | } |
53 | |||
130 | alex-w | 54 | echo "</p></div><div class='subnets'>В подсетях:"; |
35 | diffor | 55 | $snets =& $db->query("SELECT * FROM subnets WHERE network_id=".$net); |
131 | alex-w | 56 | if ($snets->numRows()==0) echo "<i>Нет данных.</i>"; |
32 | diffor | 57 | while ($snets->fetchInto($info_snets, DB_FETCHMODE_ASSOC)) { |
135 | alex-w | 58 | echo "<span class='network'>".$info_snets['subnet']."</span> "; |
32 | diffor | 59 | } |
130 | alex-w | 60 | echo "</div>"; |
32 | diffor | 61 | |
62 | } |
||
30 | diffor | 63 | } |
64 | |||
65 | include "./inc/footer.htm"; |
||
66 | ?> |