<?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");
$sess->register("player_dead");
include("./lib/player.php");
include("./lib/ship.php");
include("./merchantempiresdefines.php");
include("./lib/player_redirect.php");
?>
<html><head><title>Merchant Empires: Repulsion Mine Field</title>
<link rel=stylesheet href="./merchantempires.css" type=text/css>
</head><body text=white background="./images/stars.png"><?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> </td>
<td vAlign=top width=490>
<table border=0 cellPadding=0 cellSpacing=0>
<tr>
<td bgColor=#993300>
<table border=0 cellPadding=5 cellSpacing=1 width=500>
<tr>
<td bgColor=#000000 valign=middle>
<font color=#3333FF face=arial,helvetica,swiss size=5><center>REPULSION FIELD</center></font>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br><?php
$id = (int) $id;
$move = (int) $move;
$db_f = new ME_DB;
$query = sprintf("select forces_id, player_name from forces where forces_id = '%s'", $id);
$db_f->query($query);
$db_f->next_record();
$forces_player_name = $db_f->f("player_name");
$db = new ME_DB;
$query = sprintf("select * from sectors where sector_id = '%s'", $move);
$db->query($query);
$db->next_record();
$public_sector_id = $db->f("public_sector_id");
?>
<table border=0 cellPadding=0 cellSpacing=0>
<tr>
<td bgColor=#003399>
<table border=0 cellPadding=5 cellSpacing=1 width=500>
<tr>
<td bgColor=#000000 valign=middle>
<font color=#cccccc face=arial,helvetica,swiss size=3><br><?php
echo "Your ship has detected a repulsionary mine field in sector " . $public_sector_id . ".<br><br> A scan of the mine";
echo "field reveals that it belongs to merchant " . $forces_player_name . ". ";
echo "By laying this mine field, " . $forces_player_name . " has claimed Sector " . $public_sector_id . ". Proceeding forward is considered trespassing.";
echo "<br><br>Your ship must attack this mine field in order to enter sector " . $public_sector_id . ".<br><br>";
?>
</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<table border=0 cellPadding=0 cellSpacing=0 width=500
<tr>
<td bgColor=#993300>
<table border=0 cellPadding=5 cellSpacing=1 width="100%">
<tr>
<td bgColor=#000000>
<center><table cellPadding=2 cellSpacing=2>
<tr><td><?php
echo "<form action=";
echo $sess->url(URL . "move_to_sector.php?move=" . $move . "&repulsion_check=0");
?>
method=post>
<br><center><input type=submit name=ignore_repulsion value='Attack'></center>
</form></td><td><?php
echo "<form action=";
echo $sess->url(URL . "current_sector.php");
?>
method=post>
<br><center><input type=submit name=current_sector value='Abort'></center>
</form>
</td></tr>
</table></center>
</td>
</td>
</tr>
</table>
</td>
</tr>
</table><br>
</td>
<td valign=top align=right width=100%><?php
include("./messages_display.php");
echo $player->get_transform("./xslt/player.xslt", $player->get_xml());
include("./ship_display.php");
?>
</td></tr></table>
</body></html><?php
page_close();
?>