Changeset 1729 for trunk/admin
- Timestamp:
- Jan 18, 2007, 12:06:24 AM (18 years ago)
- Location:
- trunk/admin
- Files:
-
- 2 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/stats.php
r1727 r1729 318 318 } 319 319 320 $url_img = PHPWG_ROOT_PATH.'admin/images/stats.img.php';321 322 if (isset($page['year']))323 {324 $url_img.= '?year='.$page['year'];325 }326 327 if (isset($page['month']))328 {329 $url_img.= '&month='.$page['month'];330 }331 332 if (isset($page['day']))333 {334 $url_img.= '&day='.$page['day'];335 }336 337 320 $summary_lines = get_summary( 338 321 @$page['year'], … … 406 389 array( 407 390 'L_STAT_TITLE' => implode($conf['level_separator'], $title_parts), 408 'SRC_REPORT' => $url_img,409 391 'PERIOD_LABEL' => $period_label, 410 392 ) … … 415 397 // +-----------------------------------------------------------------------+ 416 398 417 $i = 1; 418 399 $max_width = 400; 400 401 $datas = array(); 402 403 if (isset($page['day'])) 404 { 405 $key = 'hour'; 406 $min_x = 0; 407 $max_x = 23; 408 } 409 elseif (isset($page['month'])) 410 { 411 $key = 'day'; 412 $min_x = 1; 413 $max_x = date( 414 't', 415 mktime(12, 0, 0, $page['month'], 1, $page['year']) 416 ); 417 } 418 elseif (isset($page['year'])) 419 { 420 $key = 'month'; 421 $min_x = 1; 422 $max_x = 12; 423 } 424 else 425 { 426 $key = 'year'; 427 } 428 429 $max_pages = 1; 419 430 foreach ($summary_lines as $line) 420 431 { 421 // echo '<pre>'; print_r($line); echo '</pre>'; 422 423 $value = ''; 424 425 if (isset($line['hour'])) 426 { 427 $value.= $line['hour'].' '.l10n('hour'); 428 } 429 else if (isset($line['day'])) 432 if ($line['nb_pages'] > $max_pages) 433 { 434 $max_pages = $line['nb_pages']; 435 } 436 437 $datas[ $line[$key] ] = $line['nb_pages']; 438 } 439 440 if (!isset($min_x) and !isset($max_x)) 441 { 442 $min_x = min(array_keys($datas)); 443 $max_x = max(array_keys($datas)); 444 } 445 446 for ($i = $min_x; $i <= $max_x; $i++) 447 { 448 if (!isset($datas[$i])) 449 { 450 $datas[$i] = 0; 451 } 452 453 $url = null; 454 455 if (isset($page['day'])) 456 { 457 $value = $i.' '.l10n('hour'); 458 } 459 else if (isset($page['month'])) 430 460 { 431 461 $url = 432 462 PHPWG_ROOT_PATH.'admin.php' 433 463 .'?page=stats' 434 .'&year='.$ line['year']435 .'&month='.$ line['month']436 .'&day='.$ line['day']464 .'&year='.$page['year'] 465 .'&month='.$page['month'] 466 .'&day='.$i 437 467 ; 438 468 439 $time = mktime(12, 0, 0, $ line['month'], $line['day'], $line['year']);469 $time = mktime(12, 0, 0, $page['month'], $i, $page['year']); 440 470 441 $value = '<a href="'.$url.'">'; 442 $value.= $line['day'].' ('.$lang['day'][date('w', $time)].')'; 443 $value.= "</a>"; 444 } 445 else if (isset($line['month'])) 471 $value = $i.' ('.$lang['day'][date('w', $time)].')'; 472 } 473 else if (isset($page['year'])) 446 474 { 447 475 $url = 448 476 PHPWG_ROOT_PATH.'admin.php' 449 477 .'?page=stats' 450 .'&year='.$ line['year']451 .'&month='.$ line['month']478 .'&year='.$page['year'] 479 .'&month='.$i 452 480 ; 453 481 454 $value = '<a href="'.$url.'">'; 455 $value.= $lang['month'][$line['month']]; 456 $value.= "</a>"; 482 $value = $lang['month'][$i]; 457 483 } 458 484 else … … 462 488 PHPWG_ROOT_PATH.'admin.php' 463 489 .'?page=stats' 464 .'&year='.$ line['year']490 .'&year='.$i 465 491 ; 466 492 467 $value = '<a href="'.$url.'">'; 468 $value.= $line['year']; 469 $value.= "</a>"; 493 $value = $i; 494 } 495 496 if ($datas[$i] != 0 and isset($url)) 497 { 498 $value = '<a href="'.$url.'">'.$value.'</a>'; 470 499 } 471 500 … … 474 503 array( 475 504 'VALUE' => $value, 476 'PAGES' => $line['nb_pages'], 477 478 'T_CLASS' => ($i++ % 2) ? 'row1' : 'row2' 505 'PAGES' => $datas[$i], 506 'WIDTH' => ceil(($datas[$i] * $max_width) / $max_pages ), 479 507 ) 480 508 );
Note: See TracChangeset
for help on using the changeset viewer.