// // Web: http://www.aaaelsm.com // // ------------------------------------------------------------------------- // /* Ce script permet de connaitre l'espace disque utilisé (base de données et fichiers) chez son hébergeur. */ ?> Espace disque utilisé = $li*1000000) { $value = round($value/(1073741824/$dh))/$dh; $unit = $GLOBALS['byteUnits'][3]; } else if ($value >= $li*1000) { $value = round($value/(1048576/$dh))/$dh; $unit = $GLOBALS['byteUnits'][2]; } else if ($value >= $li) { $value = round($value/(1024/$dh))/$dh; $unit = $GLOBALS['byteUnits'][1]; } if ($unit != $GLOBALS['byteUnits'][0]) { $return_value = number_format($value, $comma, $GLOBALS['number_decimal_separator'], $GLOBALS['number_thousands_separator']); } else { $return_value = number_format($value, 0, $GLOBALS['number_decimal_separator'], $GLOBALS['number_thousands_separator']); } return array($return_value, $unit); } // end of the 'PMA_formatByteDown' function function rep($nom) { $nbTab=str_repeat("|----",substr_count($nom,"/")); $nom1=eregi_replace("^[.][a-z0-9/ ]*/",$nbTab,$nom); echo "$nom1"; global $nbre; global $tailletot; $d = dir($nom); $tailleRep=0; $nbRep=0; while($entry=$d->read()) { $taille = filesize($nom . "/" . $entry); $type = filetype($nom . "/" . $entry); if ($type != "dir") { $tailletot = $tailletot + $taille; $nbre = $nbre + 1; $tailleRep+=$taille; $nbRep++; } } $d = dir($nom); $tailleRep=number_format($tailleRep,'0',',',' '); $nbRep=number_format($nbRep,'0',',',' '); echo "$tailleRep"; echo "$nbRep"; while($entry=$d->read()) { $taille = filesize($nom . "/" . $entry); $type = filetype($nom . "/" . $entry); if ($type == "dir") { if ($entry != "." AND $entry != "..") { $reps[]=$nom . "/" . $entry; } } } if (isset($reps)) { natcasesort($reps); foreach ($reps as $v) { rep($v); } } //rep($nom . "/" . $entry); } $db = mysql_connect($HOSTNAME, $USERNAME , $PASSWORD ); mysql_select_db($DATABASE,$db); $local_query = "SHOW TABLE STATUS FROM $DATABASE"; $result = mysql_query($local_query); $nbTables=0; if ($result != FALSE && mysql_num_rows($result) > 0) { while ($sts_tmp = mysql_fetch_array($result)) { $tables[] = $sts_tmp; $nbTables++; } mysql_free_result($result); } ?>
Base de données Espace disque
": echo ""; } $ts=$td+$ti; $s_tot=$ts; list($td,$td_u)=PMA_formatByteDown($td,3,1); $td="$td $td_u"; list($ti,$ti_u)=PMA_formatByteDown($ti,3,1); $ti="$ti $ti_u"; list($ts,$ts_u)=PMA_formatByteDown($ts,3,1); $ts="$ts $ts_u"; echo ""; echo ""; ?>
TableDonnées IndexTotal
".$sts_data['Name']."$sd$si$sum
Total$td$ti$ts
Répertoire Taille Fichiers
J'ai trouvé $temp1 fichiers d'une taille totale de $temp2 octets.
"; $temp1 = number_format($maxtaille - $tailletot,'0',',',' '); echo "
Il vous reste $temp1 octets.

"; $s_tot+=$tailletot; $s_libre=$maxtaille - $s_tot; list($s_tot,$s_tot_u)=PMA_formatByteDown($s_tot,3,1); $s_tot="$s_tot $s_tot_u"; list($s_libre,$s_libre_u)=PMA_formatByteDown($s_libre,3,1); $s_libre="$s_libre $s_libre_u"; ?>
Espace utilisé :
Espace libre :