Changeset 182 for trollforge/lastmeasure
- Timestamp:
- 12/02/05 15:14:14 (7 years ago)
- File:
-
- 1 edited
-
trollforge/lastmeasure/stats/index.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trollforge/lastmeasure/stats/index.php
r181 r182 94 94 } 95 95 96 function print_table($table, $count) {96 function toplist($title, $table, $count) { 97 97 $id = dba_open($table, 'w', 'db4'); 98 98 if(!$id) { … … 106 106 } 107 107 $items = array(); 108 $total = 0; 108 109 while($key != false) { 110 $total++; 109 111 $val = dba_fetch($key, $id); 110 112 $items[$key] = $val; … … 114 116 $key = dba_nextkey($id); 115 117 } 116 $l = 0; 118 $l = 0; ?> 119 <table style="border: solid black 1px; margin: 5px;"> 120 <tr style="background-color: #8af;"> 121 <td><?php echo $title;?> (of <?php echo $total;?>)</td> 122 <td>Count</td> 123 </tr> <?php 117 124 foreach($items as $key => $val) { ?> 118 125 <tr style="background-color: <?php echo ($l % 2) ? '#cef' : '#ecf'; ?>"> … … 121 128 </tr><?php 122 129 $l++; 123 } 130 } ?> 131 </table><?php 124 132 dba_close($id); 125 133 } … … 236 244 </span> GNAA Last Measure Statistics </h1> 237 245 238 <div style="float: left;"> 239 <table style="border: solid black 1px; margin: 5px;"> 240 <tr style="background-color: #8af;"> 241 <td>User</td> 242 <td>Count</td> 243 </tr> 244 <?php print_table($_SERVER['DOCUMENT_ROOT'].'/db/user.db', 30); ?> 245 </table> 246 </div> 246 <?php toplist('User', $_SERVER['DOCUMENT_ROOT'].'/db/user.db', 20); ?> 247 247 248 248 <table style="border: solid black 1px; margin: 5px;"> … … 258 258 </table> 259 259 260 <table style="border: solid black 1px; margin: 5px;"> 261 <tr style="background-color: #8af;"> 262 <td>Browser</td> 263 <td>Count</td> 264 </tr> 265 <?php print_table($_SERVER['DOCUMENT_ROOT'].'/db/uagent.db', 20); ?> 266 </table> 260 <?php toplist('Browser', $_SERVER['DOCUMENT_ROOT'].'/db/uagent.db', 20); ?> 267 261 268 262 <hr />
Note: See TracChangeset
for help on using the changeset viewer.
