15,7 → 15,7 |
$nets =& $db->query("SELECT * FROM networks"); |
echo "<table>"; |
echo "<tr>"; |
echo "<th> </th><th> </th><th>Ресурс</th>"; |
echo "<th> </th><th> </th><th>Ресурс</th>\n"; |
|
$netlist = array(); |
$netcount = $nets->numRows(); |
22,14 → 22,14 |
$n = 0; |
while ($nets->fetchInto($info_nets, DB_FETCHMODE_ASSOC)) { |
// network name & link |
if ($info_nets['link']=="") { echo "<th>".$info_nets['network']."</th>"; } |
else { echo "<th><a href='".$info_nets['link']."'>".$info_nets['network']."</a></th>"; } |
if ($info_nets['link']=="") { echo " <th>".$info_nets['network']."</th>\n"; } |
else { echo " <th><a href='".$info_nets['link']."'>".$info_nets['network']."</a></th>\n"; } |
// netlist |
$netlist[$n] = $info_nets['id']; |
$n++; |
} |
|
echo "</tr>"; |
echo "</tr>\n"; |
// table body |
$cats =& $db->query("SELECT * FROM categories"); |
while ($cats->fetchInto($info_cats, DB_FETCHMODE_ASSOC)) { |
36,20 → 36,20 |
$res =& $db->query("SELECT * FROM resources WHERE category_id=".$info_cats['id']); |
$first = true; |
while ($res->fetchInto($info_res, DB_FETCHMODE_ASSOC)) { |
echo "<tr>"; |
echo "<tr>\n"; |
|
// add rowspan on first resource on category |
if ($first) { |
echo "<td rowspan='".$res->numRows()."'>".$info_cats['category']."</td>"; |
echo " <td rowspan='".$res->numRows()."'>".$info_cats['category']."</td>\n"; |
$first = false; |
} |
|
// resource picture |
echo "<td><img src='".$info_res['picture']."' alt='".$info_res['resource']."'></td>"; |
echo " <td><img src='".$info_res['picture']."' alt='".$info_res['resource']."'></td>\n"; |
|
// resource name & link |
if ($info_res['link_talk']=="") { echo "<td>".$info_res['resource']."</td>"; } |
else { echo "<td><a href='".$info_res['link_talk']."'>".$info_res['resource']."</a></td>"; } |
else { echo " <td><a href='".$info_res['link_talk']."'>".$info_res['resource']."</a></td>\n"; } |
|
// resource state by network |
for ($i=0;$i<$netcount;$i++) { |
56,7 → 56,7 |
$curstate =& $db->getOne("SELECT state_id FROM res_net_stat WHERE resource_id=".$info_res['id']." AND network_id=".$netlist[$i]); |
$curimg = "./img/state/unknown.png"; |
if ($curstate == null) { |
echo "<td>—</td>"; |
echo " <td>—</td>\n"; |
} |
else { |
// !replace in future! |
74,10 → 74,10 |
$curimg = "./img/state/freeze.png"; |
break; |
} |
echo "<td><a href='".$info_res['link_res']."'><img src='".$curimg."' alt='nop'></a></td>"; |
echo " <td><a href='".$info_res['link_res']."'><img src='".$curimg."' alt='nop'></a></td>\n"; |
} |
} |
echo "</tr>"; |
echo "</tr>\n"; |
} |
} |
// table footer |