<?
session_start();
if (!$_SESSION['nick'] )
{
header("Location:main.php");
exit;
}
?>

<?

include 'config.php';
$aa=MySQL_Query("SELECT * FROM users WHERE userid=$userid");
while($bb=mysql_fetch_array($aa))
{
 $email = $bb["email"];
 $nick = $bb["nick"];
}

$aa=MySQL_Query("SELECT * FROM servers WHERE ip='$ip' ");
while($bb=mysql_fetch_array($aa))
{
 $nazevs = $bb["nazev"];
}

if ($action=="R")$act="Restart / Start";
if ($action=="S")$act="Stop";

$predmet = "Probehl $act";
$email2 = "administrace@".$web2."";

$zprava = "Na servru : $nazevs \n  ip : $ip \nbyla provedena operace : $act \n ulohy: $nazev";
if ($predmet!="" and $email!="" and $zprava!="" )
{
 Mail($email , $predmet, $zprava, "From: " . $email2);
}

Header("Location:".$server."?action=$action&pid=$pid");
?>
</center>