<?php
if (!defined('INDEX')) {
    header('Location: ../');
    exit;
}

$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).";");
$bdd->deconnexion();

if (!empty($flottes)) {
    foreach ($flottes as $flotte) {
        $flotte = new Flotte($flotte['id']);
        $flotte->check_mission();
    }
}

unset($flottes, $flotte);
