$i = 0; foreach ($main[$k] as $k2 => $v2) { if ($k2 == "total") { continue; } //link if ($k == $tmp) { $link = " "; } else { //icon $icon = isset($icon_path[strtolower($k)]) ? set_img($icondir . $icon_path[strtolower($k)], $k) . " " : set_img($icondir . "none.gif", $k) . " "; $link = $icon . sel_link(query_edit("sel", $k), $k); } $tmp = $k; echo '<tr id="bg_id' . $k . $i . '" onmouseover="chBG(\'bg_id' . $k . $i . '\', 1);" onmouseout="chBG(\'bg_id' . $k . $i . '\', 0);">'; echo '<td> ' . $link . ' </td>'; echo '<td> ' . $k2 . ' </td>'; echo '<td align="right"> ' . $v2 . ' </td>'; echo '<td> ' . mk_graph($v2, $main["total"], $max_val) . ' </td>'; echo '</tr>' . "\n"; $i++; } //合計 echo '<tr>'; echo '<td class="bg_total"> </td>'; echo '<td class="bg_total" align="right"> <b>合計:</b> </td>'; echo '<td class="bg_total" align="right"> <b>' . $main[$k]["total"] . '</b> </td>'; echo '<td class="bg_total"> </td>'; echo '</tr>' . "\n"; } echo '</table>';
arsort($main, SORT_NUMERIC); echo '<table>'; echo '<tr>'; echo '<th nowrap>ISP</th>'; echo '<th nowrap>件数</th>'; echo '<th nowrap>グラフ</th>'; echo '</tr>'; $i = 0; foreach ($main as $k => $v) { $tmp["name"] = ereg_replace('(.+)(\\|\\|)(.+)', "\\1", $k); if (ereg('(.+)(\\|\\|)(.+)', $k, $regs)) { $tmp["com"] = "<br> (" . $regs[3] . ")"; } else { $tmp["com"] = ""; } //link $link = sel_link(query_edit("sel", $tmp["name"]), $tmp["name"]) . $tmp["com"]; echo '<tr id="bg_id' . $i . '" onmouseover="chBG(\'bg_id' . $i . '\', 1);" onmouseout="chBG(\'bg_id' . $i . '\', 0);">'; echo '<td> ' . $link . ' </td>'; echo '<td align="right"> <font color="#FF0000">' . $v . '</font> </td>'; echo '<td> ' . mk_graph($v, array_sum($main), max($main)) . ' </td>'; echo '</tr>'; $i++; } //合計 echo '<tr>'; echo '<td class="bg_total" align="right"> <b>合計:</b> </td>'; echo '<td class="bg_total" align="right"> <b>' . @array_sum($main) . '</b> </td>'; echo '<td class="bg_total"> </td>'; echo '</tr>' . "\n"; echo '</table>';