OGame scriptinde diğer gezegenlerdeki kaynakları mevcut gezegene topluyor bu sayfa.

<?php



class ShowMadenToplamaPage extends AbstractPage {



    public static $requireModule = 0;



    function __construct() {

        parent::__construct();

    }

    function show() {

        global $CONF, $LNG, $PLANET, $USER, $resource, $UNI;
        

        if( $USER['urlaubs_modus'] == 1){

                $this->printMessage($LNG['tatil_modu_korumasi'], true, array('game.php?page=MadenToplama', 100));

                exit;  

            }


        $act             = HTTP::_GP('act', '');

        $transCoasts    = 1000;
    

        if ($act == "take") {


            if (!isset($_POST['check_planet']) && !isset($_POST['check_moons']))

                $this->redirectTo('game.php?page=MadenToplama');
            

            if(!(isset($_SESSION["rand"]) && $_POST["rand"] == $_SESSION["rand"]))

                $this->redirectTo('game.php?page=MadenToplama');            

                if(!isset($_POST['check_planet']))

                $_POST['check_planet'] = array();

                if(!isset($_POST['check_moons']))

                $_POST['check_moons'] = array();

                unset($_SESSION["rand"]);        

                if($transCoasts > $USER['darkmatter']){$this->printMessage($LNG['error_3'], true, array('game.php?page=MadenToplama', 2)); }

                else

                $USER['darkmatter']    -= $transCoasts;

                
            foreach($_POST['check_planet'] as $ID => $Value) {

                $sur = $GLOBALS['DATABASE']->uniquequery("SELECT metal, crystal, deuterium FROM ".PLANETS." where `id` = {$Value} AND id_owner = {$USER['id']};");

                $GLOBALS['DATABASE']->multi_query("LOCK TABLE ".PLANETS." WRITE; UPDATE ".PLANETS." SET `metal` = 0, `crystal` = 0 , `deuterium` = 0 WHERE  `id` = {$Value} AND id_owner = {$USER['id']}; UNLOCK TABLES;");

                $PLANET['metal'] += $sur['metal'];

                $PLANET['crystal'] += $sur['crystal'];

                $PLANET['deuterium'] += $sur['deuterium'];

            }

            foreach($_POST['check_moons'] as $ID => $Value) {

                $sur = $GLOBALS['DATABASE']->uniquequery("SELECT metal, crystal, deuterium FROM ".PLANETS." where `id` = {$Value} AND id_owner = {$USER['id']};");

                $GLOBALS['DATABASE']->multi_query("LOCK TABLE ".PLANETS." WRITE; UPDATE ".PLANETS." SET `metal` = 0, `crystal` = 0 , `deuterium` = 0 WHERE  `id` = {$Value} AND id_owner = {$USER['id']}; UNLOCK TABLES;");

                $PLANET['metal'] += $sur['metal'];

                $PLANET['crystal'] += $sur['crystal'];

                $PLANET['deuterium'] += $sur['deuterium'];

            }

            $this->printMessage($LNG['h_ok'], true, array('game.php?page=MadenToplama', 2));

        } else {

            

            $rand=rand();

            $_SESSION['rand']=$rand;

            $Planets        = array();

            $Moons             = array();

            if (isset($USER['PLANETS'])) {

                $USER['PLANETS']    = getPlanets($USER);

            }

            foreach($USER['PLANETS'] as $ID => $PlanetQuery) {

                if ($ID == $PLANET['id']) continue;

                if ($PlanetQuery['planet_type'] == 3) {

                    $Moons[$PlanetQuery['id']] = $PlanetQuery['name'] . " [" . $PlanetQuery['galaxy'] . ":" . $PlanetQuery['system'] . ":" . $PlanetQuery['planet'] . "]";

                } elseif ($PlanetQuery['planet_type'] == 1) {

                    $Planets[$PlanetQuery['id']] = $PlanetQuery['name'] . " [".$PlanetQuery['galaxy'] . ":" . $PlanetQuery['system'] . ":" . $PlanetQuery['planet'] . "]";

                }

            }

//            $this->tplObj->loadscript("jquery.countdown.js");

            $this->tplObj->assign_vars(array(

                'PlanetsList'                => $Planets,

                'MoonsList'                    => $Moons,

                'rand'                        => $rand

            ));

            $this->display('page.harvest.default2.tpl');

        }

    }

}

?>