Au cas ou

This commit is contained in:
Lagacé Mathieu
2020-03-05 08:59:10 -05:00
parent baef9a1df0
commit 8189bbce9a
1843 changed files with 143778 additions and 90 deletions

View File

@@ -72,4 +72,36 @@ function clog(string $type,string $result,string $event,$user_id = null,$obj_typ
function clogNav($event)
{
clog('navigate','success',$event);
}
}
function GetSizeName($octet)
{
// Array contenant les differents unités
$unite = array('octet','ko','mo','go');
if ($octet < 1000) // octet
{
return $octet.' '.$unite[0];
}
else
{
if ($octet < 1000000) // ko
{
$ko = round($octet/1024,2);
return $ko.' '.$unite[1];
}
else // Mo ou Go
{
if ($octet < 1000000000) // Mo
{
$mo = round($octet/(1024*1024),2);
return $mo.' '.$unite[2];
}
else // Go
{
$go = round($octet/(1024*1024*1024),2);
return $go.' '.$unite[3];
}
}
}
}