dd61d3b66b
All checks were successful
continuous-integration/drone/push Build is passing
Corrige un doublons laissé par le rebase semi-manuel Ajout d'une étape de linting dans DroneCi Fix linting Co-authored-by: Nigel Sheldon <nigelsheldon@live.fr> Reviewed-on: https://gitea.nemunai.re/halo-battle/game/pulls/3
54 lines
1.8 KiB
PHP
54 lines
1.8 KiB
PHP
<?php
|
|
if (!defined('INDEX')) {
|
|
header('Location: ../');
|
|
exit;
|
|
}
|
|
$pagea = 'print';
|
|
$titre = 'Vue des futurs alliances';
|
|
|
|
$template->assign('linkpage', 'snalliances');
|
|
|
|
//TODO tout est à faire
|
|
|
|
if (!empty($_GET['id']) && !empty($_GET['key']) && $_GET['key'] != 'id') {
|
|
$pagea = 'print_key';
|
|
$id_plan = $_GET['id'];
|
|
$key = $_GET['key'];
|
|
$chapeau->connexion();
|
|
$chapeau->escape($id_plan);
|
|
$chapeau->escape($key);
|
|
$reqA = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE id = '$id_plan';");
|
|
$req = $chapeau->unique_query("DESCRIBE $table_alliances $key;");
|
|
$chapeau->deconnexion();
|
|
$template->assign('tableau', $reqA);
|
|
$template->assign('type', explode('(', $req['Type']));
|
|
$template->assign('idPlan', $id_plan);
|
|
$template->assign('key', $_GET['key']);
|
|
} elseif (!empty($_GET['id'])) {
|
|
$id_plan = $_GET['id'];
|
|
if (isset($_POST['key']) && isset($_POST['mod'])) {
|
|
$key = $_POST['key'];
|
|
$mod = $_POST['mod'];
|
|
$chapeau->connexion();
|
|
$chapeau->escape($mod);
|
|
$chapeau->escape($id_plan);
|
|
$chapeau->query("UPDATE $table_alliances SET $key = '$mod' WHERE id = '$id_plan';");
|
|
$chapeau->deconnexion();
|
|
}
|
|
$chapeau->connexion();
|
|
$req = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE id = '$id_plan';");
|
|
$chapeau->deconnexion();
|
|
$template->assign('tableau', $req);
|
|
$template->assign('idPlan', $id_plan);
|
|
} elseif (!empty($_GET['name'])) {
|
|
$name = $_GET['name'];
|
|
$chapeau->connexion();
|
|
$chapeau->escape($name);
|
|
$req = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE nom = '$name';");
|
|
$chapeau->deconnexion();
|
|
header('Location: admin.php?p=valliances&id='.$req['id']);
|
|
exit;
|
|
} else {
|
|
$pagea = 'print_choixU';
|
|
}
|