Changeset 144 for trollforge/lastmeasure
- Timestamp:
- 11/30/05 18:23:59 (7 years ago)
- File:
-
- 1 edited
-
trollforge/lastmeasure/stats/index.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trollforge/lastmeasure/stats/index.php
r142 r144 82 82 } 83 83 84 function print_table($table ) {84 function print_table($table, $count) { 85 85 $id = dba_open($table, 'c', 'db4'); 86 86 if(!$id) { … … 93 93 return; 94 94 } 95 for($l = 0; $key != false; $l++) { 96 $val = dba_fetch($key, $id); ?> 95 $items = array(); 96 while($key != false) { 97 $val = dba_fetch($key, $id); 98 $items[$key] = $val; 99 asort($items); 100 if(count($items) > $count) 101 array_pop($items); 102 $key = dba_nextkey($id); 103 } 104 $l = 0; 105 foreach($items as ($key => $val)) { ?> 97 106 <tr style="background-color: <?php echo ($l % 2) ? '#cef' : '#ecf'; ?>"> 98 107 <td><?php echo base64_decode($key); ?></td> 99 108 <td><?php echo $val; ?></td> 100 109 </tr><?php 101 $ key = dba_nextkey($id);110 $l++; 102 111 } 103 112 dba_close($id); … … 230 239 <td>Count</td> 231 240 </tr> 232 <?php print_table('../db/uagent.db' ); ?>241 <?php print_table('../db/uagent.db', 20); ?> 233 242 </table> 234 243 … … 238 247 <td>Count</td> 239 248 </tr> 240 <?php print_table('../db/user.db' ); ?>249 <?php print_table('../db/user.db', 30); ?> 241 250 </table> 242 251
Note: See TracChangeset
for help on using the changeset viewer.
