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

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

include("common.php");

if(!isset($action))
{

//get list of ships belonging to the user..
$res = $db->select("ship_id,ship_name,ship_sector","ships","ship_owner='$userinfo[userid]'",0);

while($row = mysql_fetch_array($res))
{
$shipshtml .= "<option value=\"$row[ship_id]\">$row[ship_name] in sector $row[ship_sector]</option>";
}

$page->Assign("shipshtml",$shipshtml);
$page->Assign("content",newbox("Board Ship",$page->FetchTemplate("BoardShip")));
$page->Display("template");

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

//check the ship is ours...

//update the database..

$db->update("users","user_id","$userinfo[userid]","user_currentship","$input_boardship");

//now show the main screen

$refresh = "<meta HTTP-EQUIV=\"REFRESH\" CONTENT=\"0; url=flagship.php\">";

$page->Assign("content",newbox("Board Ship","You have successfully boarded the ship<BR>$refresh"));

$page->Display("template");

}

?>
Return current item: Terra Nova