mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 08:55:54 +00:00
add method getProgressBar()
This commit is contained in:
parent
f59751aa14
commit
ca32bc856e
|
@ -1987,5 +1987,27 @@ mayscript>
|
|||
</table>
|
||||
<?php
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Show progressbar
|
||||
*
|
||||
* @param double $value value
|
||||
* @param double $max 100% value
|
||||
*/
|
||||
protected function getProgressBar($value, $max=100.0) { /* {{{ */
|
||||
if($max > $value) {
|
||||
$used = (int) ($value/$max*100.0+0.5);
|
||||
$free = 100-$used;
|
||||
} else {
|
||||
$free = 0;
|
||||
$used = 100;
|
||||
}
|
||||
$html .= '
|
||||
<div class="progress">
|
||||
<div class="bar bar-danger" style="width: '.$used.'%;"></div>
|
||||
<div class="bar bar-success" style="width: '.$free.'%;"></div>
|
||||
</div>';
|
||||
return $html;
|
||||
} /* }}} */
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue
Block a user