Fixing statistics bar

skala
Julio Montoya 13 years ago
parent ef66a85846
commit bc888abd76
  1. 24
      main/admin/statistics/statistics.lib.php
  2. 2
      main/css/base.css
  3. 53
      main/newscorm/lp_view.php

@ -227,30 +227,30 @@ class Statistics {
$data = Statistics::rescale($stats);
echo '<table class="data_table" cellspacing="0" cellpadding="3">
<tr><th colspan="'.($show_total ? '4' : '3').'">'.$title.'</th></tr>';
<tr><th colspan="'.($show_total ? '4' : '3').'">'.$title.'</th></tr>';
$i = 0;
foreach ($stats as $subtitle => $number) {
$total += $number;
}
foreach ($stats as $subtitle => $number) {
//$i = $i % 13;
/*if (api_strlen($subtitle) > 30) {
$subtitle = '<acronym title="'.$subtitle.'">'.$subtitle.'</acronym>';
}*/
foreach ($stats as $subtitle => $number) {
if (!$is_file_size) {
$number_label = number_format($number, 0, ',', '.');
} else {
$number_label = Statistics::make_size_string($number);
}
}
$percentage = ($total>0?number_format(100*$number/$total, 1, ',', '.'):'0');
echo '<tr class="row_'.($i%2 == 0 ? 'odd' : 'even').'">
<td width="150">'.$subtitle.'</td>
<td width="550">
'.Display::return_icon('bar_1u.gif', get_lang('Statistics') ,array('width' => $data[$subtitle], 'height' => '10')).'
</td>
<td width="150">'.$subtitle.'</td>
<td width="550">
<div class="progress progress-striped">
<div class="bar" style="width: '.round($percentage).'%;"></div>
</div>
</td>
<td align="right">'.$number_label.'</td>';
if ($show_total) {
echo '<td align="right"> '.($total>0?number_format(100*$number/$total, 1, ',', '.'):'0').'%</td>';
echo '<td align="right"> '.$percentage.'%</td>';
}
echo '</tr>';
$i ++;

@ -242,7 +242,7 @@ a.tag {
/* User portal */
.course_item {
padding-bottom:40px;
padding-bottom: 40px;
}
/* user_portal course status icon */

@ -325,35 +325,34 @@ if (Database::num_rows($res_media) > 0) {
<div id="author_image" name="author_image" class="row-fluid">
<div class="span12">
<div class="well">
<div class="row-fluid">
<div class="span5">
<?php
if ($_SESSION['oLP']->get_preview_image()!='') {
$picture = getimagesize(api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image());
if($picture['1'] < 96) { $style = ' style="padding-top:'.((94 -$picture['1'])/2).'px;" '; }
$size = ($picture['0'] > 104 && $picture['1'] > 96 )? ' width="104" height="96" ': $style;
$my_path = api_get_path(WEB_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image();
echo '<img src="'.$my_path.'">';
} else {
echo Display :: display_icon('unknown_250_100.jpg');
}
?>
</div>
<div id="lp_navigation_elem" class="span7">
<div class="row">
<div class="span7">
<?php echo $navigation_bar; ?>
<div id="progress_bar">
<?php echo $progress_bar; ?>
</div>
</div>
</div>
</div>
</div>
<div class="row-fluid">
<div class="span5">
<?php
if ($_SESSION['oLP']->get_preview_image()!='') {
$picture = getimagesize(api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image());
if($picture['1'] < 96) { $style = ' style="padding-top:'.((94 -$picture['1'])/2).'px;" '; }
$size = ($picture['0'] > 104 && $picture['1'] > 96 )? ' width="104" height="96" ': $style;
$my_path = api_get_path(WEB_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image();
echo '<img src="'.$my_path.'">';
} else {
echo Display :: display_icon('unknown_250_100.jpg');
}
?>
</div>
<div id="lp_navigation_elem" class="span7">
<div class="row">
<div class="span7">
<?php echo $navigation_bar; ?>
<div id="progress_bar">
<?php echo $progress_bar; ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- end image preview Layout -->
<div id="author_name" style="position:relative;top:2px;left:0px;margin:0;padding:0;text-align:center;width:100%">

Loading…
Cancel
Save