Version 1.13a

This commit is contained in:
nemunaire 2020-11-15 16:12:30 +01:00
commit ba8f323879
1634 changed files with 10080 additions and 213021 deletions

View file

@ -1,5 +1,5 @@
<?php
if(!defined('INDEX')) { header('Location: ../'); exit; }
if(!defined('INDEX') || SURFACE != "planete") { header('Location: ./'.$VAR['first_page']); exit; }
$page = 'rename';
$titre = 'Renommer une planète';
@ -21,31 +21,29 @@ if (isset($_POST['planete']))
exit;
//erreur('Le nom de votre planète a été modifié avec succès.', "green", '?p=accueil');
}
unset($nouvNom);
}
elseif(isset($_GET['a']) && isset($_GET['i']) && $_GET['a'] == $SESS->values['abandon'] && !empty($idPlan) && $idPlan == $_GET['i'])
elseif(!empty($_GET['a']) && !empty($SESS->values['abandon']) && isset($_GET['i']) && $_GET['a'] == $SESS->values['abandon'] && $planete->id == $_GET['i'])
{
$galaxie = $planete->galaxie; $ss = $planete->ss; $position = $planete->position;
$bdd->reconnexion();
$bdd->query("DELETE FROM $table_planete WHERE id_user = $id_user AND id = $idPlan AND galaxie = $galaxie AND ss = $ss AND position = $position LIMIT 1;");
$bdd->query("DELETE FROM $table_flottes WHERE id_user = $id_user AND start_galaxie = $galaxie AND start_ss = $ss AND start_position = $position;");
$req = $bdd->unique_query("SELECT * FROM $table_planete WHERE id_user = $id_user LIMIT 1;");
$bdd->query("DELETE FROM $table_planete WHERE id_user = ".$planete->id_user." AND id = ".$planete->id." AND galaxie = ".$planete->galaxie." AND ss = ".$planete->ss." AND position = ".$planete->position." LIMIT 1;");
$bdd->query("DELETE FROM $table_flottes WHERE id_user = ".$planete->id_user." AND start_galaxie = ".$planete->galaxie." AND start_ss = ".$planete->ss." AND start_position = ".$planete->position.";");
$req = $bdd->unique_query("SELECT id FROM $table_planete WHERE id_user = ".$planete->id_user." LIMIT 1;");
$bdd->deconnexion();
$SESS->values['abandon'] = 0;
unset($SESS->values['abandon']);
$SESS->values['idPlan'] = $req['id'];
$SESS->put($planete->id_user);
$SESS->put();
unset($req, $planete);
erreur('Cette planète n\'est désormais plus sous votre contrôle.', "green", '?p=accueil');
}
$bdd->reconnexion();
$reqnb = $bdd->unique_query("SELECT COUNT(id) AS total FROM $table_planete WHERE id_user = $id_user;");
$bdd->deconnexion();
if ($reqnb['total'] > 1) $hashA = md5(rand(123456789,9876543210));
else $hashA = false;
$SESS->values['abandon'] = $hashA;
$SESS->put();
$template->assign('abandonH', $hashA);
if (count($queryPlanetes) > 1)
{
$template->assign('abandonH', $SESS->values['abandon'] = md5(rand(123456789,9876543210)));
$SESS->put();
}
unset($queryPlanetes);
?>