Пример #1
0
##    along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
##
################################################################################
require "dblogon.php";
require "options.php";
if ($attack != "") {
    $result = mysql_query("UPDATE " . $PA["table"] . " SET war='{$attack}',wareta='35' WHERE id={$Userid}", $db);
    header("Location: military.php");
    die;
}
if ($to != "") {
    $result = mysql_query("SELECT * FROM " . $PA["table"] . " WHERE id='{$to}'", $db);
    if (mysql_num_rows($result) != 1) {
        Header("Location: communication.php?msgred=No such planet!");
        die;
    }
}
if ($to > 0 && $to != $Userid) {
    Add_news("Mail from {$Username} #{$Userid}", nl2br(strip_tags($text) . "\n\n(<a href=\"communication.php?toid={$Userid}\">Reply</a>)"), $to);
    Header("Location: communication.php?msggreen=Mail sent successfully!");
}
require "header.php";
?>
Communication:<br><br>
<?php 
echo "Send mail:<br>";
echo "<SCRIPT LANGUAGE=\"JavaScript\"><!--\r\nfunction loginpopup()\r\n{\r\nloginwin = window.open('planets.php?var=to','loginwin','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=450,height=250,left=' + (window.screen.width-450)/2 + ',top=' + (window.screen.height-400)/2);\r\nloginwin.focus();\r\n}\r\n//--></SCRIPT>";
echo "<table><td><form action=\"{$PHP_SELF}\" METHOD=\"POST\" name=\"form1\">To <font size=\"1\">(Planet ID #):<br><A href=\"javascript:loginpopup();\">Find</font></td><td><input type=\"text\" name=\"to\" size=\"7\" value=\"{$toid}\">\n";
echo "</td><tr><td>Text:</td><td><textarea name=\"text\" cols=\"40\" rows=\"5\"></text";
echo "area><br><input type=\"Submit\" value=\"Send\"></form></table>";
require "footer.php";
Пример #2
0
        if (mysql_num_rows($result) != 1) {
            header("Location: military.php?msgred=No such planet!");
            die;
        }
        $mr = mysql_fetch_array($result);
        if ($mr["score"] < $score / 7) {
            Header("Location: military.php?msgred=The planet is out of your range!");
            die;
        }
    }
    if ($defend > 0 && $myrow["war"] == 0 && $myrow["def"] == 0) {
        Add_news("Incoming friendly fleet", "{$Username} #{$Userid} is defending you, ETA 20 mins.", $defend);
        $result = mysql_query("UPDATE " . $PA["table"] . " SET def='{$defend}',wareta='30' WHERE id={$Userid}", $db);
    }
    if ($defend < 0 && $myrow["def"] > 0) {
        Add_news("Recall", "{$Username} #{$Userid} recalled his fleet.", $myrow["def"]);
        if ($wareta >= 10) {
            $result = mysql_query("UPDATE " . $PA["table"] . " SET war='-1',wareta='" . (30 - $wareta) . "',def=0 WHERE id={$Userid}", $db);
        } else {
            $result = mysql_query("UPDATE " . $PA["table"] . " SET war='-1',wareta='20',def=0 WHERE id={$Userid}", $db);
        }
    }
    header("Location: military.php");
    die;
}
require "header.php";
?>
Military:<br><br>
<?php 
$result = mysql_query("SELECT * FROM " . $PA["table"] . " WHERE war={$Userid}", $db);
if ($myrow = mysql_fetch_array($result)) {