Source

Selador / handel.php

Full commit
<?php

/* handel.php - Front-end code for "Handel" page
 *
 * Copyright (C) 2006, 2007, 2008 Kevin Read, Simone Schaefer
 *
 * This file is part of Selador, a browser-based fantasy strategy game
 *
 * This program is distributed under the terms of the GNU Affero General Public License.
 *
 *
 *   Selador is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU Affero General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   any later version.
 *
 *   Selador 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 Affero General Public License for more details.
 *
 *   You should have received a copy of the GNU Affero General Public License
 *   along with Selador.  If not, see <http://www.gnu.org/licenses/>.
 **/

// Works mostly but I have heard it is flawed. Maybe vollmilch can comment
// what the problems are.

require_once("php/base/world.inc.php");
require_once("php/base.php");
require_once("php/event.php");

if (isset ($_REQUEST['f']))
{
	$f = $_REQUEST['f'];
}
else
	$f = 1;

if ($f != 2)
	$no_reload = 1;
require_once ("merchant/merchant_functions.php");
require_once("merchant/merchants_calculations.php");
require_once("headers.php");
echo '<script src="scripts/merchant.js" type="text/javascript"></script>';
require_once ("styles/php/base_design-".$_SESSION['theme'].".php");
require_once("blocked.php");


$f = getPage($_REQUEST, $me);
?>



<?php
echo '<div id="contentbox">';
// We should pass this on to the tutorial, if it is still going strong
if (is_object ($tutorial))
{
	if ($tutorial->active)
		$tutorial->is_in_market ($f);
}


//TODO display error message in outposts

//send ressources
if ($f == 1)
{
	require_once('merchant/merchant_send.php');

}

//view offers on market place
if ($f == 2)
{
	echo '<div id="onecolumn">';

	require_once('merchant/merchant_view.php');
	echo '</div>';
}

//own offers on marketplace
if ($f == 3)
{
	require_once('merchant/merchant_own.php');
}

//supermarket - works
if ($f == 4)
{
	echo '<div id="onecolumn">';
	require_once('merchant/merchant_change.php');
	echo '</div>';
}
?>


</div>
<?php
$me->activevillage->update_stamp ();
require_once("footer.php");
?>