7,32 → 7,24 |
<h3><i>изучай/пользуй/обновляй линукс вместе с nix-files.org.ru</i></h3> |
<?php |
// table header |
$nets =& $db->query("SELECT * FROM networks"); |
echo "<table>"; |
echo "<tr>"; |
echo "<th> </th><th> </th><th>Ресурс</th>\n"; |
|
$netlist = array(); |
$netcount = 0; |
|
$theader1 = "<tr>\n<th rowspan='2'> </th><th rowspan='2'> </th><th rowspan='2'>Ресурс</th>\n"; // category header |
$theader2 = "<tr>\n"; // networks header |
|
$ncats =& $db->query("SELECT * FROM netcats"); |
while ($ncats->fetchInto($info_ncats, DB_FETCHMODE_ASSOC)) { |
$ccnc = 0; // Count networks of current category |
$nets =& $db->query("SELECT * FROM networks WHERE netcat_id=".$info_ncats['id']); |
while ($nets->fetchInto($info_nets, DB_FETCHMODE_ASSOC)) { |
// network name & link |
if ($info_nets['link']=="") { $theader2 .= " <th>".$info_nets['network']."</th>\n"; } |
else { $theader2 .= " <th><a href='./networks.php?net=".$info_nets['id']."'>".$info_nets['network']."</a></th>\n"; } |
// netlist |
$netlist[$netcount] = $info_nets['id']; |
$netcount++; |
$ccnc++; |
} |
$theader1 .= "<th colspan='".$ccnc."'>".$info_ncats['netcat']."</th>"; |
$netcount = $nets->numRows(); |
$n = 0; |
while ($nets->fetchInto($info_nets, DB_FETCHMODE_ASSOC)) { |
// network name & link |
if ($info_nets['link']=="") { echo " <th>".$info_nets['network']."</th>\n"; } |
else { echo " <th><a href='./networks.php?net=".$info_nets['id']."'>".$info_nets['network']."</a></th>\n"; } |
// netlist |
$netlist[$n] = $info_nets['id']; |
$n++; |
} |
echo $theader1."\n</tr>\n"; |
echo $theader2."\n</tr>\n"; |
|
echo "</tr>\n"; |
// table body |
$cats =& $db->query("SELECT * FROM categories"); |
while ($cats->fetchInto($info_cats, DB_FETCHMODE_ASSOC)) { |