fixes for marketplace

This commit is contained in:
unknown
2012-08-04 12:38:21 +03:00
parent dc642c8cea
commit 02e66403e6
2 changed files with 460 additions and 337 deletions
+166 -72
View File
@@ -4,42 +4,46 @@
## --------------------------------------------------------------------------- ## ## --------------------------------------------------------------------------- ##
## Filename Market.php ## ## Filename Market.php ##
## Developed by: Dzoki ## ## Developed by: Dzoki ##
## Some fixes: aggenkeech ##
## License: TravianX Project ## ## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ## ## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ## ## ##
################################################################################# #################################################################################
class Market {
class Market
{
public $onsale,$onmarket,$sending,$recieving,$return = array(); public $onsale,$onmarket,$sending,$recieving,$return = array();
public $maxcarry,$merchant,$used; public $maxcarry,$merchant,$used;
public function procMarket($post) { public function procMarket($post)
{
$this->loadMarket(); $this->loadMarket();
if(isset($_SESSION['loadMarket'])) { if(isset($_SESSION['loadMarket']))
{
$this->loadOnsale(); $this->loadOnsale();
unset($_SESSION['loadMarket']); unset($_SESSION['loadMarket']);
} }
if(isset($post['ft'])) { if(isset($post['ft']))
switch($post['ft']) { {
case "mk1": switch($post['ft'])
$this->sendResource($post); {
break; case "mk1": $this->sendResource($post); break;
case "mk2": case "mk2": $this->addOffer($post); break;
$this->addOffer($post); case "mk3": $this->tradeResource($post); break;
break;
case "mk3":
$this->tradeResource($post);
break;
} }
} }
} }
public function procRemove($get) { public function procRemove($get)
{
global $database,$village,$session; global $database,$village,$session;
if(isset($get['t']) && $get['t'] == 1) {
if(isset($get['t']) && $get['t'] == 1)
{
$this->filterNeed($get); $this->filterNeed($get);
} }
else if(isset($get['t']) && $get['t'] ==2 && isset($get['a']) && $get['a'] == 5 && isset($get['del'])) { else if(isset($get['t']) && $get['t'] ==2 && isset($get['a']) && $get['a'] == 5 && isset($get['del']))
{
//GET ALL FIELDS FROM MARKET //GET ALL FIELDS FROM MARKET
$type = $database->getMarketField($village->wid,"gtype"); $type = $database->getMarketField($village->wid,"gtype");
$amt = $database->getMarketField($village->wid,"gamt"); $amt = $database->getMarketField($village->wid,"gamt");
@@ -48,18 +52,22 @@ class Market {
$database->addMarket($village->wid,$get['del'],0,0,0,0,0,0,1); $database->addMarket($village->wid,$get['del'],0,0,0,0,0,0,1);
header("Location: build.php?id=".$get['id']."&t=2"); header("Location: build.php?id=".$get['id']."&t=2");
} }
if(isset($get['t']) && $get['t'] == 1 && isset($get['a']) && $get['a'] == $session->mchecker && !isset($get['del'])) { if(isset($get['t']) && $get['t'] == 1 && isset($get['a']) && $get['a'] == $session->mchecker && !isset($get['del']))
{
$session->changeChecker(); $session->changeChecker();
$this->acceptOffer($get); $this->acceptOffer($get);
} }
} }
public function merchantAvail() { public function merchantAvail()
{
return $this->merchant - $this->used; return $this->merchant - $this->used;
} }
private function loadMarket() { private function loadMarket()
{
global $session,$building,$bid28,$bid17,$database,$village; global $session,$building,$bid28,$bid17,$database,$village;
$this->recieving = $database->getMovement(0,$village->wid,1); $this->recieving = $database->getMovement(0,$village->wid,1);
$this->sending = $database->getMovement(0,$village->wid,0); $this->sending = $database->getMovement(0,$village->wid,0);
$this->return = $database->getMovement(2,$village->wid,1); $this->return = $database->getMovement(2,$village->wid,1);
@@ -68,13 +76,16 @@ class Market {
$this->onmarket = $database->getMarket($village->wid,0); $this->onmarket = $database->getMarket($village->wid,0);
$this->maxcarry = ($session->tribe == 1)? 500 : (($session->tribe == 2)? 1000 : 750); $this->maxcarry = ($session->tribe == 1)? 500 : (($session->tribe == 2)? 1000 : 750);
$this->maxcarry *= TRADER_CAPACITY; $this->maxcarry *= TRADER_CAPACITY;
if($building->getTypeLevel(28) != 0) { if($building->getTypeLevel(28) != 0)
{
$this->maxcarry *= $bid28[$building->getTypeLevel(28)]['attri'] / 100; $this->maxcarry *= $bid28[$building->getTypeLevel(28)]['attri'] / 100;
} }
} }
private function sendResource($post) { private function sendResource($post)
{
global $database,$village,$session,$generator,$logging; global $database,$village,$session,$generator,$logging;
$wtrans = (isset($post['r1']) && $post['r1'] != "")? $post['r1'] : 0; $wtrans = (isset($post['r1']) && $post['r1'] != "")? $post['r1'] : 0;
$ctrans = (isset($post['r2']) && $post['r2'] != "")? $post['r2'] : 0; $ctrans = (isset($post['r2']) && $post['r2'] != "")? $post['r2'] : 0;
$itrans = (isset($post['r3']) && $post['r3'] != "")? $post['r3'] : 0; $itrans = (isset($post['r3']) && $post['r3'] != "")? $post['r3'] : 0;
@@ -87,20 +98,25 @@ class Market {
$availableClay = $database->getClayAvailable($village->wid); $availableClay = $database->getClayAvailable($village->wid);
$availableIron = $database->getIronAvailable($village->wid); $availableIron = $database->getIronAvailable($village->wid);
$availableCrop = $database->getCropAvailable($village->wid); $availableCrop = $database->getCropAvailable($village->wid);
if($session->access == BANNED){ if($session->access == BANNED)
{
header("Location: banned.php"); header("Location: banned.php");
}else if($availableWood >= $post['r1'] AND $availableClay >= $post['r2'] AND $availableIron >= $post['r3'] AND $availableCrop >= $post['r4']){ }
else if($availableWood >= $post['r1'] AND $availableClay >= $post['r2'] AND $availableIron >= $post['r3'] AND $availableCrop >= $post['r4'])
{
$resource = array($wtrans,$ctrans,$itrans,$crtrans); $resource = array($wtrans,$ctrans,$itrans,$crtrans);
$reqMerc = ceil((array_sum($resource)-0.1)/$this->maxcarry); $reqMerc = ceil((array_sum($resource)-0.1)/$this->maxcarry);
if($this->merchantAvail() != 0 && $reqMerc <= $this->merchantAvail()) { if($this->merchantAvail() != 0 && $reqMerc <= $this->merchantAvail())
{
$id = $post['getwref']; $id = $post['getwref'];
$coor = $database->getCoor($id); $coor = $database->getCoor($id);
if($database->getVillageState($id)) { if($database->getVillageState($id))
{
$timetaken = $generator->procDistanceTime($coor,$village->coor,$session->tribe,0); $timetaken = $generator->procDistanceTime($coor,$village->coor,$session->tribe,0);
$res = $resource[0]+$resource[1]+$resource[2]+$resource[3]; $res = $resource[0]+$resource[1]+$resource[2]+$resource[3];
if($res!=0){ if($res!=0)
{
$reference = $database->sendResource($resource[0],$resource[1],$resource[2],$resource[3],$reqMerc,0); $reference = $database->sendResource($resource[0],$resource[1],$resource[2],$resource[3],$reqMerc,0);
$database->modifyResource($village->wid,$resource[0],$resource[1],$resource[2],$resource[3],0); $database->modifyResource($village->wid,$resource[0],$resource[1],$resource[2],$resource[3],0);
$database->addMovement(0,$village->wid,$id,$reference,time(),time()+$timetaken,$post['send3']); $database->addMovement(0,$village->wid,$id,$reference,time(),time()+$timetaken,$post['send3']);
@@ -109,11 +125,35 @@ class Market {
} }
} }
header("Location: build.php?id=".$post['id']); header("Location: build.php?id=".$post['id']);
} else {} }
else
{
// something
}
} }
private function addOffer($post) { private function addOffer($post)
{
global $database,$village,$session; global $database,$village,$session;
if($post['rid1'] == $post['rid2'])
{
// Trading res for res of same type (invalid)
header("Location: build.php?id=".$post['id']."&t=2&e2");
}
elseif($post['m1'] > (2 * $post['m2']))
{
// Trade is for more than 2x (invalid)
header("Location: build.php?id=".$post['id']."&t=2&e2");
}
elseif($post['m2'] > (2 * $post['m1']))
{
// Trade is for less than 0.5x (invalid)
header("Location: build.php?id=".$post['id']."&t=2&e2");
}
else
{
$wood = ($post['rid1'] == 1)? $post['m1'] : 0; $wood = ($post['rid1'] == 1)? $post['m1'] : 0;
$clay = ($post['rid1'] == 2)? $post['m1'] : 0; $clay = ($post['rid1'] == 2)? $post['m1'] : 0;
$iron = ($post['rid1'] == 3)? $post['m1'] : 0; $iron = ($post['rid1'] == 3)? $post['m1'] : 0;
@@ -122,38 +162,65 @@ class Market {
$availableClay = $database->getClayAvailable($village->wid); $availableClay = $database->getClayAvailable($village->wid);
$availableIron = $database->getIronAvailable($village->wid); $availableIron = $database->getIronAvailable($village->wid);
$availableCrop = $database->getCropAvailable($village->wid); $availableCrop = $database->getCropAvailable($village->wid);
if($session->access == BANNED){
header("Location: banned.php");
}else if($availableWood >= $wood AND $availableClay >= $clay AND $availableIron >= $iron AND $availableCrop >= $crop){
if($session->access == BANNED)
{
header("Location: banned.php");
}
elseif($availableWood >= $wood AND $availableClay >= $clay AND $availableIron >= $iron AND $availableCrop >= $crop)
{
$reqMerc = 1; $reqMerc = 1;
if(($wood+$clay+$iron+$crop) > $this->maxcarry) {
if(($wood+$clay+$iron+$crop) > $this->maxcarry)
{
$reqMerc = round(($wood+$clay+$iron+$crop)/$this->maxcarry); $reqMerc = round(($wood+$clay+$iron+$crop)/$this->maxcarry);
if(($wood+$clay+$iron+$crop) > $this->maxcarry*$reqMerc) {
if(($wood+$clay+$iron+$crop) > $this->maxcarry*$reqMerc)
{
$reqMerc += 1; $reqMerc += 1;
} }
} }
if($this->merchantAvail() != 0 && $reqMerc <= $this->merchantAvail()) { if($this->merchantAvail() != 0 && $reqMerc <= $this->merchantAvail())
if ($database->modifyResource($village->wid,$wood,$clay,$iron,$crop,0)) { {
if($database->modifyResource($village->wid,$wood,$clay,$iron,$crop,0))
{
$time = 0; $time = 0;
if(isset($_POST['d1'])) { if(isset($_POST['d1']))
{
$time = $_POST['d2'] * 3600; $time = $_POST['d2'] * 3600;
} }
$alliance = (isset($post['ally']) && $post['ally'] == 1)? $session->userinfo['alliance'] : 0; $alliance = (isset($post['ally']) && $post['ally'] == 1)? $session->userinfo['alliance'] : 0;
$database->addMarket($village->wid,$post['rid1'],$post['m1'],$post['rid2'],$post['m2'],$time,$alliance,$reqMerc,0); $database->addMarket($village->wid,$post['rid1'],$post['m1'],$post['rid2'],$post['m2'],$time,$alliance,$reqMerc,0);
} }
} // Enough merchants
header("Location: build.php?id=".$post['id']."&t=2"); header("Location: build.php?id=".$post['id']."&t=2");
} else {} }
else
{
// Not enough merchants
header("Location: build.php?id=".$post['id']."&t=2&e3");
}
}
else
{
// not enough resources
header("Location: build.php?id=".$post['id']."&t=2&e1");
}
}
} }
private function acceptOffer($get) { private function acceptOffer($get)
{
global $database,$village,$session,$logging,$generator; global $database,$village,$session,$logging,$generator;
$infoarray = $database->getMarketInfo($get['g']); $infoarray = $database->getMarketInfo($get['g']);
$reqMerc = 1; $reqMerc = 1;
if($infoarray['wamt'] > $this->maxcarry) { if($infoarray['wamt'] > $this->maxcarry)
{
$reqMerc = round($infoarray['wamt']/$this->maxcarry); $reqMerc = round($infoarray['wamt']/$this->maxcarry);
if($infoarray['wamt'] > $this->maxcarry*$reqMerc) { if($infoarray['wamt'] > $this->maxcarry*$reqMerc)
{
$reqMerc += 1; $reqMerc += 1;
} }
} }
@@ -172,22 +239,23 @@ class Market {
$resource[$infoarray['wtype']] = $infoarray['wamt']; $resource[$infoarray['wtype']] = $infoarray['wamt'];
$database->modifyResource($village->wid,$resource[1],$resource[2],$resource[3],$resource[4],0); $database->modifyResource($village->wid,$resource[1],$resource[2],$resource[3],$resource[4],0);
$database->setMarketAcc($get['g']); $database->setMarketAcc($get['g']);
$database->removeAcceptedOffer($get['g']); $database->removeAcceptedOffer($get['g']);
$logging->addMarketLog($village->wid,2,array($infoarray['vref'],$get['g'])); $logging->addMarketLog($village->wid,2,array($infoarray['vref'],$get['g']));
header("Location: build.php?id=".$get['id']); header("Location: build.php?id=".$get['id']);
} }
private function loadOnsale() { private function loadOnsale()
{
global $database,$village,$session,$multisort,$generator; global $database,$village,$session,$multisort,$generator;
$displayarray = $database->getMarket($village->wid,1); $displayarray = $database->getMarket($village->wid,1);
$holderarray = array(); $holderarray = array();
foreach($displayarray as $value) { foreach($displayarray as $value)
{
$targetcoor = $database->getCoor($value['vref']); $targetcoor = $database->getCoor($value['vref']);
$duration = $generator->procDistanceTime($targetcoor,$village->coor,$session->tribe,0); $duration = $generator->procDistanceTime($targetcoor,$village->coor,$session->tribe,0);
if($duration <= $value['maxtime'] || $value['maxtime'] == 0) { if($duration <= $value['maxtime'] || $value['maxtime'] == 0)
{
$value['duration'] = $duration; $value['duration'] = $duration;
array_push($holderarray,$value); array_push($holderarray,$value);
} }
@@ -195,70 +263,96 @@ class Market {
$this->onsale = $multisort->sorte($holderarray, "'duration'", true, 2); $this->onsale = $multisort->sorte($holderarray, "'duration'", true, 2);
} }
private function filterNeed($get) { private function filterNeed($get)
if(isset($get['v']) || isset($get['s']) || isset($get['b'])) { {
if(isset($get['v']) || isset($get['s']) || isset($get['b']))
{
$holder = $holder2 = array(); $holder = $holder2 = array();
if(isset($get['v']) && $get['v'] == "1:1") { if(isset($get['v']) && $get['v'] == "1:1")
foreach($this->onsale as $equal) { {
if($equal['wamt'] <= $equal['gamt']) { foreach($this->onsale as $equal)
{
if($equal['wamt'] <= $equal['gamt'])
{
array_push($holder,$equal); array_push($holder,$equal);
} }
} }
} }
else { else
{
$holder = $this->onsale; $holder = $this->onsale;
} }
foreach($holder as $sale) { foreach($holder as $sale)
if(isset($get['s']) && isset($get['b'])) { {
if($sale['gtype'] == $get['s'] && $sale['wtype'] == $get['b']) { if(isset($get['s']) && isset($get['b']))
{
if($sale['gtype'] == $get['s'] && $sale['wtype'] == $get['b'])
{
array_push($holder2,$sale); array_push($holder2,$sale);
} }
} }
else if(isset($get['s']) && !isset($get['b'])) { else if(isset($get['s']) && !isset($get['b']))
if($sale['gtype'] == $get['s']) { {
if($sale['gtype'] == $get['s'])
{
array_push($holder2,$sale); array_push($holder2,$sale);
} }
} }
else if(isset($get['b']) && !isset($get['s'])) { else if(isset($get['b']) && !isset($get['s']))
if($sale['wtype'] == $get['b']) { {
if($sale['wtype'] == $get['b'])
{
array_push($holder2,$sale); array_push($holder2,$sale);
} }
} }
else { else
{
$holder2 = $holder; $holder2 = $holder;
} }
} }
$this->onsale = $holder2; $this->onsale = $holder2;
} }
else { else
{
$this->loadOnsale(); $this->loadOnsale();
} }
} }
private function tradeResource($post) { private function tradeResource($post)
{
global $session,$database,$village; global $session,$database,$village;
$wwvillage = $database->getResourceLevel($village->wid); $wwvillage = $database->getResourceLevel($village->wid);
if($wwvillage['f99t']!=40){ if($wwvillage['f99t']!=40)
if($session->userinfo['gold'] >= 3) { {
if($session->userinfo['gold'] >= 3)
{
//kijken of ze niet meer gs invoeren dan ze hebben //kijken of ze niet meer gs invoeren dan ze hebben
if($session->access == BANNED){ if($session->access == BANNED)
{
header("Location: banned.php"); header("Location: banned.php");
}else if (($post['m2'][0]+$post['m2'][1]+$post['m2'][2]+$post['m2'][3])<=(round($village->awood)+round($village->aclay)+round($village->airon)+round($village->acrop))){ }
else if (($post['m2'][0]+$post['m2'][1]+$post['m2'][2]+$post['m2'][3])<=(round($village->awood)+round($village->aclay)+round($village->airon)+round($village->acrop)))
{
$database->setVillageField($village->wid,"wood",$post['m2'][0]); $database->setVillageField($village->wid,"wood",$post['m2'][0]);
$database->setVillageField($village->wid,"clay",$post['m2'][1]); $database->setVillageField($village->wid,"clay",$post['m2'][1]);
$database->setVillageField($village->wid,"iron",$post['m2'][2]); $database->setVillageField($village->wid,"iron",$post['m2'][2]);
$database->setVillageField($village->wid,"crop",$post['m2'][3]); $database->setVillageField($village->wid,"crop",$post['m2'][3]);
$database->modifyGold($session->uid,3,0); $database->modifyGold($session->uid,3,0);
header("Location: build.php?id=".$post['id']."&t=3&c");; header("Location: build.php?id=".$post['id']."&t=3&c");;
} else { }
else
{
header("Location: build.php?id=".$post['id']."&t=3"); header("Location: build.php?id=".$post['id']."&t=3");
} }
} else { }
else
{
header("Location: build.php?id=".$post['id']."&t=3"); header("Location: build.php?id=".$post['id']."&t=3");
} }
} }
} }
}; };
$market = new Market; $market = new Market;
?> ?>
+43 -14
View File
@@ -2,8 +2,7 @@
<img class="building g17" src="img/x.gif" alt="Marketplace" title="Marketplace" /> <img class="building g17" src="img/x.gif" alt="Marketplace" title="Marketplace" />
</a> </a>
<h1>Marketplace <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1> <h1>Marketplace <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">At the Marketplace you can trade resources with other players. The higher its level, the more resources can be transported at the same time. <p class="build_desc">At the Marketplace you can trade resources with other players. The higher its level, the more resources can be transported at the same time.</p>
</p>
<?php include("17_menu.tpl"); ?> <?php include("17_menu.tpl"); ?>
<form method="POST" action="build.php"> <form method="POST" action="build.php">
@@ -37,26 +36,53 @@
</td> </td>
<td class="al"> <td class="al">
<?php <?php
if($session->userinfo['alliance'] != 0) { if($session->userinfo['alliance'] != 0)
{
echo "<input class=\"check\" type=\"checkbox\" tabindex=\"7\" name=\"ally\" value=\"1\" /> own alliance only"; echo "<input class=\"check\" type=\"checkbox\" tabindex=\"7\" name=\"ally\" value=\"1\" /> own alliance only";
} }
?> ?>
</td> </td>
</tr> </tr>
</table><p>Merchants: <?php echo $market->merchantAvail(); ?>/<?php echo $market->merchant; ?><p><input type="image" tabindex="8" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" <?php if(!$market->merchantAvail()) { echo "DISABLED"; }?>/></p></form> </table>
<?php <?php
if(count($market->onmarket) > 0) { if(isset($_GET['e1']))
echo "<table id=\"sell_overview\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><th colspan=\"6\">Own offers</th></tr><tr><td>&nbsp;</td><td>Offer</td> {
<td>Search</td><td>Merchants</td><td>Alliance</td><td>Duration</td></tr></thead><tbody>"; echo "<p class=\"error2\">Not enough resources</p>";
foreach($market->onmarket as $offer) { }
if($session->access != BANNED){ elseif(isset($_GET['e2']))
{
echo "<p class=\"error2\">Invalid offer</p>";
}
elseif(isset($_GET['e3']))
{
echo "<p class=\"error2\">Not enough merchants</p>";
}
else
{
echo "<p>Merchants: ".$market->merchantAvail()."/".$market->merchant."</p>";
}
?>
<input type="image" tabindex="8" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" <?php //if(!$market->merchantAvail()) { echo "DISABLED"; }?>/></p>
</form>
<?php
if(count($market->onmarket) > 0)
{
echo "<table id=\"sell_overview\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><th colspan=\"6\">Own offers</th></tr><tr><td>&nbsp;</td><td>Offer</td><td>Search</td><td>Merchants</td><td>Alliance</td><td>Duration</td></tr></thead><tbody>";
foreach($market->onmarket as $offer)
{
if($session->access != BANNED)
{
echo "<tr><td class=\"abo\"><a href=\"build.php?id=$id&t=2&a=5&del=".$offer['id']."\"><img class=\"del\"src=\"img/x.gif\" alt=\"Delete\" title=\"Delete\" /></a></td>"; echo "<tr><td class=\"abo\"><a href=\"build.php?id=$id&t=2&a=5&del=".$offer['id']."\"><img class=\"del\"src=\"img/x.gif\" alt=\"Delete\" title=\"Delete\" /></a></td>";
echo "<td class=\"val\">"; echo "<td class=\"val\">";
}else{ }
else
{
echo "<tr><td class=\"abo\"><a href=\"banned.php\"><img class=\"del\"src=\"img/x.gif\" alt=\"Delete\" title=\"Delete\" /></a></td>"; echo "<tr><td class=\"abo\"><a href=\"banned.php\"><img class=\"del\"src=\"img/x.gif\" alt=\"Delete\" title=\"Delete\" /></a></td>";
echo "<td class=\"val\">"; echo "<td class=\"val\">";
} }
switch($offer['gtype']) { switch($offer['gtype'])
{
case 1: echo "<img src=\"img/x.gif\" class=\"r1\" alt=\"Wood\" title=\"Wood\" />"; break; case 1: echo "<img src=\"img/x.gif\" class=\"r1\" alt=\"Wood\" title=\"Wood\" />"; break;
case 2: echo "<img src=\"img/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" />"; break; case 2: echo "<img src=\"img/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" />"; break;
case 3: echo "<img src=\"img/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" />"; break; case 3: echo "<img src=\"img/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" />"; break;
@@ -64,7 +90,8 @@ if(count($market->onmarket) > 0) {
} }
echo $offer['gamt']; echo $offer['gamt'];
echo "</td><td class=\"val\">"; echo "</td><td class=\"val\">";
switch($offer['wtype']) { switch($offer['wtype'])
{
case 1: echo "<img src=\"img/x.gif\" class=\"r1\" alt=\"Wood\" title=\"Wood\" />"; break; case 1: echo "<img src=\"img/x.gif\" class=\"r1\" alt=\"Wood\" title=\"Wood\" />"; break;
case 2: echo "<img src=\"img/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" />"; break; case 2: echo "<img src=\"img/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" />"; break;
case 3: echo "<img src=\"img/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" />"; break; case 3: echo "<img src=\"img/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" />"; break;
@@ -74,11 +101,13 @@ if(count($market->onmarket) > 0) {
echo "</td><td class=\"tra\">1</td><td class=\"al\">"; echo "</td><td class=\"tra\">1</td><td class=\"al\">";
echo ($offer['alliance'] == 0)? 'No' : 'Yes'; echo ($offer['alliance'] == 0)? 'No' : 'Yes';
echo "</td><td class=\"dur\">"; echo "</td><td class=\"dur\">";
if($offer['maxtime'] != 0) { if($offer['maxtime'] != 0)
{
echo $offer['maxtime']/3600; echo $offer['maxtime']/3600;
echo " hrs."; echo " hrs.";
} }
else { else
{
echo "All"; echo "All";
} }
echo "</td></tr>"; echo "</td></tr>";