Fixed mysql_* calls
Updated skin Fixed minor bugs in shipyard pages display Fixed various bugs in legacy fleet pages source code. Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
This commit is contained in:
parent
be8c6a6629
commit
cfeb6aca6d
68 changed files with 1561 additions and 1451 deletions
514
floten1.php
514
floten1.php
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* Tis file is part of XNova:Legacies
|
||||
* This file is part of XNova:Legacies
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
|
|
@ -31,256 +31,300 @@
|
|||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
require_once dirname(__FILE__) .'/common.php';
|
||||
includeLang('fleet');
|
||||
includeLang('fleet');
|
||||
|
||||
$speed = array(10 => 100,
|
||||
9 => 90,
|
||||
8 => 80,
|
||||
7 => 70,
|
||||
6 => 60,
|
||||
5 => 50,
|
||||
4 => 40,
|
||||
3 => 30,
|
||||
2 => 20,
|
||||
1 => 10,
|
||||
);
|
||||
$speed = array(10 => 100,
|
||||
9 => 90,
|
||||
8 => 80,
|
||||
7 => 70,
|
||||
6 => 60,
|
||||
5 => 50,
|
||||
4 => 40,
|
||||
3 => 30,
|
||||
2 => 20,
|
||||
1 => 10,
|
||||
);
|
||||
|
||||
$g = $_POST['galaxy'];
|
||||
$s = $_POST['system'];
|
||||
$p = $_POST['planet'];
|
||||
$t = $_POST['planet_type'];
|
||||
$user = Legacies_Empire_Model_User::getSingleton();
|
||||
$planetrow = $user->getCurrentPlanet();
|
||||
|
||||
if (!$g) {
|
||||
$g = $planetrow['galaxy'];
|
||||
}
|
||||
if (!$s) {
|
||||
$s = $planetrow['system'];
|
||||
}
|
||||
if (!$p) {
|
||||
$p = $planetrow['planet'];
|
||||
}
|
||||
if (!$t) {
|
||||
$t = $planetrow['planet_type'];
|
||||
}
|
||||
$g = isset($_POST['galaxy']) ? intval($_POST['galaxy']) : 0;
|
||||
$s = isset($_POST['system']) ? intval($_POST['system']) : 0;
|
||||
$p = isset($_POST['planet']) ? intval($_POST['planet']) : 0;
|
||||
$t = isset($_POST['planet_type']) ? intval($_POST['planet_type']) : 0;
|
||||
|
||||
// Verifions si nous avons bien tout ce que nous voullons envoyer
|
||||
$FleetHiddenBlock = "";
|
||||
foreach ($reslist['fleet'] as $n => $i) {
|
||||
if ($i > 200 && $i < 300 && $_POST["ship$i"] > "0") {
|
||||
if ($_POST["ship$i"] > $planetrow[$resource[$i]]) {
|
||||
$page .= $lang['fl_noenought'];
|
||||
$speedalls[$i] = GetFleetMaxSpeed ( "", $i, $user );
|
||||
} else {
|
||||
$fleet['fleetarray'][$i] = $_POST["ship$i"];
|
||||
// Tableau des vaisseaux avec leur nombre
|
||||
$fleet['fleetlist'] .= $i . "," . $_POST["ship$i"] . ";";
|
||||
// Nombre total de vaisseaux
|
||||
$fleet['amount'] += $_POST["ship$i"];
|
||||
// Tableau des vitesses
|
||||
$FleetHiddenBlock .= "<input type=\"hidden\" name=\"consumption". $i ."\" value=\"". GetShipConsumption ( $i, $user ) ."\" />";
|
||||
$FleetHiddenBlock .= "<input type=\"hidden\" name=\"speed". $i ."\" value=\"". GetFleetMaxSpeed ( "", $i, $user ) ."\" />";
|
||||
$FleetHiddenBlock .= "<input type=\"hidden\" name=\"capacity". $i ."\" value=\"". $pricelist[$i]['capacity'] ."\" />";
|
||||
$FleetHiddenBlock .= "<input type=\"hidden\" name=\"ship". $i ."\" value=\"". $_POST["ship$i"] ."\" />";
|
||||
$speedalls[$i] = GetFleetMaxSpeed ( "", $i, $user );
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($g <= 0 || $g > MAX_GALAXY_IN_WORLD) {
|
||||
$g = $planetrow['galaxy'];
|
||||
}
|
||||
if ($s <= 0 || $s > MAX_SYSTEM_IN_GALAXY) {
|
||||
$s = $planetrow['system'];
|
||||
}
|
||||
if ($p <= 0 || $p > MAX_PLANET_IN_SYSTEM) {
|
||||
$p = $planetrow['planet'];
|
||||
}
|
||||
$allowedPlanetTypes = array(
|
||||
Legacies_Empire_Model_Planet::TYPE_PLANET,
|
||||
Legacies_Empire_Model_Planet::TYPE_DEBRIS,
|
||||
Legacies_Empire_Model_Planet::TYPE_MOON
|
||||
);
|
||||
|
||||
if (!$fleet['fleetlist']) {
|
||||
message($lang['fl_unselectall'], $lang['fl_error'], "fleet." . PHPEXT, 1);
|
||||
} else {
|
||||
$speedallsmin = min($speedalls);
|
||||
}
|
||||
$page .= "<script type=\"text/javascript\" src=\"scripts/flotten.js\"></script>";
|
||||
$page .= "<script type=\"text/javascript\">\n";
|
||||
$page .= "function getStorageFaktor() {\n";
|
||||
$page .= " return 1\n";
|
||||
$page .= "}\n";
|
||||
$page .= "</script>\n";
|
||||
$page .= "<form action=\"floten2.php\" method=\"post\">";
|
||||
$page .= $FleetHiddenBlock;
|
||||
$page .= "<input type=\"hidden\" name=\"speedallsmin\" value=\"". $speedallsmin ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"usedfleet\" value=\"". str_rot13(base64_encode(serialize($fleet['fleetarray']))) ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"thisgalaxy\" value=\"". $planetrow['galaxy'] ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"thissystem\" value=\"". $planetrow['system'] ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"thisplanet\" value=\"". $planetrow['planet'] ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"galaxyend\" value=\"". intval($_POST['galaxy']) ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"systemend\" value=\"". intval($_POST['system']) ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"planetend\" value=\"". intval($_POST['planet']) ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"speedfactor\" value=\"". GetGameSpeedFactor () ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"thisplanettype\" value=\"". $planetrow['planet_type'] ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"thisresource1\" value=\"". floor($planetrow['metal']) ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"thisresource2\" value=\"". floor($planetrow['crystal']) ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"thisresource3\" value=\"". floor($planetrow['deuterium']) ."\" />";
|
||||
if (!in_array($t, $allowedPlanetTypes)) {
|
||||
$t = $planet['planet_type'];
|
||||
}
|
||||
|
||||
$page .= "<br><div><center>";
|
||||
$page .= "<table width=\"519\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\">";
|
||||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<td colspan=\"2\" class=\"c\">". $lang['fl_floten1_ttl'] ."</td>";
|
||||
$page .= "</tr>";
|
||||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<th width=\"50%\">". $lang['fl_dest'] ."</th>";
|
||||
$page .= "<th>";
|
||||
$page .= "<input name=\"galaxy\" size=\"3\" maxlength=\"2\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\" value=\"". $g ."\" />";
|
||||
$page .= "<input name=\"system\" size=\"3\" maxlength=\"3\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\" value=\"". $s ."\" />";
|
||||
$page .= "<input name=\"planet\" size=\"3\" maxlength=\"2\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\" value=\"". $p ."\" />";
|
||||
$page .= "<select name=\"planettype\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\">";
|
||||
$page .= "<option value=\"1\"". (($t == 1) ? " SELECTED" : "" ) .">". $lang['fl_planet'] ." </option>";
|
||||
$page .= "<option value=\"2\"". (($t == 2) ? " SELECTED" : "" ) .">". $lang['fl_ruins'] ." </option>";
|
||||
$page .= "<option value=\"3\"". (($t == 3) ? " SELECTED" : "" ) .">". $lang['fl_moon'] ." </option>";
|
||||
$page .= "</select>";
|
||||
$page .= "</th>";
|
||||
$page .= "</tr>";
|
||||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_speed'] ."</th>";
|
||||
$page .= "<th>";
|
||||
$page .= "<select name=\"speed\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\">";
|
||||
foreach ($speed as $a => $b) {
|
||||
$page .= "<option value=\"".$a."\">".$b."</option>";
|
||||
}
|
||||
$page .= "</select> %";
|
||||
$page .= "</th>";
|
||||
$page .= "</tr>";
|
||||
$session = Legacies::getSession('fleet');
|
||||
$session->clearData();
|
||||
$FleetHiddenBlock = "";
|
||||
|
||||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_dist'] ."</th>";
|
||||
$page .= "<th><div id=\"distance\">-</div></th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_fltime'] ."</th>";
|
||||
$page .= "<th><div id=\"duration\">-</div></th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$fleetArray = array();
|
||||
$speedArray = array();
|
||||
$consumptionArray = array();
|
||||
$capacityArray = array();
|
||||
if (isset($_POST['ship']) && is_array($_POST['ship'])) {
|
||||
$selectedShips = $_POST['ship'];
|
||||
}
|
||||
foreach ($reslist[Legacies_Empire::TYPE_SHIP] as $shipId) {
|
||||
if (!isset($selectedShips[$shipId])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$qty = intval($selectedShips[$shipId]);
|
||||
if ($qty <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($qty > $planetrow->getElement($shipId)) {
|
||||
$page .= $lang['fl_noenought'];
|
||||
$speedalls[$shipId] = GetFleetMaxSpeed("", $shipId, $user);
|
||||
} else {
|
||||
$fleetArray[$shipId] = $qty;
|
||||
$session['qty'] += $qty;
|
||||
$speedArray[$shipId] = GetFleetMaxSpeed("", $shipId, $user);
|
||||
$consumptionArray[$shipId] = GetShipConsumption($shipId, $user);
|
||||
$capacityArray[$shipId] = $pricelist[$shipId]['capacity'];
|
||||
|
||||
// Tableau des vitesses
|
||||
$FleetHiddenBlock .= "<input type=\"hidden\" name=\"consumption[". $shipId ."]\" value=\"". GetShipConsumption($shipId, $user) ."\" />";
|
||||
$FleetHiddenBlock .= "<input type=\"hidden\" name=\"speed[". $shipId ."]\" value=\"". GetFleetMaxSpeed("", $shipId, $user) ."\" />";
|
||||
$FleetHiddenBlock .= "<input type=\"hidden\" name=\"capacity[". $shipId ."]\" value=\"". $pricelist[$shipId]['capacity'] ."\" />";
|
||||
$FleetHiddenBlock .= "<input type=\"hidden\" name=\"ship[". $shipId ."]\" value=\"". $qty ."\" />";
|
||||
$speedalls[$shipId] = GetFleetMaxSpeed("", $shipId, $user);
|
||||
}
|
||||
}
|
||||
unset($selectedShips);
|
||||
|
||||
$session['fleet'] = $fleetArray;
|
||||
$session['speed'] = $speedArray;
|
||||
$session['consumption'] = $consumptionArray;
|
||||
$session['capacity'] = $capacityArray;
|
||||
|
||||
if (empty($fleetArray)) {
|
||||
message($lang['fl_unselectall'], $lang['fl_error'], "fleet." . PHPEXT, 1);
|
||||
} else {
|
||||
$speedallsmin = min($speedalls);
|
||||
}
|
||||
|
||||
$speedFactor = GetGameSpeedFactor();
|
||||
$session['speedallsmin'] = $speedallsmin;
|
||||
|
||||
$scriptPath = Legacies::getUrl('scripts/flotten.js');
|
||||
$page .= "<script type=\"text/javascript\" src=\"{$scriptPath}\"></script>";
|
||||
$page .= "<script type=\"text/javascript\">\n";
|
||||
$page .= "function getStorageFaktor() {\n";
|
||||
$page .= " return 1\n";
|
||||
$page .= "}\n";
|
||||
$page .= "</script>\n";
|
||||
$page .= "<form action=\"floten2.php\" method=\"post\">";
|
||||
$page .= $FleetHiddenBlock;
|
||||
$page .= "<input type=\"hidden\" name=\"speedallsmin\" value=\"". $speedallsmin ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"thisgalaxy\" value=\"". $planetrow['galaxy'] ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"thissystem\" value=\"". $planetrow['system'] ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"thisplanet\" value=\"". $planetrow['planet'] ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"galaxyend\" value=\"". $g ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"systemend\" value=\"". $s ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"planetend\" value=\"". $p ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"speedfactor\" value=\"". $speedFactor ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"thisplanettype\" value=\"". $t ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"thisresource1\" value=\"". floor($planetrow['metal']) ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"thisresource2\" value=\"". floor($planetrow['crystal']) ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"thisresource3\" value=\"". floor($planetrow['deuterium']) ."\" />";
|
||||
|
||||
$page .= "<br><div><center>";
|
||||
$page .= "<table width=\"519\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\">";
|
||||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<td colspan=\"2\" class=\"c\">". $lang['fl_floten1_ttl'] ."</td>";
|
||||
$page .= "</tr>";
|
||||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<th width=\"50%\">". $lang['fl_dest'] ."</th>";
|
||||
$page .= "<th>";
|
||||
$page .= "<input name=\"galaxy\" size=\"3\" maxlength=\"2\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\" value=\"". $g ."\" />";
|
||||
$page .= "<input name=\"system\" size=\"3\" maxlength=\"3\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\" value=\"". $s ."\" />";
|
||||
$page .= "<input name=\"planet\" size=\"3\" maxlength=\"2\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\" value=\"". $p ."\" />";
|
||||
$page .= "<select name=\"planettype\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\">";
|
||||
$page .= "<option value=\"1\"". (($t == 1) ? " SELECTED" : "" ) .">". $lang['fl_planet'] ." </option>";
|
||||
$page .= "<option value=\"2\"". (($t == 2) ? " SELECTED" : "" ) .">". $lang['fl_ruins'] ." </option>";
|
||||
$page .= "<option value=\"3\"". (($t == 3) ? " SELECTED" : "" ) .">". $lang['fl_moon'] ." </option>";
|
||||
$page .= "</select>";
|
||||
$page .= "</th>";
|
||||
$page .= "</tr>";
|
||||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_speed'] ."</th>";
|
||||
$page .= "<th>";
|
||||
$page .= "<select name=\"speed\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\">";
|
||||
foreach ($speed as $a => $b) {
|
||||
$page .= "<option value=\"".$a."\">".$b."</option>";
|
||||
}
|
||||
$page .= "</select> %";
|
||||
$page .= "</th>";
|
||||
$page .= "</tr>";
|
||||
|
||||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_dist'] ."</th>";
|
||||
$page .= "<th><div id=\"distance\">-</div></th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_fltime'] ."</th>";
|
||||
$page .= "<th><div id=\"duration\">-</div></th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
/* A faire assez rapidement (faut juste savoir comment)
|
||||
$page .= "<th>". $lang['fl_time_go'] ."</th>";
|
||||
$page .= "<th><font color=\"lime\"><div id=\"llegada1\"><font>". gmdate("H:i:s") ."</font></div></font></th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_time_back'] ."</th>";
|
||||
$page .= "<th><font color=\"lime\"><div id=\"llegada2\"><font>". gmdate("H:i:s") ."</font></div></font></th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_time_go'] ."</th>";
|
||||
$page .= "<th><font color=\"lime\"><div id=\"llegada1\"><font>". gmdate("H:i:s") ."</font></div></font></th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_time_back'] ."</th>";
|
||||
$page .= "<th><font color=\"lime\"><div id=\"llegada2\"><font>". gmdate("H:i:s") ."</font></div></font></th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
*/
|
||||
$page .= "<th>". $lang['fl_deute_need'] ."</th>";
|
||||
$page .= "<th><div id=\"consumption\">-</div></th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_speed_max'] ."</th>";
|
||||
$page .= "<th><div id=\"maxspeed\">-</div></th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_max_load'] ."</th>";
|
||||
$page .= "<th><div id=\"storage\">-</div></th>";
|
||||
$page .= "</tr>";
|
||||
$page .= "<th>". $lang['fl_deute_need'] ."</th>";
|
||||
$page .= "<th><div id=\"consumption\">-</div></th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_speed_max'] ."</th>";
|
||||
$page .= "<th><div id=\"maxspeed\">-</div></th>";
|
||||
$page .= "</tr><tr height=\"20\">";
|
||||
$page .= "<th>". $lang['fl_max_load'] ."</th>";
|
||||
$page .= "<th><div id=\"storage\">-</div></th>";
|
||||
$page .= "</tr>";
|
||||
|
||||
// Gestion des raccourcis sur la galaxie
|
||||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<td colspan=\"2\" class=\"c\">". $lang['fl_shortcut'] ." <a href=\"fleetshortcut.php\">". $lang['fl_shortlnk'] ."</a></td>";
|
||||
$page .= "</tr>";
|
||||
if ($user['fleet_shortcut']) {
|
||||
$scarray = explode("\r\n", $user['fleet_shortcut']);
|
||||
$i = 0;
|
||||
foreach ($scarray as $a => $b) {
|
||||
if ($b != "") {
|
||||
$c = explode(',', $b);
|
||||
if ($i == 0) {
|
||||
$page .= "<tr height=\"20\">";
|
||||
}
|
||||
$page .= "<th><a href=\"javascript:setTarget(". $c[1] .",". $c[2] .",". $c[3] .",". $c[4] ."); shortInfo();\"";
|
||||
$page .= ">". $c[0] ." ". $c[1] .":". $c[2] .":". $c[3] ." ";
|
||||
// Signalisation du type de raccourci ...
|
||||
// (P)lanete
|
||||
// (D)ebris
|
||||
// (L)une
|
||||
if ($c[4] == 1) {
|
||||
$page .= $lang['fl_shrtcup1'];
|
||||
} elseif ($c[4] == 2) {
|
||||
$page .= $lang['fl_shrtcup2'];
|
||||
} elseif ($c[4] == 3) {
|
||||
$page .= $lang['fl_shrtcup3'];
|
||||
}
|
||||
$page .= "</a></th>";
|
||||
if ($i == 1) {
|
||||
$page .= "</tr>";
|
||||
}
|
||||
if ($i == 1) {
|
||||
$i = 0;
|
||||
} else {
|
||||
$i = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($i == 1) {
|
||||
$page .= "<th></th></tr>";
|
||||
}
|
||||
} else {
|
||||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<th colspan=\"2\">". $lang['fl_noshortc'] ."</th>";
|
||||
$page .= "</tr>";
|
||||
}
|
||||
// Gestion des raccourcis sur la galaxie
|
||||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<td colspan=\"2\" class=\"c\">". $lang['fl_shortcut'] ." <a href=\"fleetshortcut.php\">". $lang['fl_shortlnk'] ."</a></td>";
|
||||
$page .= "</tr>";
|
||||
if ($user['fleet_shortcut']) {
|
||||
$scarray = explode("\r\n", $user['fleet_shortcut']);
|
||||
$i = 0;
|
||||
foreach ($scarray as $a => $b) {
|
||||
if ($b != "") {
|
||||
$c = explode(',', $b);
|
||||
if ($i == 0) {
|
||||
$page .= "<tr height=\"20\">";
|
||||
}
|
||||
$page .= "<th><a href=\"javascript:setTarget(". $c[1] .",". $c[2] .",". $c[3] .",". $c[4] ."); shortInfo();\"";
|
||||
$page .= ">". $c[0] ." ". $c[1] .":". $c[2] .":". $c[3] ." ";
|
||||
// Signalisation du type de raccourci ...
|
||||
// (P)lanete
|
||||
// (D)ebris
|
||||
// (L)une
|
||||
if ($c[4] == 1) {
|
||||
$page .= $lang['fl_shrtcup1'];
|
||||
} elseif ($c[4] == 2) {
|
||||
$page .= $lang['fl_shrtcup2'];
|
||||
} elseif ($c[4] == 3) {
|
||||
$page .= $lang['fl_shrtcup3'];
|
||||
}
|
||||
$page .= "</a></th>";
|
||||
if ($i == 1) {
|
||||
$page .= "</tr>";
|
||||
}
|
||||
if ($i == 1) {
|
||||
$i = 0;
|
||||
} else {
|
||||
$i = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($i == 1) {
|
||||
$page .= "<th></th></tr>";
|
||||
}
|
||||
} else {
|
||||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<th colspan=\"2\">". $lang['fl_noshortc'] ."</th>";
|
||||
$page .= "</tr>";
|
||||
}
|
||||
|
||||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<td colspan=\"2\" class=\"c\">". $lang['fl_myplanets'] ."</td>";
|
||||
$page .= "</tr>";
|
||||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<td colspan=\"2\" class=\"c\">". $lang['fl_myplanets'] ."</td>";
|
||||
$page .= "</tr>";
|
||||
|
||||
// Gestion des raccourcis vers ses propres colonies ou planetes
|
||||
$kolonien = SortUserPlanets ( $user );
|
||||
$currentplanet = doquery("SELECT * FROM {{table}} WHERE id = '" . $user['current_planet'] . "'", 'planets', true);
|
||||
// Gestion des raccourcis vers ses propres colonies ou planetes
|
||||
$kolonien = SortUserPlanets ( $user );
|
||||
$currentplanet = doquery("SELECT * FROM {{table}} WHERE id = '" . $user['current_planet'] . "'", 'planets', true);
|
||||
|
||||
if (mysql_num_rows($kolonien) > 1) {
|
||||
$i = 0;
|
||||
$w = 0;
|
||||
$tr = true;
|
||||
while ($row = $kolonien->fetch(PDO::FETCH_BOTH)) {
|
||||
if ($w == 0 && $tr) {
|
||||
$page .= "<tr height=\"20\">";
|
||||
$tr = false;
|
||||
}
|
||||
if ($w == 2) {
|
||||
$page .= "</tr>";
|
||||
$w = 0;
|
||||
$tr = true;
|
||||
}
|
||||
if ($kolonien->rowCount() > 1) {
|
||||
$i = 0;
|
||||
$w = 0;
|
||||
$tr = true;
|
||||
while ($row = $kolonien->fetch(PDO::FETCH_BOTH)) {
|
||||
if ($w == 0 && $tr) {
|
||||
$page .= "<tr height=\"20\">";
|
||||
$tr = false;
|
||||
}
|
||||
if ($w == 2) {
|
||||
$page .= "</tr>";
|
||||
$w = 0;
|
||||
$tr = true;
|
||||
}
|
||||
|
||||
if ($row['planet_type'] == 3) {
|
||||
$row['name'] .= " ". $lang['fl_shrtcup3'];
|
||||
}
|
||||
if ($row['planet_type'] == 3) {
|
||||
$row['name'] .= " ". $lang['fl_shrtcup3'];
|
||||
}
|
||||
|
||||
if ($currentplanet['galaxy'] == $row['galaxy'] &&
|
||||
$currentplanet['system'] == $row['system'] &&
|
||||
$currentplanet['planet'] == $row['planet'] &&
|
||||
$currentplanet['planet_type'] == $row['planet_type'] ) {
|
||||
// $page .= '<th><a href="javascript:setTarget('.$row['galaxy'].','.$row['system'].','.$row['planet'].','.$row['planet_type'].'); shortInfo();">'.$row['name'].' '.$row['galaxy'].':'.$row['system'].':'.$row['planet'].'</a></th>';
|
||||
} else {
|
||||
$page .= "<th><a href=\"javascript:setTarget(". $row['galaxy'] .",". $row['system'] .",". $row['planet'] .",". $row['planet_type'] ."); shortInfo();\">". $row['name'] ." ". $row['galaxy'] .":". $row['system'] .":". $row['planet'] ."</a></th>";
|
||||
$w++;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
if ($currentplanet['galaxy'] == $row['galaxy'] &&
|
||||
$currentplanet['system'] == $row['system'] &&
|
||||
$currentplanet['planet'] == $row['planet'] &&
|
||||
$currentplanet['planet_type'] == $row['planet_type'] ) {
|
||||
// $page .= '<th><a href="javascript:setTarget('.$row['galaxy'].','.$row['system'].','.$row['planet'].','.$row['planet_type'].'); shortInfo();">'.$row['name'].' '.$row['galaxy'].':'.$row['system'].':'.$row['planet'].'</a></th>';
|
||||
} else {
|
||||
$page .= "<th><a href=\"javascript:setTarget(". $row['galaxy'] .",". $row['system'] .",". $row['planet'] .",". $row['planet_type'] ."); shortInfo();\">". $row['name'] ." ". $row['galaxy'] .":". $row['system'] .":". $row['planet'] ."</a></th>";
|
||||
$w++;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($i % 2 != 0) {
|
||||
$page .= "<th> </th></tr>";
|
||||
} elseif ($w == 2) {
|
||||
$page .= "</tr>";
|
||||
}
|
||||
} else {
|
||||
$page .= "<th colspan=\"2\">". $lang['fl_nocolonies'] ."</th>";
|
||||
}
|
||||
if ($i % 2 != 0) {
|
||||
$page .= "<th> </th></tr>";
|
||||
} elseif ($w == 2) {
|
||||
$page .= "</tr>";
|
||||
}
|
||||
} else {
|
||||
$page .= "<th colspan=\"2\">". $lang['fl_nocolonies'] ."</th>";
|
||||
}
|
||||
|
||||
$page .= "</tr>";
|
||||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<td colspan=\"2\" class=\"c\">". $lang['fl_grattack'] ."</td>";
|
||||
$page .= "</tr>";
|
||||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<th colspan=\"2\">-</th>";
|
||||
$page .= "</tr>";
|
||||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<th colspan=\"2\"><input type=\"submit\" value=\"". $lang['fl_continue'] ."\" /></th>";
|
||||
$page .= "</tr>";
|
||||
$page .= "</table>";
|
||||
$page .= "</div></center>";
|
||||
$page .= "<input type=\"hidden\" name=\"maxepedition\" value=\"". $_POST['maxepedition'] ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"curepedition\" value=\"". $_POST['curepedition'] ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"target_mission\" value=\"". $target_mission ."\" />";
|
||||
$page .= "</form>";
|
||||
$page .= "<script>javascript:shortInfo(); </script>";
|
||||
$page .= "</tr>";
|
||||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<td colspan=\"2\" class=\"c\">". $lang['fl_grattack'] ."</td>";
|
||||
$page .= "</tr>";
|
||||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<th colspan=\"2\">-</th>";
|
||||
$page .= "</tr>";
|
||||
$page .= "<tr height=\"20\">";
|
||||
$page .= "<th colspan=\"2\"><input type=\"submit\" value=\"". $lang['fl_continue'] ."\" /></th>";
|
||||
$page .= "</tr>";
|
||||
$page .= "</table>";
|
||||
$page .= "</div></center>";
|
||||
|
||||
display($page, $lang['fl_title']);
|
||||
$maxExpedition = $user->getElement(Legacies_Empire::ID_RESEARCH_EXPEDITION_TECHNOLOGY);
|
||||
$ExpeditionEnCours = 0;
|
||||
$EnvoiMaxExpedition = 0;
|
||||
if ($maxExpedition >= 1) {
|
||||
$maxexpde = doquery("SELECT 1 FROM {{table}} WHERE `fleet_owner` = '".$user['id']."' AND `fleet_mission` = '15';", 'fleets');
|
||||
$ExpeditionEnCours = $maxexpde->rowCount();
|
||||
$maxexpde->closeCursor();
|
||||
|
||||
$EnvoiMaxExpedition = 1 + floor($maxExpedition / 3);
|
||||
}
|
||||
$page .= "<input type=\"hidden\" name=\"maxepedition\" value=\"". $maxExpedition ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"curepedition\" value=\"". $ExpeditionEnCours ."\" />";
|
||||
$page .= "<input type=\"hidden\" name=\"target_mission\" value=\"". $target_mission ."\" />";
|
||||
$page .= "</form>";
|
||||
$page .= "<script>javascript:shortInfo(); </script>";
|
||||
|
||||
display($page, $lang['fl_title']);
|
||||
|
||||
// Updated by Chlorel. 16 Jan 2008 (String extraction, bug corrections, code uniformisation
|
||||
// Created by Perberos. All rights reversed (C) 2006
|
||||
?>
|
||||
|
|
|
|||
Loading…
Reference in a new issue