<? include("vars.inc.php"); ?>
<table width="450" cellspacing="1">
	<tr>
		<TD id="titel"><a onclick="platten()" onmouseover="Tip('<? echo $TIP_PLATTEN_AKT; ?>')"><IMG src="images/reload.png" alt="Reload" width="22" height="22" align="right" border="0"></a>Festplattenbelegung</TD>
	</tr>
	<tr>
		<td>
			<table width="100%" cellspacing="10" id="tableborderless">
				<tr>	
					<td valign="top" width="70">
						<img src="images/hdd.png" alt="HDD-Logo">
					</td>
					<td align="left">
					<?
						exec("df -h | grep /dev/[h,s]d | awk '{ print $1 \";\" $6 \";\" $5 \";\" $3 \";\" $4 }'", $HD_CHECK);

						foreach ($HD_CHECK as $Satz) {

							$Daten = explode(";",$Satz);

							echo $Daten[0].": ".$Daten[1]."&nbsp;&nbsp;&nbsp;<span style=\"color:red;\" > Belegt: ".$Daten[3]."B</span> &nbsp;&nbsp;&nbsp; <span style=\"color:green;\" >Frei: ".$Daten[4]."B</span>" ;

							echo '<div style="margin-bottom: 10px; border: 1px solid #000000; height: 7px; width: 98%; background-image: url(images/greenpix.png);">

							<div style="float: left; margin-bottom: 10px; border-right: 1px solid #000000; height: 7px; width: '.$Daten[2].'; background-image: url(images/redpix.png);">

							&nbsp;</div>
							&nbsp;</div>';
						}

						$VDR = shell_exec("ps ax|grep -v grep|grep vdr &>/dev/null; echo $?");

						if ($VDR == 0 ) {
							exec("svdrpsend.pl STAT disk | grep 250 | awk '{print \";\" $2 \";\" $3 \";\" $4 }'", $VDR_REC);
							$Daten = explode(";",$VDR_REC[0]);
							$BELEGT = round(($Daten[1] - $Daten[2])/1024,1) . "GB";
							$GESAMT = round($Daten[1]/1024,1)."GB";
							$FREI = round($Daten[2]/1024,1)."GB";

							echo "Aufnahmekap.: ".$GESAMT."&nbsp;&nbsp;&nbsp;<span style=\"color:red;\"> Belegt: ".$BELEGT."</span>&nbsp;&nbsp;&nbsp;<span style=\"color:green;\"> Frei: ".$FREI."</span>";

							echo '<div style="margin-bottom: 10px; border: 1px solid #000000; height: 7px; width: 98%; background-image: url(images/greenpix.png);">

							<div style="float: left; margin-bottom: 10px; border-right: 1px solid #000000; height: 7px; width: '.$Daten[3].'; background-image: url(images/redpix.png);">

							&nbsp;</div>
							&nbsp;</div>';
						}
						else {
							?>
								<table cellspacing="5" width="98%" bgcolor="#FFFF99"><tr><td><img src="images/warning.png" alt="Achtung"></td><td><b>Leider ist der VDR nicht aktiv, deshalb kann die Aufnahmekapazit&#228;t nicht berechnet werden!<br><a onmouseover="Tip('<? echo $TIP_PLATTEN_START; ?>')" onclick="startvdr()"><img src="images/vdrstart.png" align="right"></a></b></td></tr></table>
							<?
						}
					?>
					</td>
				</tr>
			</table>
			</td>
	</tr>
</table>