array ("get", "integer" ,0), "sd" => array ("get", "integer" ,0), "usr" => array ("get", "integer" ,0), ); getFields($fields); if (!$admin->enabled) { __("This page is restricted to authorized staff"); exit(); } include_once ("head.php"); ?>

Tableau de bord



$error

"; } ?>



$n["login"], "domaines" => $domList, ); } $totalweb = 0; $totalmail = 0; $totallist = 0; $totaldb = 0; $dc = 0; $mc = 0; $mlc = 0; $dbc = 0; foreach ($mList as $mUID => $mData) { list($tmpweb) = @mysql_fetch_array(mysql_query("SELECT SUM(size) FROM size_web WHERE uid = '" . $mUID . "'")); $totalweb += $tmpweb; if (!empty($mData["domaines"])) { foreach ($mData["domaines"] as $domaine) { $dc++; list($tmpmail) = @mysql_fetch_array(mysql_query("SELECT SUM(size) FROM size_mail WHERE alias LIKE '%\_" . $domaine . "'")); $totalmail += $tmpmail; list($mc) = @mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM size_mail WHERE alias LIKE '%\_" . $domaine . "'")); list($tmplist) = @mysql_fetch_array(mysql_query("SELECT SUM(size) FROM size_mailman WHERE list LIKE '%@" . $domaine . "'")); $totallist += $tmplist; } } list($mlc) = @mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM size_mailman WHERE uid = '" . $mUID . "'")); list($tmpdb) = @mysql_fetch_array(mysql_query("SELECT SUM(size) FROM size_db WHERE db = '" . $mData["login"] . "' OR db LIKE '" . $mData["login"] . "\_%'")); $totaldb += $tmpdb; list($dbc) = @mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM size_db WHERE db = '" . $mData["login"] . "' OR db LIKE '" . $mData["login"] . "\_%'")); } $totaltotal=$totalweb+$totallist+$totalmail+($totaldb/1024); // en Ko } else { list($totalweb)=@mysql_fetch_array(mysql_query("SELECT SUM(size) FROM size_web;")); list($totalmail)=@mysql_fetch_array(mysql_query("SELECT SUM(size) FROM size_mail;")); list($totallist)=@mysql_fetch_array(mysql_query("SELECT SUM(size) FROM size_mailman;")); list($totaldb)=@mysql_fetch_array(mysql_query("SELECT SUM(size) FROM size_db;")); $totaltotal=$totalweb+$totallist+$totalmail+($totaldb/1024); // en Ko list($dc)=@mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM domaines;")); list($mc)=@mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM size_mail;")); list($mlc)=@mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM size_mailman;")); list($dbc)=@mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM size_db;")); } ?>
 
 Mo
 Mo
 Mo
 Mo
 Mo
$n["login"], "domaines" => $domList, ); } $totalweb = 0; $totalmail = 0; $totallist = 0; $totaldb = 0; $dc = 0; $mc = 0; $mlc = 0; $dbc = 0; foreach ($mList as $mUID => $mData) { list($tmpweb) = @mysql_fetch_array(mysql_query("SELECT SUM(size) FROM size_web WHERE uid = '" . $mUID . "'")); $totalweb += $tmpweb; if (!empty($mData["domaines"])) { foreach ($mData["domaines"] as $domaine) { $dc++; list($tmpmail) = @mysql_fetch_array(mysql_query("SELECT SUM(size) FROM size_mail WHERE alias LIKE '%\_" . $domaine . "'")); $totalmail += $tmpmail; list($mc) = @mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM size_mail WHERE alias LIKE '%\_" . $domaine . "'")); list($tmplist) = @mysql_fetch_array(mysql_query("SELECT SUM(size) FROM size_mailman WHERE list LIKE '%@" . $domaine . "'")); $totallist += $tmplist; } } list($mlc) = @mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM size_mailman WHERE uid = '" . $mUID . "'")); list($tmpdb) = @mysql_fetch_array(mysql_query("SELECT SUM(size) FROM size_db WHERE db = '" . $mData["login"] . "' OR db LIKE '" . $mData["login"] . "\_%'")); $totaldb += $tmpdb; list($dbc) = @mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM size_db WHERE db = '" . $mData["login"] . "' OR db LIKE '" . $mData["login"] . "\_%'")); } } else { list($totalweb)=@mysql_fetch_array(mysql_query("SELECT SUM(size) FROM size_web;")); list($totalmail)=@mysql_fetch_array(mysql_query("SELECT SUM(size) FROM size_mail;")); list($totallist)=@mysql_fetch_array(mysql_query("SELECT SUM(size) FROM size_mailman;")); list($totaldb)=@mysql_fetch_array(mysql_query("SELECT SUM(size) FROM size_db;")); } $totaltotal=$totalweb+$totallist+$totalmail+($totaldb/1024); // en Ko if ($cuid != 2000) { $r = mysql_query("SELECT * FROM membres WHERE creator = '" . $cuid . "' ORDER BY login;"); } else { $r=mysql_query("SELECT * FROM membres ORDER BY login;"); } while ($c=mysql_fetch_array($r)) { echo ""; // Espace WEB list($ws)=@mysql_fetch_array(mysql_query("SELECT size FROM size_web WHERE uid='".$c["uid"]."';")); if (isset($totalweb) && $totalweb){ $pc=intval(100*$ws/$totalweb); } else{ $pc=0; } if ($mode==0) { echo sprintf("%.1f", $ws / 1024)." "._("MB"); } elseif ($mode==1) { echo sprintf("%.1f",$pc)." %"; } else { echo "\"".$pc."%\""; } echo ""; // Espace Mail : if ($totalmail) $pc=intval(100*$ms/$totalmail); else $pc=0; if ($mode==0) { echo sprintf("%.1f", $ms / 1024)." Mo"; } elseif ($mode==1) { echo sprintf("%.1f",$pc)." %"; } else { echo "\"".$pc."%\""; } echo ""; // Espace Mailman : if ($totallist) $pc=intval(100*$mls/$totallist); else $pc=0; if ($mode==0) { echo sprintf("%.1f", $mls / 1024)." "._("MB"); } elseif ($mode==1) { echo sprintf("%.1f",$pc)." %"; } else { echo "\"".$pc."%\""; } echo ""; // Espace DB : list($ds)=@mysql_fetch_array(mysql_query("SELECT SUM(size) FROM size_db WHERE db='".$c["login"]."' OR db LIKE '".$c["login"]."\_%';")); if ($totaldb) $pc=intval(100*$ds/$totaldb); else $pc=0; if ($mode==0) { echo sprintf("%.1f", $ds / 1024/1024)." "._("MB"); } elseif ($mode==1) { echo sprintf("%.1f",$pc)." %"; } else { echo "\"".$pc."%\""; } echo ""; $ts=$ds/1024+$ws+$ms+$mls; if ($mode==0) { echo sprintf("%.1f", $ts/1024)." "._("MB"); } elseif ($mode==1) { echo sprintf("%.1f",(100*$ts/$totaltotal))." %"; } else { if ($totaltotal) { $pc=intval(100*$ts/$totaltotal); } else { $pc=0; } echo "\"".$pc."%\""; } echo ""; echo ""; } ?>
"; // On affiche le compte et ses domaines : echo "".$c["login"]."
\n"; $s=mysql_query("SELECT * FROM domaines WHERE compte='".$c["uid"]."';"); $dc=0; // Domain Count $ms=0; // Mail Space $mls=0; while ($d=mysql_fetch_array($s)) { if ($sd) echo "   - ".$d["domaine"]."
\n"; $dc++; list($mstmp)=@mysql_fetch_array(mysql_query("SELECT SUM(size) FROM size_mail WHERE alias LIKE '%\_".$d["domaine"]."';")); $ms+=$mstmp; list($mlstmp)=@mysql_fetch_array(mysql_query("SELECT SUM(size) FROM size_mailman WHERE list LIKE '%@".$d["domaine"]."';")); $mls+=$mlstmp; } // Mail Count list($mc)=@mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM mail_domain WHERE type=0 AND uid='".$c["uid"]."';")); // Mailman List Count list($mlc)=@mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM mailman WHERE uid='".$c["uid"]."';")); echo "
$dc$mc$mlc