Location: PHPKode > projects > Terra Nova > planet.php
<?php

$require_login = true;
$gamescript = true;
$summaryscript = false;

include("common.php");
$planet_html .= "Click <A CLASS=\"nav\" HREF=\"planet.php?action=colonize\">here</a> to colonize this planet!</td>";

$sector_owner = $sectorinfo[sector_owner];
$name = $user->getusername($sector_owner);
$planet_exist = $sectorinfo[planet];
$sector_owner = $sectorinfo[sector_owner];
$userid = $dbuserinfo['user_id'];
$location = $shipres[ship_sector];

if(!isset($action))
{

if($sector_owner!=0){
$page->Assign("content",newbox("Planet Info","Planet in this sector($location) is owned by $name"));
$page->Display("template");
}
elseif($sector_owner!=0){
$refresh = "<meta HTTP-EQUIV=\"REFRESH\" CONTENT=\"3; url=flagship.php\">";
$page->Assign("content",newbox("Error: Planet Colonized","Sorry, this planet has been colonized already! $refresh"));
$page->Display("template");
}

}
elseif($action=="colonize"){

if($colonize_planet=0){
$refresh = "<meta HTTP-EQUIV=\"REFRESH\" CONTENT=\"3; url=flagship.php\">";
$page->Assign("content",newbox("Invalid Planet","Sorry, the planet you selected doesn't exist! $refresh"));
$page->Display("template");
}

if($planet_exist=="N"){
$refresh = "<meta HTTP-EQUIV=\"REFRESH\" CONTENT=\"3; url=flagship.php\">";
$page->Assign("content",newbox("Error: No Planet","Sorry, there is no planet at your location! $refresh"));
$page->Display("template");
}


else{
$refresh = "<meta HTTP-EQUIV=\"REFRESH\" CONTENT=\"3; url=flagship.php\">";
$page->Assign("content",newbox("Planet Colonized","You have colonized this planet! $refresh"));
$page->Display("template");

//Update the db
$db->update("$quadname","sector_id","$sectorinfo[sector_id]","sector_owner","$userinfo[userid]");
}

}
?>
Return current item: Terra Nova