|
@@ -377,6 +377,13 @@ class core
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public static function getFormValue(string $_string = NULL)
|
|
|
|
|
+ {
|
|
|
|
|
+ if ($_string != NULL) {
|
|
|
|
|
+ return $_string;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public static function printFormValue(string $_string = NULL)
|
|
public static function printFormValue(string $_string = NULL)
|
|
|
{
|
|
{
|
|
|
if ($_string != NULL) {
|
|
if ($_string != NULL) {
|
|
@@ -406,4 +413,22 @@ class core
|
|
|
WHERE TABLE_SCHEMA = '".DB_NAME."'");
|
|
WHERE TABLE_SCHEMA = '".DB_NAME."'");
|
|
|
return db::single();
|
|
return db::single();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ public static function progressBarWarning(float $_num, float $_max, string $_label){
|
|
|
|
|
+ $pourcentage = number_format(($_num / $_max) * 100, 2);
|
|
|
|
|
+ if($pourcentage < 50){
|
|
|
|
|
+ $infos = ["color" => "bg-success"];
|
|
|
|
|
+ } elseif($pourcentage < 75){
|
|
|
|
|
+ $infos = ["color" => "bg-warning"];
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $infos = ["color" => "bg-danger"];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ echo ' <div class="mb-3" style="margin:10px 0;">
|
|
|
|
|
+ <label class="form-label" style=""><i class="bi bi-hdd-fill" style="font-size:20px;"></i> '.$_label.' [' . core::convertBytes($_num, "o", "Go") . ' / ' . core::convertBytes($_max, "o", "Go") . ']</label>
|
|
|
|
|
+ <div class="progress" role="progressbar" aria-label="Success example" aria-valuenow="'.$pourcentage.'" aria-valuemin="0" aria-valuemax="100">
|
|
|
|
|
+ <div class="progress-bar '.$infos["color"].'" style="width: '.$pourcentage.'%">'.$pourcentage.'%</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>';
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|