forked from halo-battle/game
Version 1.9a
This commit is contained in:
parent
5f81f76b17
commit
d028822d0b
437 changed files with 27543 additions and 81793 deletions
63
game/jeu/admin/version.php
Normal file
63
game/jeu/admin/version.php
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
$pagea = 'version';
|
||||
$titre = 'Versions';
|
||||
|
||||
$template->assign('linkpage', 'version');
|
||||
|
||||
if (!empty($_GET['i']) && $_GET['i'] == 'add' && $sess->values['auth_level'] >= 7) {
|
||||
if (!empty($_POST['version']) && !empty($_POST['contenu'])) {
|
||||
$version = $_POST['version'];
|
||||
$contenu = $_POST['contenu'];
|
||||
$temps = time();
|
||||
$nom_user = trouvNom($id_user);
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($version);
|
||||
$chapeau->escape($contenu);
|
||||
$chapeau->query("INSERT INTO $table_version (version, contenu, temps, pseudo) VALUES ('$version', '$contenu', '$temps', '$nom_user');");
|
||||
$chapeau->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=version');
|
||||
exit;
|
||||
}
|
||||
$template->assign('id', 'add');
|
||||
$pagea = 'version_add';
|
||||
}
|
||||
elseif (!empty($_GET['i'])) {
|
||||
$id = $_GET['i'];
|
||||
if (!empty($_POST['version']) && !empty($_POST['contenu'])) {
|
||||
$version = $_POST['version'];
|
||||
$contenu = $_POST['contenu'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($version);
|
||||
$chapeau->escape($contenu);
|
||||
$chapeau->query("UPDATE $table_version SET version = '$version', contenu = '$contenu' WHERE id = '$id';");
|
||||
$chapeau->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=version');
|
||||
exit;
|
||||
}
|
||||
$chapeau->connexion();
|
||||
$req = $chapeau->unique_query("SELECT * FROM $table_version WHERE id = '$id';");
|
||||
$chapeau->deconnexion();
|
||||
$template->assign('mod', $req);
|
||||
$template->assign('id', $id);
|
||||
$pagea = 'version_add';
|
||||
}
|
||||
elseif (!empty($_GET['d']) && $sess->values['auth_level'] >= 7) {
|
||||
$id = $_GET['d'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($id);
|
||||
$chapeau->query("DELETE FROM $table_version WHERE id = '$id';");
|
||||
$chapeau->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=version');
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
$chapeau->connexion();
|
||||
$req = $chapeau->query("SELECT * FROM $table_version ORDER BY temps DESC;");
|
||||
$chapeau->deconnexion();
|
||||
$template->assign('tableau', $req);
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue