<?
  include("vars.inc.php");
  include($EASYPORTAL_DOC_ROOT."functions/functions.php");
?>
<table width="320" cellspacing="1">
	<tr>
		<TD id="titel"><a onclick="dienste()" onmouseover="Tip('<? echo $TIP_DIENSTE_AKT; ?>')"><IMG src="images/reload.png" alt="Reload" width="22" height="22" align="right" border="0"></a>Aktive Dienste</TD>
	</tr>
	<tr>
		<td>
			<table width="100%" cellspacing="10" id="tableborderless">
				<tr>
					<td valign="top" width="70">
						<img src="images/dienste.png" alt="Dienste-Logo">
					</td>
					<td align="left">
						<table id="tableborderless" cellspacing="3">
							<?
								exec("cat ".$EASYPORTAL_DOC_ROOT."includes/dienste.inc", $SERVICES);
                                $IP=getIp();

								foreach ($SERVICES as $Satz) {
									$Daten = explode(";",$Satz);
									$Aktiv = shell_exec("ps ax|grep -v grep|grep $Daten[0] &>/dev/null; echo $?");

									if ($Aktiv == 0){
										if ($Daten[2] != ""){
											if ($Daten[2] == "21") {
												echo "<tr onmouseover=\"Tip('$TIP_DIENSTE_RUN')\"><td valign=\"top\"><img src=\"images/run.png\" alt=\"Aktiv\"></td><td valign=\"top\">&nbsp;<a target='_blank' href='ftp://".$IP."'>$Daten[1]</a></td></tr>";
											}
											else {
												echo "<tr onmouseover=\"Tip('$TIP_DIENSTE_RUN')\"><td valign=\"top\"><img src=\"images/run.png\" alt=\"Aktiv\"></td><td valign=\"top\">&nbsp;<a target='_blank' href='http://".$IP.":$Daten[2]'>$Daten[1]</a></td></tr>";
											}
										}
										else {
											echo "<tr onmouseover=\"Tip('$TIP_DIENSTE_RUN')\"><td valign=\"top\"><img src=\"images/run.png\" alt=\"Aktiv\"></td><td valign=\"top\">&nbsp;".$Daten[1]."</td></tr>";
										}
									}
								}
							?>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>