19 include_once (
"VAULT/Class.VaultDiskStorage.php");
20 include_once (
"VAULT/Class.VaultDiskFsStorage.php");
21 include_once (
"FDL/Class.DocVaultIndex.php");
30 $q->AddQuery(
"id_fs=" . intval($idfs));
31 $l =
$q->Query(0, 0,
"TABLE");
35 $nf =
$q->Query(0, 0,
"TABLE",
"select count(id_file),sum(size) from vaultdiskstorage where id_fs='" . pg_escape_string($idfs) .
"'");
36 $sqlfs =
"id_fs=" . intval($idfs) .
" and ";
37 $used_size = $nf[0][
"sum"];
40 $no =
$q->Query(0, 0,
"TABLE",
"SELECT count(id_file), sum(size) from vaultdiskstorage where $sqlfs id_file not in (select vaultid from docvaultindex where docid>0)");
41 $nt =
$q->Query(0, 0,
"TABLE",
"SELECT count(id_file), sum(size) from vaultdiskstorage where $sqlfs id_file in (select vaultid from docvaultindex where docid in (select id from docread where doctype='Z'))");
42 $free = doubleval($fs[
"free_size"]);
43 $max = doubleval($fs[
"max_size"]);
44 $free = $max - $used_size;
45 $pci_used = (($max - $free) / $max * 100);
46 $effused = ($max - $free - $no[0][
"sum"] - $nt[0][
"sum"]);
47 $realused = ($max - $free);
48 $pci_realused = ($realused / $max * 100);
49 $pci_effused = ($effused / $max * 100);
50 $pci_free = (100 - $pci_used);
51 $pci_trash = (($nt[0][
"sum"] / $max) * 100);
63 if ($pcfree < 0) $pcfree = 0;
64 if ($pcused > 100) $pcused = 100;
66 $afree = 360 - ($pcfree * 3.6);
67 $aused = $afree - ($pcused * 3.6);
68 $atrash = $aused - ($pctrash * 3.6);
70 $image = imagecreatetruecolor($w, $w / 1.5);
71 imagecolortransparent($image, 0);
73 $orange = imagecolorallocate($image, 0xb5, 0x94, 0x12); #b59412
74 $darkorange = imagecolorallocate($image, 0xb5, 0x74, 0x12);
75 $brown = imagecolorallocate($image, 0xb5, 0x4f, 0x12); #b54f12
76 $darkbrown = imagecolorallocate($image, 0xa5, 0x2f, 0x02);
77 $red = imagecolorallocate($image, 0xFF, 0x00, 0x00);
78 $darkred = imagecolorallocate($image, 0x90, 0x00, 0x00);
79 $green = imagecolorallocate($image, 0x00, 0x90, 0x00);
80 $darkgreen = imagecolorallocate($image, 0x00, 0x50, 0x00);
82 for ($i = $y3 + 10; $i > $y3; $i--) {
83 imagefilledarc($image, $x3, $i, $w, $w2, 0, $atrash, $darkorange, IMG_ARC_PIE);
84 imagefilledarc($image, $x3, $i, $w, $w2, $atrash, $aused, $darkbrown, IMG_ARC_PIE);
85 imagefilledarc($image, $x3, $i, $w, $w2, $aused, $afree, $darkred, IMG_ARC_PIE);
86 imagefilledarc($image, $x3, $i, $w, $w2, $afree, 360, $darkgreen, IMG_ARC_PIE);
89 imagefilledarc($image, $x3, $y3, $w, $w2, 0, $atrash, $orange, IMG_ARC_PIE);
90 imagefilledarc($image, $x3, $y3, $w, $w2, $atrash, $aused, $brown, IMG_ARC_PIE);
91 imagefilledarc($image, $x3, $y3, $w, $w2, $aused, $afree, $red, IMG_ARC_PIE);
92 imagefilledarc($image, $x3, $y3, $w, $w2, $afree, 360, $green, IMG_ARC_PIE);
94 header(
'Content-type: image/png');