Correctifs sur la page de préparation d'envoie des flotte

This commit is contained in:
Nigel Sheldon 2021-01-03 18:43:43 +01:00 committed by Gitea
commit c56099e3b0
8 changed files with 125 additions and 58 deletions

View file

@ -5,7 +5,29 @@ if (!defined('INDEX')) {
}
$bdd->reconnexion();
$flottes = $bdd->query("SELECT id FROM $table_flottes WHERE (id_user = ".$planete->id_user." OR end_planete = ".$planete->id." OR id_alliance = ".$planete->id_alliance." OR end_planete = ".$planete->id_alliance.") AND (start_time + end_time) <= ".time()." AND last < ".(time()-10).";");
$sql = "";
if ($planete->id_user != null) {
$sql = "id_user = " . $planete->id_user . " ";
}
if ($planete->id != null) {
if ($sql != "") {
$sql .= " OR ";
}
$sql .= "end_planete = " . $planete->id . " ";
}
if ($planete->id_alliance != null) {
if ($sql != "") {
$sql .= " OR ";
}
$sql .= "id_alliance = " . $planete->id_alliance . " ";
}
if ($planete->id_alliance != null) {
if ($sql != "") {
$sql .= " OR ";
}
$sql .= "end_planete = " . $planete->id_alliance . " ";
}
$flottes = $bdd->query("SELECT id FROM $table_flottes WHERE (" . $sql . ") AND (start_time + end_time) <= ".time()." AND last < ".(time()-10).";");
$bdd->deconnexion();
if (!empty($flottes)) {