}
if ($schiff->typ != 's') {
    die("Fehler: TYP ist ung&uuml;tig!<br />");
}
if ($ich->id != $schiff->besitzer->id) {
    die("Fehler: Besitzer-ID ist ung&uuml;tig!<br />");
}
//CHEATSCHUTZ ENDE
//CODE abhandlung
//name andern do==-1
if ($_POST["do"] == '-1') {
    $texte = $_POST["newname"];
    changeit($texte);
    $schiff->name = $texte;
    mysql_query("UPDATE schiffe SET name='{$schiff->name}' WHERE id='{$schiff->id}'");
    $schiff->name = pruefetext($texte);
}
if ($_POST["do"] == 1337 && $schiff->besitzer->id == $_SESSION["Id"]) {
    $savetext = $_POST["message2"];
    changeit($savetext);
    $schiff->nachricht = $savetext;
    mysql_query("UPDATE schiffe SET nachricht='" . $savetext . "' WHERE id='" . $schiff->id . "'");
}
//navigieren d0==7
if (isset($_GET["x"]) && isset($_GET["y"]) && ctype_digit($_GET["x"]) && ctype_digit($_GET["y"]) || $_POST["do"] == 7 || $_GET["do"] == 7) {
    $getx = $_GET["x"];
    $gety = $_GET["y"];
    $diffx = $schiff->position->x - $getx;
    $diffy = $schiff->position->y - $gety;
    if ($diffx != 0 && $diffy != 0 && $_POST["do"] != 7 && $_GET["do"] != 7) {
        echo "<span style=\"color:red;font-weight:bold;\">Du kannst nur geradlinig navigieren!</span>";
} else {
    $error = false;
    for ($i = 0; $i < sizeof($schiffe); $i++) {
        $test = new Schiffe($schiffe[$i]);
        if ($i == 0) {
            $x = $test->position->x;
            $y = $test->position->y;
            $orbit = $test->position->orbit;
            $system = $test->position->system->id;
        }
        if ($i > 0) {
            if ($x != $test->position->x || $y != $test->position->y || $orbit != $test->position->orbit || $system != $test->position->system->id) {
                $error = true;
            }
        }
    }
    if ($error) {
        echo 'ausgew&auml;hlte Schiffe sind nicht in einem Sektor!<br /><br /><a href="schiffchoice.php">zur&uuml;ck zur Schiffs&uuml;bersicht!</a>';
    } else {
        $lastid = checkforlastid('flotte') + 1;
        $fname = pruefetext($_POST["flottenname"]);
        mysql_query("INSERT INTO flotte (id,name,besitzer) VALUES ('{$lastid}','{$fname}','{$id}')");
        for ($i = 0; $i < sizeof($schiffe); $i++) {
            $tid = $schiffe[$i];
            mysql_query("UPDATE schiffe SET flotte='{$lastid}' WHERE id='{$tid}'") or die(mysql_error());
            echo '<META HTTP-EQUIV="Refresh" CONTENT="0;URL=flotte.php?fid=0">';
        }
    }
}
echo '<a href="schiffchoice.php">zur&uuml;ck zur Schiffs&uuml;bersicht!</a>';
include "foot.php";
<?php

include "head.php";
include "navlogged.php";
include "klassen.php";
$id = $_GET["id"];
//BETR
$betray = false;
if (!ctype_digit($id)) {
    die("Fehler: ID-ung&uuml;tig!");
}
$account = new Account($id);
echo '<h3>Kolonisten Info ', $account->nickname, ' - Level: ', $account->level, '</h3>';
echo '<table class="bordered2"><tr><td><img src="', $account->bild == '' ? 'siedler.gif' : $account->bild, '" border="0" /></td><td>', nl2br(pruefetext($account->beschreibung)), '</td></tr></table><br />';
if ($account->allianz->id > 0) {
    echo $account->nickname, ' ist in der Allianz: ', $account->allianz->name, '<br />';
} else {
    echo 'Spieler ist in keiner Allianz.<br />';
}
echo '<br /><br />';
//W Punkkt
$shipsum = new Frachtraum("", "dummy");
$q = mysql_query("select id from schiffe where typ='s' and besitzer=" . $id);
while ($r = mysql_fetch_array($q)) {
    $t_ship = new Schiffe($r["id"]);
    for ($i = 0; $i < sizeof($t_ship->frachtraum->fracht); $i++) {
        $shipsum->fracht[$i + 1]->anzahl += $t_ship->frachtraum->fracht[$i]->anzahl;
    }
}
$planetsum = new Frachtraum("", "dummy");
$q = mysql_query("select id from planeten where besitzer=" . $id);
        }
        $explodevar = explode("-", $t["bezug"]);
        $postdate = isset($postdate) ? $postdate : $t["datum"];
        echo '<table class="invitetable" style="text-align:center;" width="100%"><tr><th><a href="newmail.php?to=', $blub->id, '"><img src="images/misc/kontakt.png" border="0" onmouseover="Tip(\'<b>Nachricht an Spieler</b>\')" onmouseout="UnTip()" /></a>', $ich->moderator == 1 || $ich->id == $posterid ? '<a href="knedit.php?channel=' . $channel . '&pid=' . $t["id"] . '"><img src="images/misc/bearbeiten.png" border="0" onmouseover="Tip(\'<b>Nachricht editieren</b>\')" onmouseout="UnTip()" /></a>' : '&nbsp;&nbsp;&nbsp;&nbsp;', '<a href="zusammenhang.php?channel=', $channel, '&pid=', $t["id"], '"><img src="images/misc/zusammenhang.png" border="0" onmouseover="Tip(\'<b>Zusammenhang darstellen</b>\')" onmouseout="UnTip()" /></a><a href="knwrite.php?channel=', $channel, '&pid=', $t["id"], '"><img src="images/misc/botschaft.png" border="0" onmouseover="Tip(\'<b>Auf diese Nachricht antworten / Auf diese Nachricht beziehen</b>\')" onmouseout="UnTip()" /></a>&nbsp;&nbsp;&nbsp;<a href="knwrite.php?channel=', $channel, '"><img src="images/misc/write.png" border="0" onmouseover="Tip(\'<b>neuen Beitrag ( ohne Zusammenhang ) verfassen</b>\')" onmouseout="UnTip()" /></a></th><th width="55%"><a href="userinfo.php?id=', $t["autor"], '">', $blub->nickname, '</a></th><th><span style="color:silver;">Bezug auf: ', $explodevar[1] == 0 ? '-' : $t["bezug"], '</th><th><span style="color:red;">ID ', $t["id"], '</th><th>', gerdatum($postdate), '</th></tr></table>';
        echo '<table class="invitetable" width="100%"><tr><td width="80px"><center><img src="', $avatar, '" border="0" /></center></td><td>';
        if ($posterid == 1) {
            echo '<font color="#00C0FF">';
        }
        echo nl2br(pruefetext($t["text"]));
        // *** MOD VIEW
        if ($ich->moderator == 1) {
            $editvar = mysql_query("SELECT * FROM kn_log WHERE channel='{$channel}' AND pid='" . $t["id"] . "' ORDER BY id DESC");
            while ($erow = mysql_fetch_array($editvar)) {
                $editusr = new Account($erow["autor"]);
                echo '<br /><br /><span style="color:yellow;font-weight:bold;">Version vom ', gerdatum($erow["datum"]), '</span>  editiert von  ', $editusr->nickname, '<br />';
                echo nl2br(pruefetext($erow["text"]));
            }
        }
        // ** ENDE MODVIEW
        if (isset($editid)) {
            $eusr = new Account($editid);
            echo '<br /><br />[ <span style="color:red;">editiert von ', $eusr->nickname, ' ]';
        }
        if ($posterid == 1) {
            echo '</font>';
        }
        echo '</td></tr></table><br/>';
    }
    $zahl++;
}
echo 'Seite: ';
         echo '<form action="allianz.php" method="post"><input type="hidden" name="do" value="3"><tr><td>Allianzbeschreibung:</td><td><textarea name="info" rows="10" cols="50">', $ally["info"], '</textarea><br /><input type="submit" value="eintragen..."></td></tr></form>';
     } else {
         echo '<tr><th>Allianzbeschreibung:</th><td>', nl2br(pruefetext($ally["info"])), '<br /><br /><a href="allianz.php?do=2"><span style="color:yellow;">Beschreibung &auml;ndern</span></a></td></tr>';
     }
 } else {
     echo '<tr><th>Allianzbeschreibung:</th><td>', nl2br(pruefetext($ally["info"])), '</td></tr>';
 }
 //interne Infos
 if ($ally["leiter"] == $_SESSION["Id"]) {
     if ($_GET["do"] == 8) {
         echo '<form action="allianz.php" method="post"><input type="hidden" name="do" value="9"><tr><td>interne News:</td><td><textarea name="infointern" rows="10" cols="50">', $ally["intern"], '</textarea><br /><input type="submit" value="eintragen..."></td></tr></form>';
     } else {
         echo '<tr><th>interne News:</th><td>', nl2br(pruefetext($ally["intern"])), '<br /><br /><a href="allianz.php?do=8"><span style="color:yellow;">News &auml;ndern</span></a></td></tr>';
     }
 } else {
     echo '<tr><th>interne News:</th><td>', nl2br(pruefetext($ally["intern"])), '</td></tr>';
 }
 //-->
 echo '</table><br />';
 echo '<br /><h3>Mitglieder</h3><table class="invitetable" style="text-align:center;"><tr><tH>Spieler</th><th>->[]-></th></tr>';
 $abfr = mysql_query("SELECT * FROM account WHERE allianz='{$allianz}'");
 while ($user = mysql_fetch_array($abfr)) {
     $usr = new Account($user["id"]);
     echo '<tr><td>', $usr->nickname, '</td><td>';
     if ($_SESSION["Id"] == $leiter && $user["id"] != $_SESSION["Id"]) {
         $bu = new Button("allianz.php?do=10&user="******"id"], "entfernen");
         $bu->printme();
     } else {
         echo "-";
     }
     echo "</td></tr>";
             imagejpeg($tn, $save, 100);
             mysql_query("UPDATE account SET bild='{$save}' WHERE id='{$id}'");
         } else {
             if ($width < 3000 && $height < 3000) {
                 $source = $file;
                 $target2 = "avatar/sml_" . $id . ".jpg";
                 copy($target, $target2);
                 echo 'Bild hochgeladen..<br />';
                 mysql_query("UPDATE account SET bild='{$target2}' WHERE id='{$id}'");
             }
         }
     }
 }
 //Fall 2 name aendern
 if ($_POST["sent"] == 2) {
     $newname = pruefetext($_POST["nick"]);
     mysql_query("UPDATE account SET nickname='{$newname}' WHERE id='{$id}'");
     echo 'Neuer Name wurde erfolgreich gesetzt!';
     echo '<META HTTP-EQUIV="Refresh" CONTENT="0;URL=logout.php">';
 }
 //abarbeitung des Falls Sent 1
 if ($_POST["sent"] == 1 && $_POST["pwchangepost"] == 1) {
     $newpw = $_POST["newpw"];
     $newpw2 = $_POST["newpwconfirm"];
     $oldpw = $_POST["oldpw"];
     if ($oldpw == $_SESSION["Pwd"]) {
         if ($newpw == $newpw2) {
             $newpw = md5($newpw);
             mysql_query("UPDATE account SET passwort='{$newpw}' WHERE id='{$id}'");
             echo 'Neues Passwort wurde erfolgreich gesetzt!';
             echo '<META HTTP-EQUIV="Refresh" CONTENT="0;URL=main.php">';
Exemple #7
0
include "klassen.php";
// CHEATSCHUTZ 1
$betray = false;
if (!ctype_digit($_GET["sid"])) {
    $betray = true;
}
if (!ctype_digit($_GET["tid"])) {
    $betray = true;
}
//if($betray) die();
$sid = $_GET["sid"];
$tid = $_GET["tid"];
$schiff = new Schiffe($sid);
$test1 = mysql_query("SELECT * FROM schiffe WHERE x='" . $schiff->position->x . "' AND y='" . $schiff->position->y . "' AND system='" . $schiff->position->system->id . "' AND id='{$tid}'");
if (mysql_num_rows($test1) == 1) {
    $target = new Schiffe($tid);
} else {
    $target = new Planeten($tid);
}
//CHEATSCHUTZ 2
if ($schiff->besitzer->id != $_SESSION["Id"]) {
    $betray = true;
}
//if($betray) die();
echo '<h3>Nachricht ', mysql_num_rows($test1) == 1 ? 'der' : 'des Planeten', ' ', $target->name, ' (', $target->id, ') aus Sektor ', $target->position->x, '|', $target->position->y, '</h3>';
echo '<div class="box" style="width:500px;">', nl2br(pruefetext($target->nachricht)), '</div><br />';
?>
</body>
</html>
<?php

mysql_connect("localhost", "root", "db");
mysql_select_db("game2");
include "klassen.php";
echo '<table>';
$abfrage = mysql_query("SELECT * FROM chat ORDER BY id DESC LIMIT 70");
while ($row = mysql_fetch_array($abfrage)) {
    $text = pruefetext($row["nachricht"]);
    $usr = new Account($row["uid"]);
    echo '<tr><td style="width:135px;">', $row["zeit"], '</td><td style="min-width:140px;">', $usr->nickname, '</td><td>', $text, '</td></tr>';
}
echo '</table>';
  if ($nodelist[$i]->next->is_Empty() && !in_array($nodelist[$i]->data, $leaf_nodes)) {
  $leaf_nodes[] = $nodelist[$i]->data;
  echo "Blatt2: " . $nodelist[$i]->data . " <br />";
  }
  } */
//}
$target = $_POST["target"];
$planet = new Planeten($pid);
$planet->energieoutput = $addfracht->fracht[0]->anzahl;
if (isset($_POST["newname"])) {
    $pass_tmp = $_POST["newname"];
    changeit($pass_tmp);
    $planet->name = $pass_tmp;
    mysql_query("UPDATE planeten SET name='" . $planet->name . "' WHERE id='" . $planet->id . "'");
    $planet->nameklartext = $planet->name;
    $planet->name = pruefetext($pass_tmp);
}
if ($planet->besitzer->level <= 3) {
    echo '<span style="font-weight:bold;color:yellow;">Hinweis: Dein Prim&auml;rziel sollte es sein, die <a href="quest.php?sid=0">Level-Quests</a> abzuschliessen. Achte auf neue Quests</span><br /><br />';
}
echo '<h3>Kolonie: ', $planet->name, ' (', $planet->id, ')</h3><br />';
echo '<h4>Status</h4><table class="invitetable"><tr><th>Energie</th><td><span style="font-weight:bold;">', $planet->energie, '/', $planet->maxenergie, $planet->energieoutput >= 0 ? '<span style="color:green;"> + ' . $planet->energieoutput . '</span>' : '<span style="color:red;">' . $planet->energieoutput . '</span>', '</span></td></tr>';
if ($planet->maxschilde > 0) {
    echo '<tr><th>Schilde</th><td>', $planet->schildstatus == 0 ? '<span>' : '<span style="color:yellow;">', ' ', $planet->schilde, '/', $planet->maxschilde, '</span></td></tr>';
}
echo '<tr><th>Alarmstufe</th><td>';
if ($planet->alarmstufe == 'green') {
    echo '<img src="images/misc/alarmgg.png" border="0" />';
} else {
    echo '<a href="planet.php?pid=', $planet->id, '&do=13g"><img src="images/misc/alarmgk.png" border="0" /></a>';
}
 public function __construct($nid)
 {
     if (!ctype_digit($nid)) {
         echo 'Fehler: ID (', $nid, ') ist ung&uuml;ltig!<br />';
         return -1;
     }
     $abfrage = mysql_query("SELECT * FROM schiffe WHERE id='{$nid}' LIMIT 1");
     while ($row = mysql_fetch_array($abfrage)) {
         $this->id = $nid;
         $this->bau = new Bauplan_Schiffe($row["klasse"]);
         $this->skill = $this->bau->skill;
         $this->name = pruefetext($row["name"]);
         $this->nameklartext = $row["name"];
         $this->besitzer = new Account($row["besitzer"]);
         $this->frachtraum = new Frachtraum($nid, "schiff");
         $this->position = new Position($nid, "schiff");
         $this->energie = $row["energie"];
         $this->maxenergie =& $this->bau->maxenergie;
         $this->energieoutput =& $this->bau->energieoutput;
         $this->alarmstufe = $row["alarmstufe"];
         $this->flotte = $row["flotte"];
         $this->typ = $row["typ"];
         $this->flugkosten =& $this->bau->flugkosten;
         $this->lrs =& $this->bau->lrs;
         $this->klasse =& $this->bau->klasse;
         $this->warpkern = $row["warpkern"];
         $this->maxwarpkern =& $this->bau->maxwarpkern;
         $this->warpkernstatus = $row["warpkernstatus"];
         $this->phaser = $row["phaser"];
         $this->maxphaser =& $this->bau->maxphaser;
         $this->torpedohitze = $row["torpedohitze"];
         $this->maxtorpedohitze =& $this->bau->maxtorpedohitze;
         $this->gondeln = $row["gondeln"];
         $this->lager =& $this->bau->lager;
         $this->maxgondeln =& $this->bau->maxgondeln;
         $this->hull = $row["hull"];
         $this->maxhull =& $this->bau->maxhull;
         $this->bild =& $this->bau->bild;
         $this->nachricht = $row["nachricht"];
         $this->laser =& $this->bau->laser;
         $this->schilde = $row["schilde"];
         $this->maxschilde =& $this->bau->maxschilde;
         $this->schildstatus = $row["schildstatus"];
         $this->dock = $row["dock"];
         $this->maxdock =& $this->bau->maxdock;
         $this->loot = $row["loot"];
         $this->quest = $row["quest"];
         $this->defense = $row["defend"];
         return 0;
     }
     echo 'Fehler: Objekt nicht in der Datenbank lokalisierbar!<br />';
     return -1;
 }
function showkn($channel, $pid, $vor)
{
    $ich = new Account($_SESSION["Id"]);
    if ($pid == 0 || $channel == 0) {
        return;
    }
    $dec = null;
    $vorfeld = explode("-", $vor);
    $editid = null;
    $posterid = null;
    //*** EDITPRUFUNG
    $editvar = mysql_query("SELECT * FROM kn_log WHERE channel='{$channel}' AND pid='{$pid}' ORDER BY id ASC LIMIT 1");
    if (mysql_num_rows($editvar) > 0) {
        while ($erow = mysql_fetch_array($editvar)) {
            $posterid = $erow["autor"];
        }
        $editid = -2;
    }
    $abfrage = mysql_query("SELECT * FROM kn WHERE channel=" . $channel . " and bezug='" . $knid . "-" . $pid . "' AND bezug != '{$vor}'");
    if (mysql_num_rows($abfrage) > 0) {
        while ($t = mysql_fetch_array($abfrage)) {
            if (!(text2num($vorfeld[0]) == 1 && $vorfeld[1] == $t["id"])) {
                $usr = new Account($t["autor"]);
                echo '<a href="zusammenhang.php?channel=' . $channel . '&pid=', $t["id"], '"><span style="color:red;font-weight:bold;">zur (anderen) Antwort von ', $usr->nickname, ' auf:</span></a><br />';
            }
        }
    }
    $abfrage = mysql_query("SELECT * FROM kn where channel=" . $channel . "  AND id=" . $pid . " ORDER BY id DESC");
    while ($t = mysql_fetch_array($abfrage)) {
        if ($editid == -2) {
            $editid = $t["autor"];
        }
        if (!isset($posterid)) {
            $posterid = $t["autor"];
        }
        $tid = $posterid;
        $blub = new Account($posterid);
        $avatar = $blub->bild;
        if ($avatar == '') {
            $avatar = 'siedler.gif';
        }
        $explodevar = explode("-", $t["bezug"]);
        $pre = $explodevar[1];
        echo '<table class="bordered" width="100%"><tr><td width="55%"><a href="userinfo.php?id=', $t["autor"], '">', $blub->nickname, '</a></td><td><span style="color:silver;">Bezug auf: ', $explodevar[1] == 0 ? '-' : $t["bezug"], '</td><td><span style="color:red;">Eintrag: ', $knid, '-', $t["id"], '</td><td>', gerdatum($t["datum"]), '</td></tr></table>';
        echo '<table class="bordered2" width="100%"><tr><td width="80px"><center><img src="', $avatar, '" border="0" /></center></td><td>';
        if ($t["autor"] == 1) {
            echo '<font color="#00C0FF">';
        }
        echo nl2br(pruefetext($t["text"]));
        // *** MOD VIEW
        if ($ich->moderator == 1) {
            $editvar = mysql_query("SELECT * FROM kn_log WHERE channel='{$channel}' AND pid='" . $t["id"] . "' ORDER BY id DESC");
            while ($erow = mysql_fetch_array($editvar)) {
                $editusr = new Account($erow["autor"]);
                echo '<br /><br /><span style="color:yellow;font-weight:bold;">Version vom :', gerdatum($erow["datum"]), '</span> editiert von ', $editusr->nickname, '<br />';
                echo nl2br(pruefetext($erow["text"]));
            }
        }
        // ** ENDE MODVIEW
        if (isset($editid)) {
            $eusr = new Account($editid);
            echo '<br /><br />[ <span style="color:red;">editiert von ', $eusr->nickname, ' ]';
        }
        if ($t["autor"] == 1) {
            echo '</font>';
        }
        echo '</td></tr></table>';
    }
    echo '<br/>';
    switch ($explodevar[0]) {
        case "KN":
            $neuchannel = 1;
            break;
        case "ARCHIV":
            $neuchannel = 2;
            break;
        case "HILFE":
            $neuchannel = 3;
            break;
        case "HANDEL":
            $neuchannel = 4;
            break;
        case "ALLIANZ":
            $neuchannel = 5;
            break;
        default:
            $neuchannel = 0;
            break;
    }
    showkn($neuchannel, $pre, $knid . "-" . $pid);
}
    changeit($text);
    if ($id > 0) {
        mysql_query("UPDATE kn SET datum='{$datum}',autor='" . $_SESSION["Id"] . "',text='{$text}',channel='{$channel}' WHERE id='{$pid}'") or die(mysql_error());
        echo '<meta http-equiv="Refresh" CONTENT="0;URL=knread.php?channel=', $channel, '">';
    } else {
        echo 'nicht eingeloggt';
    }
}
$abfrage = mysql_query("SELECT * FROM kn where channel='" . $channel . "' AND id='" . $pid . "'");
while ($row = mysql_fetch_array($abfrage)) {
    $edittext = $row["text"];
}
echo '<h3>Editieren ins Netzwerk</h3>';
echo '<form action="knedit.php?channel=', $channel, '&pid=', $pid, '" method="post">';
if ($_POST["do"] == 2) {
    echo '<br /><div style="width:400px;padding:4px;border:1px solid darkred;">', nl2br(pruefetext($_POST["text"])), '</div><br />';
}
?>


<input type="hidden" name="do" value="2">
<textarea name="text" rows="10" cols="50"><?php 
if (sizeof($_POST) > 0) {
    echo $_POST["text"];
} else {
    echo $edittext;
}
?>
</textarea><br /><br />
<input type="radio" name="do" value="2" <?php 
if ($_POST["do"] != 2) {
<?php

include "head.php";
include "navlogged.php";
include "klassen.php";
$aid = $_GET["id"];
//BETRY
$betray = false;
if (!ctype_digit($aid)) {
    die("Fehler: ID not valid");
}
//ENDE
$allianz = new Allianz($aid);
$aleiter = new Account($allianz->leiter);
echo '<table class="invitetable"><tr><th>Allianzname</th><td>', $allianz->name, '</td></tr><tr><th>K&uuml;rzel</th><td>', $allianz->tag, '</td></tr><tr><th>Leiter</th><td>', $aleiter->nickname, '</td></tr><tr><th>Beschreibung</th><td>', nl2br(pruefetext($allianz->info)), '</td></tr></table>';
echo '<br /><hr /><br /><table class="invitetable"><tr><th>Spieler</th><th>Nachricht senden</th></tr>';
$who = mysql_query("SELECT * FROM account WHERE allianz='{$aid}'");
while ($row = mysql_fetch_array($who)) {
    $usr = new Account($row["id"]);
    echo '<tr><td>', $row["id"] == $allianz->leiter ? '<span style="color:red;font-weight:bold;">' : '<span>', $usr->nickname, '</span></td><td>';
    $bu = new Button("newmail.php?to=" . $row["id"], "Nachricht senden");
    $bu->printme();
    echo '</td></tr>';
}
echo '</table>';
echo '<br />';
$bu = new Button("allianz.php", "zurück zur Allianzübersicht");
$bu->printme();
include "foot.php";
 $aktPlanet->getData($pid);
 if ($do == 2) {
     //werft bauen!
     if ($aktPlanet->rohstoffa >= 200 && $aktPlanet->rohstoffb >= 40) {
         $aktPlanet->werft = -8;
         $aktPlanet->rohstoffa -= 200;
         $aktPlanet->rohstoffb -= 40;
         echo 'Werft in Bau! Bauzeit: 8.<br />';
         $aktPlanet->setData($aktPlanet->id);
     } else {
         echo 'Nicht genug Rohstoffe vorhanden!<br />';
     }
 }
 if ($do == 3) {
     //namen aendern
     $newname = pruefetext($_POST["newname"]);
     $aktPlanet->name = $newname;
     $aktPlanet->setData($aktPlanet->id);
     $aktPlanet->getData($aktPlanet->id);
 }
 if ($do == 4) {
     //flab bauen!
     if ($aktPlanet->rohstoffa >= 500 && $aktPlanet->rohstoffb >= 60) {
         $aktPlanet->forschung = -10;
         $aktPlanet->rohstoffa -= 500;
         $aktPlanet->rohstoffb -= 60;
         echo 'Forschungslabor in Bau! Bauzeit: 10.<br />';
         $aktPlanet->setData($aktPlanet->id);
     } else {
         echo 'Nicht genug Rohstoffe vorhanden!<br />';
     }
    $anx = new Account($anfeld[$i]);
    echo ',', $anx->nickname;
}
echo '</td></tr>';
if (sizeof($anfeld) >= 1 && $_POST["empfaenger"] != '-3') {
    echo '<input type="hidden" name="empfaenger" value="', $an->id;
    for ($i = 1; $i < sizeof($anfeld); $i++) {
        $anx = new Account($anfeld[$i]);
        echo ',', $anx->id;
    }
    echo '">';
}
if ($_POST["empfaenger"] == '-3') {
    echo '<input type="hidden" name="empfaenger" value="-3" />';
}
echo '<tr><th>Betreff</th><td><input type="text" name="betreff" value="', $subject, '" /></td></tr>';
echo '</table><br />';
echo '<table class="invitetable">';
echo '<tr><th>Nachricht</th></tr>';
echo '<tr><td><div style="border:1px solid red;padding:10px;">', nl2br(pruefetext($_POST["inhalt"])), '</div><br /><textarea rows=15 cols=40 name="inhalt">', $_POST["inhalt"], '</textarea></td></tr></table>';
echo '<input type="radio" name="send" value="2" ', $POST["send"] == 2 ? '' : 'checked="checked"', '> Vorschau<br />';
if ($_POST["send"] == 2) {
    echo '<input type="radio" name="send" value="1" checked="checked"> Senden<br />';
}
echo '<br />';
$bu = new Button("newmail.php", "Formular zurücksetzen");
$bu->printme();
echo "<br /><br />";
$bu = new Button("", "senden");
$bu->printme();
include "foot.php";