Location: PHPKode > projects > Merchant Empires > merchempires/merchantempires/ship_list.php
<?php
/****************************************************************************
*    Copyright (C) 2000 Bryan Brunton
*
*    This program is free software; you can redistribute it and/or modify
*    it under the terms of the GNU General Public License as published by
*    the Free Software Foundation; either version 2 of the License, or
*    (at your option) any later version.
*
*    This program is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*    GNU General Public License for more details.
*
*    You should have received a copy of the GNU General Public License
*    along with this program; if not, write to the Free Software
*    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
****************************************************************************/

page_open(array("sess" => "ME_Session_Uncached", "auth" => "ME_Auth", "user" => "ME_User"));
$sess->register("player_id");

include("./lib/player.php");
include("./lib/ship.php");
include("./merchantempiresdefines.php");
include("./lib/player_redirect.php");
?>

<html><head><title>Merchant Empires: Ship List</title>
<link rel=stylesheet href="./merchantempires.css" type=text/css>
</head><body text=white background="./images/createbg.gif"><?php

include("./templates/header.html");
?>

<table width=100%><tr>
<td width=100 vAlign=top><?php

$player = new ME_Player;
$player->get_player($player_id);
$game_id = $player->f("game_id");

$ship = new ME_Ship;
$ship->get_ship($player_id);

$ship->add_parameter("time", date ("Y H:i:s"));
echo $ship->get_transform("./xslt/mainmenu.xslt", $ship->get_xml());
?>

</td>
<td vAlign=top align=left width=0>&nbsp;</td>
<td vAlign=top width=500>

<table border=0 cellPadding=0 cellSpacing=0>
	<tr>
		<td bgColor=#993300>
			<table border=0 cellPadding=5 cellSpacing=1 width=500>
				<tr>
					<td width=500 bgColor=#000000 align=left valign=middle>
						<table border=0>
            	<tr>
								<td align=left colspan=6>
									<font color=#3333FF face=arial,helvetica,swiss size=5>SHIP LIST</font>
								</td>
							</tr>
							
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<br><?php

$db = new ME_DB;
$db->query("select * from ship_types order by name");

?>
<table border=0 cellPadding=0 cellSpacing=0 width=500>
	<tr>
		<td bgColor=#003399>
			<table cols=7 border=0 cellpadding=2 cellspacing=1 width=500>
				<tr>
					<td class=clsHedTxt id=blu1>
						Name
					</td>
					<td class=clsHedTxt id=blu1>
					Race
					</td>
					<td class=clsHedTxt id=blu1>
					Cost
					</td>
					<td class=clsHedTxt id=blu1>
					Turns Per Sector
					</td>
					<td class=clsHedTxt id=blu1>
					Holds
					</td>
					<td class=clsHedTxt id=blu1>
					Armor
					</td>
					<td class=clsHedTxt id=blu1>
					Shields
					</td>			
					<td class=clsHedTxt id=blu1>
					Combat Drones
					</td>			
					<td class=clsHedTxt id=blu1>
					Scout Drones
					</td>			
					<td class=clsHedTxt id=blu1>
					Mines
					</td>			
					<td class=clsHedTxt id=blu1>
					HP
					</td>			
					<td class=clsHedTxt id=blu1>
					Level
					</td>			
					<td class=clsHedTxt id=blu1>
					Scanner
					</td>			
					<td class=clsHedTxt id=blu1>
					Illusion
					</td>			
					<td class=clsHedTxt id=blu1>
					Cloak
					</td>			
					<td class=clsHedTxt id=blu1>
					Jump
					</td>	
					<td class=clsHedTxt id=blu1>
					Galaxy Jump
					</td>					
				</tr><?php

while ( $db->next_record() ) {

?>				
				<tr>
					<td class=clsNrmTxt>
<?php echo $db->f("name"); ?>
					</td>
					<td class=clsNrmTxt><?php

switch ($db->f("race")) {
		case "1":
			echo "Human";
			break;
		case "2":
      echo "Kushun";
			break;
		case "3":
      echo "Psilon";
			break;
		case "4":
      echo "Taiidan";
			break;
		case "5":
      echo "Bulrathi";
			break;
		case "6":
      echo "Thevien";
			break;
		case "7":
      echo "Ferenge";
			break;
		default:
			echo "&nbsp;";
			break;
}



?>
					</td>
					<td class=clsNrmTxt>
<?php echo $db->f("cost"); ?>
					</td>
					<td class=clsNrmTxt>
<?php echo $db->f("turns_per_sector"); ?>
					</td>
					<td class=clsNrmTxt>
<?php echo $db->f("cargomax"); ?>
					</td>
					<td class=clsNrmTxt>
<?php echo $db->f("armormax"); ?>	
					</td>
					<td class=clsNrmTxt>
<?php echo $db->f("shieldmax"); ?>
					</td>			
					<td class=clsNrmTxt>
<?php echo $db->f("combatmax"); ?>
					</td>			
					<td class=clsNrmTxt>
<?php echo $db->f("scoutmax"); ?>
					</td>			
					<td class=clsNrmTxt>
<?php echo $db->f("minesmax"); ?>
					</td>			
					<td class=clsNrmTxt>
<?php echo $db->f("hardpoints"); ?>
					</td>
					<td class=clsNrmTxt>
<?php echo $db->f("experience_level"); ?>
					</td>				
					<td class=clsNrmTxt><?php

if ( $db->f("scanner") <> 'f' ) {
	echo $db->f("scanner");
} else {
	echo "&nbsp;";
}
?>
					</td>			
					<td class=clsNrmTxt><?php

if ( $db->f("illusion") <> 'f' ) {
	echo $db->f("illusion");
} else {
	echo "&nbsp;";
}
?>
					</td>			
					<td class=clsNrmTxt><?php

if ( $db->f("cloak") <> 'f' ) {
	echo $db->f("cloak");
} else {
	echo "&nbsp;";
}
?>
					</td>			
					<td class=clsNrmTxt><?php

if ( $db->f("jump") <> 'f' ) {
	echo $db->f("jump");
} else {
	echo "&nbsp;";
}
?>
					</td>	
					<td class=clsNrmTxt><?php

if ( $db->f("galaxy_jump") <> 'f' ) {
	echo $db->f("galaxy_jump");
} else {
	echo "&nbsp;";
}
?>
					</td>					
				</tr><?php
}

?>
			</table>
		<td>
  </tr>
</table>

</td>
<td valign=top align=right width=100%><?php

?>

</td></tr></table>
</body></html><?php

page_close();
?>
Return current item: Merchant Empires