123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- <?php
-
-
- $language_file = 'document';
-
- include("../inc/global.inc.php");
-
- include_once(api_get_path(LIBRARY_PATH) . 'fileUpload.lib.php');
- include_once(api_get_path(LIBRARY_PATH) . 'document.lib.php');
-
-
- $courseDir = $_course['path']."/document";
- $maxFilledSpace = DEFAULT_DOCUMENT_QUOTA;
-
- $interbreadcrumb[]=array("url" => "document.php","name" => get_lang("Doc"));
- $nameTools = get_lang("DocumentQuota");
- Display::display_header($nameTools,"Doc");
-
- function display_quota($course_quota, $already_consumed_space)
- {
- $course_quota_m = round($course_quota / 1000000);
- $already_consumed_space_m = round($already_consumed_space / 1000000);
- $message = get_lang("CourseCurrentlyUses") . " <strong>" . $already_consumed_space_m . " megabyte</strong>.<br/>". get_lang("MaximumAllowedQuota") . " <strong>$course_quota_m megabyte</strong>.<br/>";
-
- $percentage = $already_consumed_space / $course_quota * 100;
- $percentage = round($percentage);
- if ($percentage < 100) $other_percentage = 100 - $percentage;
- else $other_percentage = 0;
-
-
- if ($percentage >= 50)
- {
- $text_in_filled = " $percentage%".
- $text_in_unfilled = "";
- }
- else
- {
- $text_in_unfilled = " $percentage%".
- $text_in_filled = "";
- }
-
-
- if ($percentage < 65) $colour = "#00BB00";
- else if ($percentage < 90) $colour = "#ffd400";
- else $colour = "#DD0000";
-
-
- $visual_percentage = 4 * $percentage;
- $visual_other_percentage = 4 * $other_percentage;
-
- $message .= get_lang("PercentageQuotaInUse") . ": <strong>$percentage%</strong>.<br/>" .
- get_lang("PercentageQuotaFree") . ": <strong>$other_percentage%</strong>.<br>";
-
- $message .= "<br/><table cellpadding=\"\" cellspacing=\"0\" height=\"40\"><tr>
- <td bgcolor=\"$colour\" width=\"$visual_percentage\">$text_in_filled</td>
- <td bgcolor=\"Silver\" width=\"$visual_other_percentage\">$text_in_unfilled</td>
- </tr></table>";
-
- echo $message;
- }
-
-
- api_display_tool_title($nameTools);
- $course_quota = DocumentManager::get_course_quota();
- $full_path = $baseWorkDir . $courseDir;
- $already_consumed_space = documents_total_space($_course);
- display_quota($course_quota, $already_consumed_space);
-
- Display::display_footer();
- ?>
|