game/onyx2/include/admin/snalliances.php

54 lines
1.6 KiB
PHP
Raw Normal View History

2008-11-04 11:00:00 +00:00
<?php
if(!defined('INDEX')) { header('Location: ../'); exit; }
$pagea = 'print';
2020-11-15 15:12:30 +00:00
$titre = 'Vue des futurs alliances';
2008-11-04 11:00:00 +00:00
2020-11-15 15:12:30 +00:00
$template->assign('linkpage', 'snalliances');
//TODO tout est à faire
2008-11-04 11:00:00 +00:00
if (!empty($_GET['id']) && !empty($_GET['key']) && $_GET['key'] != 'id') {
$pagea = 'print_key';
$id_plan = $_GET['id'];
2008-11-16 11:00:00 +00:00
$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);
2008-11-04 11:00:00 +00:00
$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'];
2008-11-16 11:00:00 +00:00
$chapeau->connexion();
2008-11-04 11:00:00 +00:00
$chapeau->escape($mod);
2008-11-16 11:00:00 +00:00
$chapeau->escape($id_plan);
$chapeau->query("UPDATE $table_alliances SET $key = '$mod' WHERE id = '$id_plan';");
$chapeau->deconnexion();
2008-11-04 11:00:00 +00:00
}
2008-11-16 11:00:00 +00:00
$chapeau->connexion();
$req = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE id = '$id_plan';");
$chapeau->deconnexion();
2008-11-04 11:00:00 +00:00
$template->assign('tableau', $req);
$template->assign('idPlan', $id_plan);
}
elseif (!empty($_GET['name'])) {
2008-11-16 11:00:00 +00:00
$name = $_GET['name'];
$chapeau->connexion();
$chapeau->escape($name);
$req = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE nom = '$name';");
$chapeau->deconnexion();
2008-11-04 11:00:00 +00:00
header('Location: admin.php?p=valliances&id='.$req['id']);
exit;
}
else {
$pagea = 'print_choixU';
}
?>