GwynnBleiidd - там не отображалась стата : кто сколько и как отрейдил
1) includes/functions/missioncaseattack.php
<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">
Скрытая информация:
файл <input type="button" value="Показать" style="width:60px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Скрыть'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Показать'; }">
</div>
<div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;">
<div style="display: none;">
<?php
/**
* MissionCaseAttack.php
*
* @version 1.0
* @copyright 2008 By Chorel for XNova
*/
// ----------------------------------------------------------------------------------------------------------------
// Mission Case 1: -> Attaquer
//
function MissionCaseAttack ( $FleetRow ) {
global $user, $phpEx, $ugamela_root_path, $pricelist, $lang, $resource, $CombatCaps;
if ($FleetRow['fleet_start_time'] <= time()) {
if ($FleetRow['fleet_mess'] == 0) {
if (!isset($CombatCaps[202]['sd'])) {
message("<font color=\"red\">". $lang['sys_no_vars'] ."</font>", $lang['sys_error'], "fleet." . $phpEx, 2);
}
$QryTargetPlanet = "SELECT * FROM {{table}} ";
$QryTargetPlanet .= "WHERE ";
$QryTargetPlanet .= "`galaxy` = '". $FleetRow['fleet_end_galaxy'] ."' AND ";
$QryTargetPlanet .= "`system` = '". $FleetRow['fleet_end_system'] ."' AND ";
$QryTargetPlanet .= "`planet` = '". $FleetRow['fleet_end_planet'] ."' AND ";
$QryTargetPlanet .= "`planet_type` = '". $FleetRow['fleet_end_type'] ."';";
$TargetPlanet = doquery( $QryTargetPlanet, 'planets', true);
$TargetUserID = $TargetPlanet['id_owner'];
$QryCurrentUser = "SELECT * FROM {{table}} ";
$QryCurrentUser .= "WHERE ";
$QryCurrentUser .= "`id` = '". $FleetRow['fleet_owner'] ."';";
$CurrentUser = doquery($QryCurrentUser , 'users', true);
$CurrentUserID = $CurrentUser['id'];
$QryTargetUser = "SELECT * FROM {{table}} ";
$QryTargetUser .= "WHERE ";
$QryTargetUser .= "`id` = '". $TargetUserID ."';";
$TargetUser = doquery($QryTargetUser, 'users', true);
$QryTargetTech = "SELECT ";
$QryTargetTech .= "`military_tech`, `defence_tech`, `shield_tech` ";
$QryTargetTech .= "FROM {{table}} ";
$QryTargetTech .= "WHERE ";
$QryTargetTech .= "`id` = '". $TargetUserID ."';";
$TargetTechno = doquery($QryTargetTech, 'users', true);
$QryCurrentTech = "SELECT ";
$QryCurrentTech .= "`military_tech`, `defence_tech`, `shield_tech` ";
$QryCurrentTech .= "FROM {{table}} ";
$QryCurrentTech .= "WHERE ";
$QryCurrentTech .= "`id` = '". $CurrentUserID ."';";
$CurrentTechno = doquery($QryCurrentTech, 'users', true);
for ($SetItem = 200; $SetItem < 500; $SetItem++) {
if ($TargetPlanet[$resource[$SetItem]] > 0) {
$TargetSet[$SetItem]['count'] = $TargetPlanet[$resource[$SetItem]];
}
}
$TheFleet = explode(";", $FleetRow['fleet_array']);
foreach($TheFleet as $a => $b) {
if ($b != '') {
$a = explode(",", $b);
$CurrentSet[$a[0]]['count'] = $a[1];
}
}
include_once($ugamela_root_path . 'includes/ataki.' . $phpEx);
// Calcul de la duree de traitement (initialisation)
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
$walka = walka($CurrentSet, $TargetSet, $CurrentTechno, $TargetTechno);
// Calcul de la duree de traitement (calcul)
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = ($endtime - $starttime);
// Ce qu'il reste de l'attaquant
$CurrentSet = $walka["atakujacy"];
// Ce qu'il reste de l'attaquГ©
$TargetSet = $walka["wrog"];
// Le resultat de la bataille
$FleetResult = $walka["wygrana"];
// Rapport long (rapport de bataille detaillГ©)
$dane_do_rw = $walka["dane_do_rw"];
// Rapport court (cdr + unitГ©es perdues)
$zlom = $walka["zlom"];
$FleetArray = "";
$FleetAmount = 0;
$FleetStorage = 0;
foreach ($CurrentSet as $Ship => $Count) {
$FleetStorage += $pricelist[$Ship]["capacity"] * $Count['count'];
$FleetArray .= $Ship.",".$Count['count'].";";
$FleetAmount += $Count['count'];
}
// Au cas ou le p'tit rigolo qu'a envoyГ© la flotte y avait mis des ressources ...
$FleetStorage -= $FleetRow["fleet_resource_metal"];
$FleetStorage -= $FleetRow["fleet_resource_crystal"];
$FleetStorage -= $FleetRow["fleet_resource_deuterium"];
$TargetPlanetUpd = "";
if (!is_null($TargetSet)) {
foreach($TargetSet as $Ship => $Count) {
$TargetPlanetUpd .= "`". $resource[$Ship] ."` = '". $Count['count'] ."', ";
}
}
// Determination des ressources pillГ©es
$Mining['metal'] = 0;
$Mining['crystal'] = 0;
$Mining['deuter'] = 0;
if ($FleetResult == "a") {
if ($FleetStorage > 0) {
$metal = $TargetPlanet['metal'] / 2;
$crystal = $TargetPlanet['crystal'] / 2;
$deuter = $TargetPlanet["deuterium"] / 2;
if (($metal) > $FleetStorage / 3) {
$Mining['metal'] = $FleetStorage / 3;
$FleetStorage = $FleetStorage - $Mining['metal'];
} else {
$Mining['metal'] = $metal;
$FleetStorage = $FleetStorage - $Mining['metal'];
}
if (($crystal) > $FleetStorage / 2) {
$Mining['crystal'] = $FleetStorage / 2;
$FleetStorage = $FleetStorage - $Mining['crystal'];
} else {
$Mining['crystal'] = $crystal;
$FleetStorage = $FleetStorage - $Mining['crystal'];
}
if (($deuter) > $FleetStorage) {
$Mining['deuter'] = $FleetStorage;
$FleetStorage = $FleetStorage - $Mining['deuter'];
} else {
$Mining['deuter'] = $deuter;
$FleetStorage = $FleetStorage - $Mining['deuter'];
}
}
}
$Mining['metal'] = round($Mining['metal']);
$Mining['crystal'] = round($Mining['crystal']);
$Mining['deuter'] = round($Mining['deuter']);
// Mise a jour de l'enregistrement de la planete attaquГ©e
$QryUpdateTarget = "UPDATE {{table}} SET ";
$QryUpdateTarget .= $TargetPlanetUpd;
$QryUpdateTarget .= "`metal` = `metal` - '". $Mining['metal'] ."', ";
$QryUpdateTarget .= "`crystal` = `crystal` - '". $Mining['crystal'] ."', ";
$QryUpdateTarget .= "`deuterium` = `deuterium` - '". $Mining['deuter'] ."' ";
$QryUpdateTarget .= "WHERE ";
$QryUpdateTarget .= "`galaxy` = '". $FleetRow['fleet_end_galaxy'] ."' AND ";
$QryUpdateTarget .= "`system` = '". $FleetRow['fleet_end_system'] ."' AND ";
$QryUpdateTarget .= "`planet` = '". $FleetRow['fleet_end_planet'] ."' AND ";
$QryUpdateTarget .= "`planet_type` = '". $FleetRow['fleet_end_type'] ."' ";
$QryUpdateTarget .= "LIMIT 1;";
doquery( $QryUpdateTarget , 'planets');
// Ajout du petit point raideur
$AddPoint = $CurrentUser['xpraid'] + 1;
$AddPoint2 = $TargetUser['xpraid'] + 1;
$QryUpdateOfficier = "UPDATE {{table}} SET ";
$QryUpdateOfficier .= "`xpraid` = '" . $AddPoint . "' ";
$QryUpdateOfficier .= "WHERE id = '" . $CurrentUserID . "' ";
$QryUpdateOfficier .= "LIMIT 1 ;";
doquery($QryUpdateOfficier, 'users');
$QryUpdateOfficier2 = "UPDATE {{table}} SET ";
$QryUpdateOfficier2 .= "`xpraid` = '" . $AddPoint2 . "' ";
$QryUpdateOfficier2 .= "WHERE id = '" . $TargetUserID . "' ";
$QryUpdateOfficier2 .= "LIMIT 1 ;";
doquery($QryUpdateOfficier2, 'users');
// Ajout d'un point au compteur de raids
$RaidsTotal = $CurrentUser['raids'] + 1;
$RaidsTotal2 = $TargetUser['raids'] + 1;
if ($FleetResult == "a") {
$RaidsWin = $CurrentUser['raidswin'] + 1;
$QryUpdateRaidsCompteur = "UPDATE {{table}} SET ";
$QryUpdateRaidsCompteur .= "`raidswin` ='" . $RaidsWin . "', ";
$QryUpdateRaidsCompteur .= "`raids` ='" . $RaidsTotal . "' ";
$QryUpdateRaidsCompteur .= "WHERE id = '" . $CurrentUserID . "' ";
$QryUpdateRaidsCompteur .= "LIMIT 1 ;";
doquery($QryUpdateRaidsCompteur, 'users');
$RaidsLoose2 = $TargetUser['raidsloose'] + 1;
$QryUpdateRaidsCompteur2 = "UPDATE {{table}} SET ";
$QryUpdateRaidsCompteur2 .= "`raidsloose` ='" . $RaidsLoose2 . "', ";
$QryUpdateRaidsCompteur2 .= "`raids` ='" . $RaidsTotal2 . "' ";
$QryUpdateRaidsCompteur2 .= "WHERE id = '" . $TargetUserID . "' ";
$QryUpdateRaidsCompteur2 .= "LIMIT 1 ;";
doquery($QryUpdateRaidsCompteur2, 'users');
} elseif ($FleetResult == "w") {
$RaidsLoose = $CurrentUser['raidsloose'] + 1;
$QryUpdateRaidsCompteur = "UPDATE {{table}} SET ";
$QryUpdateRaidsCompteur .= "`raidsloose` ='" . $RaidsLoose . "', ";
$QryUpdateRaidsCompteur .= "`raids` ='" . $RaidsTotal . "' ";
$QryUpdateRaidsCompteur .= "WHERE id = '" . $CurrentUserID . "' ";
$QryUpdateRaidsCompteur .= "LIMIT 1 ;";
doquery($QryUpdateRaidsCompteur, 'users');
$RaidsWin2 = $TargetUser['raidswin'] + 1;
$QryUpdateRaidsCompteur2 = "UPDATE {{table}} SET ";
$QryUpdateRaidsCompteur2 .= "`raidswin` ='" . $RaidsWin2 . "', ";
$QryUpdateRaidsCompteur2 .= "`raids` ='" . $RaidsTotal2 . "' ";
$QryUpdateRaidsCompteur2 .= "WHERE id = '" . $TargetUserID . "' ";
$QryUpdateRaidsCompteur2 .= "LIMIT 1 ;";
doquery($QryUpdateRaidsCompteur2, 'users');
} elseif ($FleetResult == "r"){
$RaidsDraw = $CurrentUser['raidsdraw'] + 1;
$QryUpdateRaidsCompteur = "UPDATE {{table}} SET ";
$QryUpdateRaidsCompteur .= "`raidsdraw` ='" . $RaidsDraw . "', ";
$QryUpdateRaidsCompteur .= "`raids` ='" . $RaidsTotal . "' ";
$QryUpdateRaidsCompteur .= "WHERE id = '" . $CurrentUserID . "' ";
$QryUpdateRaidsCompteur .= "LIMIT 1 ;";
doquery($QryUpdateRaidsCompteur, 'users');
$RaidsDraw2 = $TargetUser['raidsdraw'] + 1;
$QryUpdateRaidsCompteur2 = "UPDATE {{table}} SET ";
$QryUpdateRaidsCompteur2 .= "`raidsdraw` ='" . $RaidsDraw2 . "', ";
$QryUpdateRaidsCompteur2 .= "`raids` ='" . $RaidsTotal2 . "' ";
$QryUpdateRaidsCompteur2 .= "WHERE id = '" . $TargetUserID . "' ";
$QryUpdateRaidsCompteur2 .= "LIMIT 1 ;";
doquery($QryUpdateRaidsCompteur2, 'users');
}
// Mise a jour du champ de ruine devant la planete attaquГ©e
$QryUpdateGalaxy = "UPDATE {{table}} SET ";
$QryUpdateGalaxy .= "`metal` = `metal` + '". $zlom['metal'] ."', ";
$QryUpdateGalaxy .= "`crystal` = `crystal` + '". $zlom['crystal'] ."' ";
$QryUpdateGalaxy .= "WHERE ";
$QryUpdateGalaxy .= "`galaxy` = '". $FleetRow['fleet_end_galaxy'] ."' AND ";
$QryUpdateGalaxy .= "`system` = '". $FleetRow['fleet_end_system'] ."' AND ";
$QryUpdateGalaxy .= "`planet` = '". $FleetRow['fleet_end_planet'] ."' ";
$QryUpdateGalaxy .= "LIMIT 1;";
doquery( $QryUpdateGalaxy , 'galaxy');
// LГ on va discuter le bout de gras pour voir s'il y a moyen d'avoir une Lune !
$FleetDebris = $zlom['metal'] + $zlom['crystal'];
$StrAttackerUnits = sprintf ($lang['sys_attacker_lostunits'], $zlom["atakujacy"]);
$StrDefenderUnits = sprintf ($lang['sys_defender_lostunits'], $zlom["wrog"]);
$StrRuins = sprintf ($lang['sys_gcdrunits'], $zlom["metal"], $lang['Metal'], $zlom['crystal'], $lang['Crystal']);
$DebrisField = $StrAttackerUnits ."
". $StrDefenderUnits ."
". $StrRuins;
$MoonChance = $FleetDebris / 100000;
if ($FleetDebris > 2000000) {
$MoonChance = 20;
}
if ($FleetDebris < 100000) {
$UserChance = 0;
$ChanceMoon = "";
} elseif ($FleetDebris >= 100000) {
$UserChance = mt_rand(1, 100);
$ChanceMoon = sprintf ($lang['sys_moonproba'], $MoonChance);
}
if (($UserChance > 0) and ($UserChance <= $MoonChance) and $galenemyrow['id_luna'] == 0) {
$TargetPlanetName = CreateOneMoonRecord ( $FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet'], $TargetUserID, $FleetRow['fleet_start_time'], '', $MoonChance );
$GottenMoon = sprintf ($lang['sys_moonbuilt'], $TargetPlanetName, $FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet']);
} elseif ($UserChance = 0 or $UserChance > $MoonChance) {
$GottenMoon = "";
}
$AttackDate = date("r", $FleetRow["fleet_start_time"]);
$title = sprintf ($lang['sys_attack_title'], $AttackDate);
$raport = "<center><table><tr><td>". $title ."
";
$zniszczony = false;
$a_zestrzelona = 0;
$AttackTechon['A'] = $CurrentTechno["military_tech"] * 10;
$AttackTechon['B'] = $CurrentTechno["defence_tech"] * 10;
$AttackTechon['C'] = $CurrentTechno["shield_tech"] * 10;
$AttackerData = sprintf ($lang['sys_attack_attacker_pos'], $CurrentUser["username"], $FleetRow['fleet_start_galaxy'], $FleetRow['fleet_start_system'], $FleetRow['fleet_start_planet'] );
$AttackerTech = sprintf ($lang['sys_attack_techologies'], $AttackTechon['A'], $AttackTechon['B'], $AttackTechon['C']);
$DefendTechon['A'] = $TargetTechno["military_tech"] * 10;
$DefendTechon['B'] = $TargetTechno["defence_tech"] * 10;
$DefendTechon['C'] = $TargetTechno["shield_tech"] * 10;
$DefenderData = sprintf ($lang['sys_attack_defender_pos'], $TargetUser["username"], $FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet'] );
$DefenderTech = sprintf ($lang['sys_attack_techologies'], $DefendTechon['A'], $DefendTechon['B'], $DefendTechon['C']);
foreach ($dane_do_rw as $a => $b) {
$raport .= "<table border=1 width=100%><tr><th>
<center>".$AttackerData."
".$AttackerTech."<table border=1>";
if ($b["atakujacy"]['count'] > 0) {
$raport1 = "<tr><th>".$lang['sys_ship_type']."</th>";
$raport2 = "<tr><th>".$lang['sys_ship_count']."</th>";
$raport3 = "<tr><th>".$lang['sys_ship_weapon']."</th>";
$raport4 = "<tr><th>".$lang['sys_ship_shield']."</th>";
$raport5 = "<tr><th>".$lang['sys_ship_armour']."</th>";
foreach ($b["atakujacy"] as $Ship => $Data) {
if (is_numeric($Ship)) {
if ($Data['count'] > 0) {
$raport1 .= "<th>". $lang["tech_rc"][$Ship] ."</th>";
$raport2 .= "<th>". $Data['count'] ."</th>";
$raport3 .= "<th>". round($Data["atak"] / $Data['count']) ."</th>";
$raport4 .= "<th>". round($Data["tarcza"] / $Data['count']) ."</th>";
$raport5 .= "<th>". round($Data["obrona"] / $Data['count']) ."</th>";
}
}
}
$raport1 .= "</tr>";
$raport2 .= "</tr>";
$raport3 .= "</tr>";
$raport4 .= "</tr>";
$raport5 .= "</tr>";
$raport .= $raport1 . $raport2 . $raport3 . $raport4 . $raport5;
} else {
if ($a == 2) {
$a_zestrzelona = 1;
}
$zniszczony = true;
$raport .= "
". $lang['sys_destroyed'];
}
$raport .= "</table></center></th></tr></table>";
$raport .= "<table border=1 width=100%><tr><th>
<center>".$DefenderData."
".$DefenderTech."<table border=1>";
if ($b["wrog"]['count'] > 0) {
$raport1 = "<tr><th>".$lang['sys_ship_type']."</th>";
$raport2 = "<tr><th>".$lang['sys_ship_count']."</th>";
$raport3 = "<tr><th>".$lang['sys_ship_weapon']."</th>";
$raport4 = "<tr><th>".$lang['sys_ship_shield']."</th>";
$raport5 = "<tr><th>".$lang['sys_ship_armour']."</th>";
foreach ($b["wrog"] as $Ship => $Data) {
if (is_numeric($Ship)) {
if ($Data['count'] > 0) {
$raport1 .= "<th>". $lang["tech_rc"][$Ship] ."</th>";
$raport2 .= "<th>". $Data['count'] ."</th>";
$raport3 .= "<th>". round($Data["atak"] / $Data['count']) ."</th>";
$raport4 .= "<th>". round($Data["tarcza"] / $Data['count']) ."</th>";
$raport5 .= "<th>". round($Data["obrona"] / $Data['count']) ."</th>";
}
}
}
$raport1 .= "</tr>";
$raport2 .= "</tr>";
$raport3 .= "</tr>";
$raport4 .= "</tr>";
$raport5 .= "</tr>";
$raport .= $raport1 . $raport2 . $raport3 . $raport4 . $raport5;
} else {
$zniszczony = true;
$raport .= "
". $lang['sys_destroyed'];
}
$raport .= "</table></center></th></tr></table>";
if (($zniszczony == false) and !($a == 8)) {
$AttackWaveStat = sprintf ($lang['sys_attack_attack_wave'], floor($b["atakujacy"]["atak"]), floor($b["wrog"]["tarcza"]));
$DefendWavaStat = sprintf ($lang['sys_attack_defend_wave'], floor($b["wrog"]["atak"]), floor($b["atakujacy"]["tarcza"]));
$raport .= "
<center>".$AttackWaveStat."
".$DefendWavaStat."</center>";
}
}
switch ($FleetResult) {
case "a":
$Pillage = sprintf ($lang['sys_stealed_ressources'], $Mining['metal'], $lang['metal'], $Mining['crystal'], $lang['crystal'], $Mining['deuter'], $lang['Deuterium']);
$raport .= $lang['sys_attacker_won'] ."
". $Pillage ."
";
$raport .= $DebrisField ."
";
$raport .= $ChanceMoon ."
";
$raport .= $GottenMoon ."
";
break;
case "r":
$raport .= $lang['sys_both_won'] ."
";
$raport .= $DebrisField ."
";
$raport .= $ChanceMoon ."
";
$raport .= $GottenMoon ."
";
break;
case "w":
$raport .= $lang['sys_defender_won'] ."
";
$raport .= $DebrisField ."
";
$raport .= $ChanceMoon ."
";
$raport .= $GottenMoon ."
";
doquery("DELETE FROM {{table}} WHERE `fleet_id` = '". $FleetRow["fleet_id"] ."';", 'fleets');
break;
default:
break;
}
$SimMessage = sprintf ($lang['sys_rapport_build_time'], $totaltime);
$raport .= $SimMessage ."</table>";
$dpath = (!$user["dpath"]) ? DEFAULT_SKINPATH : $user["dpath"];
$rid = md5($raport);
$QryInsertRapport = "INSERT INTO {{table}} SET ";
$QryInsertRapport .= "`time` = UNIX_TIMESTAMP(), ";
$QryInsertRapport .= "`id_owner1` = '". $FleetRow['fleet_owner'] ."', ";
$QryInsertRapport .= "`id_owner2` = '". $TargetUserID ."', ";
$QryInsertRapport .= "`rid` = '". $rid ."', ";
$QryInsertRapport .= "`a_zestrzelona` = '". $a_zestrzelona ."', ";
$QryInsertRapport .= "`raport` = '". addslashes ( $raport ) ."';";
doquery( $QryInsertRapport , 'rw');
// Colorisation du rГ©sumГ© de rapport pour l'attaquant
$raport = "<a href # onClick=\"f( 'rw.php?raport=". $rid ."', '');\" >";
$raport .= "<center>";
if ($FleetResult == "a") {
$raport .= "<font color=\"green\">";
} elseif ($FleetResult == "r") {
$raport .= "<font color=\"orange\">";
} elseif ($FleetResult == "w") {
$raport .= "<font color=\"red\">";
}
$raport .= $lang['sys_mess_attack_report'] ." [". $FleetRow['fleet_end_galaxy'] .":". $FleetRow['fleet_end_system'] .":". $FleetRow['fleet_end_planet'] ."] </font></a>
";
$raport .= "<font color=\"red\">". $lang['sys_perte_attaquant'] .": ". $zlom["atakujacy"] ."</font>";
$raport .= "<font color=\"green\"> ". $lang['sys_perte_defenseur'] .":". $zlom["wrog"] ."</font>
" ;
$raport .= $lang['sys_gain'] ." ". $lang['Metal'] .":<font color=\"#adaead\">". $Mining['metal'] ."</font> ". $lang['Crystal'] .":<font color=\"#ef51ef\">". $Mining['crystal'] ."</font> ". $lang['Deuterium'] .":<font color=\"#f77542\">". $Mining['deuter'] ."</font>
";
$raport .= $lang['sys_debris'] ." ". $lang['Metal'] .":<font color=\"#adaead\">". $zlom['metal'] ."</font> ". $lang['Crystal'] .":<font color=\"#ef51ef\">". $zlom['crystal'] ."</font>
</center>";
$Mining['metal'] = $Mining['metal'] + $FleetRow["fleet_resource_metal"];
$Mining['crystal'] = $Mining['crystal'] + $FleetRow["fleet_resource_crystal"];
$Mining['deuter'] = $Mining['deuter'] + $FleetRow["fleet_resource_deuterium"];
$QryUpdateFleet = "UPDATE {{table}} SET ";
$QryUpdateFleet .= "`fleet_amount` = '". $FleetAmount ."', ";
$QryUpdateFleet .= "`fleet_array` = '". $FleetArray ."', ";
$QryUpdateFleet .= "`fleet_mess` = '1', ";
$QryUpdateFleet .= "`fleet_resource_metal` = '". $Mining['metal'] ."', ";
$QryUpdateFleet .= "`fleet_resource_crystal` = '". $Mining['crystal'] ."', ";
$QryUpdateFleet .= "`fleet_resource_deuterium` = '". $Mining['deuter'] ."' ";
$QryUpdateFleet .= "WHERE fleet_id = '". $FleetRow['fleet_id'] ."' ";
$QryUpdateFleet .= "LIMIT 1 ;";
doquery( $QryUpdateFleet , 'fleets');
SendSimpleMessage ( $CurrentUserID, '', $FleetRow['fleet_start_time'], 3, $lang['sys_mess_tower'], $lang['sys_mess_attack_report'], $raport );
// Colorisation du rГ©sumГ© de rapport pour l'attaquant
$raport2 = "<a href # onClick=\"f( 'rw.php?raport=". $rid ."', '');\" >";
$raport2 .= "<center>";
if ($FleetResult == "a") {
$raport2 .= "<font color=\"green\">";
} elseif ($FleetResult == "r") {
$raport2 .= "<font color=\"orange\">";
} elseif ($FleetResult == "w") {
$raport2 .= "<font color=\"red\">";
}
$raport2 .= $lang['sys_mess_attack_report'] ." [". $FleetRow['fleet_end_galaxy'] .":". $FleetRow['fleet_end_system'] .":". $FleetRow['fleet_end_planet'] ."] </font></a>
";
SendSimpleMessage ( $TargetUserID, '', $FleetRow['fleet_start_time'], 3, $lang['sys_mess_tower'], $lang['sys_mess_attack_report'], $raport2 );
}
// Retour de flotte (s'il en reste)
$fquery = "";
if ($FleetRow['fleet_end_time'] <= time()) {
if (!is_null($CurrentSet)) {
foreach($CurrentSet as $Ship => $Count) {
$fquery .= "`". $resource[$Ship] ."` = `". $resource[$Ship] ."` + '". $Count['count'] ."', ";
}
} else {
$fleet = explode(";", $FleetRow['fleet_array']);
foreach($fleet as $a => $b) {
if ($b != '') {
$a = explode(",", $b);
$fquery .= "{$resource[$a[0]]}={$resource[$a[0]]} + {$a[1]}, \n";
}
}
}
doquery ("DELETE FROM {{table}} WHERE `fleet_id` = " . $FleetRow["fleet_id"], 'fleets');
if (!($FleetResult == "w")) {
$QryUpdatePlanet = "UPDATE {{table}} SET ";
$QryUpdatePlanet .= $fquery;
$QryUpdatePlanet .= "`metal` = `metal` + ". $FleetRow['fleet_resource_metal'] .", ";
$QryUpdatePlanet .= "`crystal` = `crystal` + ". $FleetRow['fleet_resource_crystal'] .", ";
$QryUpdatePlanet .= "`deuterium` = `deuterium` + ". $FleetRow['fleet_resource_deuterium'] ." ";
$QryUpdatePlanet .= "WHERE ";
$QryUpdatePlanet .= "`galaxy` = ".$FleetRow['fleet_start_galaxy']." AND ";
$QryUpdatePlanet .= "`system` = ".$FleetRow['fleet_start_system']." AND ";
$QryUpdatePlanet .= "`planet` = ".$FleetRow['fleet_start_planet']." AND ";
$QryUpdatePlanet .= "`planet_type` = ".$FleetRow['fleet_start_type']." LIMIT 1 ;";
doquery( $QryUpdatePlanet, 'planets' );
}
}
}
}
?>
</div>
</div>
</div>
2) overview.php
добавляем это -
<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">
Скрытая информация:
далее <input type="button" value="Показать" style="width:60px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Скрыть'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Показать'; }">
</div>
<div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;">
<div style="display: none;">
// Nombre de raids, pertes, etc ...
$parse['Raids'] = $lang['Raids'];
$parse['NumberOfRaids'] = $lang['NumberOfRaids'];
$parse['RaidsWin'] = $lang['RaidsWin'];
$parse['RaidsLoose'] = $lang['RaidsLoose'];
$parse['raids'] = $user['raids'];
$parse['raidswin'] = $user['raidswin'];
$parse['raidsloose'] = $user['raidsloose'];
</div>
</div>
</div>
2.1 добавляем еще
<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">
Скрытая информация:
дубль2 <input type="button" value="Показать" style="width:60px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Скрыть'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Показать'; }">
</div>
<div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;">
<div style="display: none;">
// --- Gestion Officiers -------------------------------------------------------------------------
// Passage au niveau suivant, ajout du point de compГ©tence et affichage du passage au nouveau level
$XpMinierUp = $user['lvl_minier'] * 100000;
$XpRaidUp = $user['lvl_raid'] * 30;
$XpMinier = $user['xpminier'];
$XPRaid = $user['xpraid'];
$LvlUpMinier = $user['lvl_minier'] + 1;
$LvlUpRaid = $user['lvl_raid'] + 1;
if( ($LvlUpMinier + $LvlUpRaid) <= 300 ) {
if ($XpMinier >= $XpMinierUp) {
$QryUpdateUser = "UPDATE {{table}} SET ";
$QryUpdateUser .= "`lvl_minier` = '".$LvlUpMinier."', ";
$QryUpdateUser .= "`rpg_points` = `rpg_points` + 1 ";
$QryUpdateUser .= "WHERE ";
$QryUpdateUser .= "`id` = '". $user['id'] ."';";
doquery( $QryUpdateUser, 'users');
$HaveNewLevelMineur = "<tr>";
$HaveNewLevelMineur .= "<th colspan=4><a href=officier.$phpEx>". $lang['Have_new_level_mineur']."</a></th>";
}
if ($XPRaid >= $XpRaidUp) {
$QryUpdateUser = "UPDATE {{table}} SET ";
$QryUpdateUser .= "`lvl_raid` = '".$LvlUpRaid."', ";
$QryUpdateUser .= "`rpg_points` = `rpg_points` + 1 ";
$QryUpdateUser .= "WHERE ";
$QryUpdateUser .= "`id` = '". $user['id'] ."';";
doquery( $QryUpdateUser, 'users');
$HaveNewLevelMineur = "<tr>";
$HaveNewLevelMineur .= "<th colspan=4><a href=officier.$phpEx>". $lang['Have_new_level_raid']."</a></th>";
}
}
// -----------------------------------------------------------------------------------------------
</div>
</div>
</div>
Вот все готовое , ну для сравнения
Рейды
Этим мы увеличиваем количество рангов и очков и улучшаем работу и начисление очков
Вот ,теперь все должно красиво