38 lines
1.3 KiB
PHP
38 lines
1.3 KiB
PHP
|
<?php
|
||
|
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||
|
$pagea = 'print';
|
||
|
$titre = 'Vérification planète';
|
||
|
|
||
|
$template->assign('linkpage', 'valliances');
|
||
|
|
||
|
if (!empty($_GET['id']) && !empty($_GET['key']) && $_GET['key'] != 'id') {
|
||
|
$pagea = 'print_key';
|
||
|
$id_plan = $_GET['id'];
|
||
|
$req = $chapeau->unique_query("SELECT * FROM `alliances` WHERE `id` = '$id_plan';");
|
||
|
$template->assign('tableau', $req);
|
||
|
$req = $chapeau->unique_query("DESCRIBE `alliances` `".$_GET['key']."`;");
|
||
|
$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->escape($mod);
|
||
|
$chapeau->query("UPDATE `alliances` SET `$key` = '$mod' WHERE `id` = '$id_plan';");
|
||
|
}
|
||
|
$req = $chapeau->unique_query("SELECT * FROM `alliances` WHERE `id` = '$id_plan';");
|
||
|
$template->assign('tableau', $req);
|
||
|
$template->assign('idPlan', $id_plan);
|
||
|
}
|
||
|
elseif (!empty($_GET['name'])) {
|
||
|
$req = $chapeau->unique_query("SELECT * FROM `alliances` WHERE `nom` = '".mysql_real_escape_string($_GET['name'])."';");
|
||
|
header('Location: admin.php?p=valliances&id='.$req['id']);
|
||
|
exit;
|
||
|
}
|
||
|
else {
|
||
|
$pagea = 'print_choixU';
|
||
|
}
|
||
|
?>
|