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
15
game/jeu/admin/accueil.php
Normal file
15
game/jeu/admin/accueil.php
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
$pagea = 'accueil';
|
||||
$titre = 'Accueil administration';
|
||||
|
||||
$bdd->connexion();
|
||||
$mail = $bdd->unique_query("SELECT COUNT(id) AS nombre FROM $table_ope_mail WHERE statut = 0;");
|
||||
$pilori = $bdd->unique_query("SELECT COUNT(id) AS nombre FROM $table_user WHERE mv > 1;");
|
||||
$news = $bdd->query("SELECT * FROM $table_ope_news ORDER BY id ASC LIMIT 3;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
$template->assign('nbMail', $mail['nombre']);
|
||||
$template->assign('nbPilori', $pilori['nombre']);
|
||||
$template->assign('news', $news);
|
||||
?>
|
||||
52
game/jeu/admin/alliance.php
Normal file
52
game/jeu/admin/alliance.php
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
$pagea = 'print';
|
||||
$titre = 'Vérification alliance';
|
||||
|
||||
$template->assign('linkpage', 'valliances');
|
||||
|
||||
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';
|
||||
}
|
||||
?>
|
||||
60
game/jeu/admin/bandeau.php
Normal file
60
game/jeu/admin/bandeau.php
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
$pagea = 'bandeau';
|
||||
$titre = 'Bandeau d\'information';
|
||||
|
||||
$template->assign('linkpage', 'bandeau');
|
||||
|
||||
if (!empty($_GET['i']) && $_GET['i'] == 'add') {
|
||||
if (!empty($_POST['texte']) && isset($_POST['color'])) {
|
||||
$texte = $_POST['texte'];
|
||||
$color = $_POST['color'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($texte);
|
||||
$chapeau->escape($color);
|
||||
$chapeau->query("INSERT INTO $table_infoshead (texte, color) VALUES ('$texte', '$color');");
|
||||
$chapeau->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=bandeau');
|
||||
exit;
|
||||
}
|
||||
$template->assign('id', 'add');
|
||||
$pagea = 'bandeau_add';
|
||||
}
|
||||
elseif (!empty($_GET['i'])) {
|
||||
$id = $_GET['i'];
|
||||
if (!empty($_POST['texte']) && isset($_POST['color'])) {
|
||||
$texte = $_POST['texte'];
|
||||
$color = $_POST['color'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($texte);
|
||||
$chapeau->escape($color);
|
||||
$chapeau->query("UPDATE $table_infoshead SET texte = '$texte', color = '$color' WHERE id = '$id';");
|
||||
$chapeau->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=bandeau');
|
||||
exit;
|
||||
}
|
||||
$chapeau->connexion();
|
||||
$req = $chapeau->unique_query("SELECT * FROM $table_infoshead WHERE id = '$id';");
|
||||
$chapeau->deconnexion();
|
||||
$template->assign('mod', $req);
|
||||
$template->assign('id', $id);
|
||||
$pagea = 'bandeau_add';
|
||||
}
|
||||
elseif (!empty($_GET['d'])) {
|
||||
$id = $_GET['d'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->query("DELETE FROM $table_infoshead WHERE id = '$id';");
|
||||
$chapeau->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=bandeau');
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
$chapeau->connexion();
|
||||
$req = $chapeau->query("SELECT * FROM $table_infoshead;");
|
||||
$chapeau->deconnexion();
|
||||
$template->assign('tableau', $req);
|
||||
}
|
||||
?>
|
||||
64
game/jeu/admin/demarrage.php
Normal file
64
game/jeu/admin/demarrage.php
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
$pagea = 'demarrage';
|
||||
$titre = 'Page de démarrage';
|
||||
|
||||
$template->assign('linkpage', 'demarrage');
|
||||
|
||||
if (!empty($_GET['i']) && $_GET['i'] == 'add') {
|
||||
if (!empty($_POST['contenu']) && isset($_POST['titre'])) {
|
||||
$titre = gpc('titre', 'post');
|
||||
$contenu = gpc('contenu', 'post');
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($titre);
|
||||
$chapeau->escape($contenu);
|
||||
$time = time();
|
||||
$chapeau->query("INSERT INTO $table_messages_demarrage (titre, contenu, time) VALUES ('$titre', '$contenu', $time);");
|
||||
$chapeau->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=demarrage');
|
||||
exit;
|
||||
}
|
||||
$template->assign('id', 'add');
|
||||
$pagea = 'demarrage_add';
|
||||
}
|
||||
elseif (!empty($_GET['i'])) {
|
||||
$id = $_GET['i'];
|
||||
if (!empty($_POST['contenu']) && isset($_POST['titre'])) {
|
||||
$titre = gpc('titre', 'post');
|
||||
$texte = gpc('contenu', 'post');
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($titre);
|
||||
$chapeau->escape($texte);
|
||||
$time = time();
|
||||
$reset = gpc('reset', 'post');
|
||||
if (!empty($reset)) $chapeau->query("UPDATE $table_messages_demarrage SET contenu = '$texte', titre = '$titre', time = $time WHERE id = '$id';");
|
||||
else $chapeau->query("UPDATE $table_messages_demarrage SET contenu = '$texte', titre = '$titre' WHERE id = '$id';");
|
||||
$chapeau->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=demarrage');
|
||||
exit;
|
||||
}
|
||||
$chapeau->connexion();
|
||||
$req = $chapeau->unique_query("SELECT * FROM $table_messages_demarrage WHERE id = '$id';");
|
||||
$chapeau->deconnexion();
|
||||
$template->assign('mod', $req);
|
||||
$template->assign('id', $id);
|
||||
$pagea = 'demarrage_add';
|
||||
}
|
||||
elseif (!empty($_GET['d'])) {
|
||||
$id = $_GET['d'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->query("DELETE FROM $table_messages_demarrage WHERE id = '$id';");
|
||||
$chapeau->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=demarrage');
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
$chapeau->connexion();
|
||||
$req = $chapeau->query("SELECT * FROM $table_messages_demarrage;");
|
||||
$chapeau->deconnexion();
|
||||
$template->assign('tableau', $req);
|
||||
}
|
||||
?>
|
||||
21
game/jeu/admin/flottes.php
Normal file
21
game/jeu/admin/flottes.php
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
$pagea = 'vflotte';
|
||||
$titre = 'Vérification flottes';
|
||||
|
||||
//Vérification des flottes
|
||||
if (!isset($_GET['ceil'])) $_GET['ceil'] = 5000;
|
||||
|
||||
$chapeau->connexion();
|
||||
$req = mysql_query("SELECT * FROM `$table_flottes` ORDER BY `start_time` DESC");
|
||||
$tableau = array();
|
||||
while($resultat = mysql_fetch_array($req)) {
|
||||
$user_source = infoPlan($resultat['end_galaxie'], $resultat['end_ss'], $resultat['end_position'], 'id_user');
|
||||
if ($resultat['contenu_metal'] + $resultat['contenu_cristal'] + $resultat['contenu_hydrogene'] >= $_GET['ceil']) $color = 'FF0000';
|
||||
elseif ($user_source != $resultat['id_user']) $color = 'DFBF00';
|
||||
else $color = false;
|
||||
$tableau[] = array(trouvNom($user_source), trouvNom($resultat['id_user']), infoPlan($resultat['start_galaxie'], $resultat['start_ss'], $resultat['start_position'], 'nom_planete'), '['.$resultat['start_galaxie'].':'.$resultat['start_ss'].':'.$resultat['start_position'].']', infoPlan($resultat['end_galaxie'], $resultat['end_ss'], $resultat['end_position'], 'nom_planete'), '['.$resultat['end_galaxie'].':'.$resultat['end_ss'].':'.$resultat['end_position'].']', $resultat['start_time'], '<acronym title="!!!Détail vaisseaux">'.$resultat['nb_vais'].'</acronym>', $resultat['vitesse'], $resultat['contenu_metal'], $resultat['contenu_cristal'], $resultat['contenu_hydrogene'], $color);
|
||||
}
|
||||
|
||||
$template->assign('flottes', $tableau);
|
||||
?>
|
||||
14
game/jeu/admin/inscription.php
Normal file
14
game/jeu/admin/inscription.php
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
$titre = 'Création d\'inscription';
|
||||
$pagea = 'inscription';
|
||||
|
||||
if (!empty($_POST['HB_pseudo']) && !empty($_POST['race'])) {
|
||||
if ($_POST['HB_conf'] == $_POST['HB_mdp'] && !empty($_POST['HB_mdp'])) {
|
||||
$res = $_POST;
|
||||
$cds = sha1($res['HB_pseudo'].'$'.$res['race'].'£'.$res['HB_mdp'].'#'.$res['HB_mail'].'ß'.time().'Ó'.$_SERVER['HTTP_USER_AGENT'].'♀☻'.$_SERVER['REMOTE_ADDR'].$res['HB_placement']);
|
||||
erreur('URL : ?p=njoueur&nom='.$res['HB_pseudo'].'&race='.$res['race'].'&mdp='.$res['HB_mdp'].'&mail='.$res['HB_mail'].'&ti='.time().'&placement='.$res['HB_placement'].'&cds='.$cds.'<br /><br />L\'inscription doit avoir lieu par vous même en raison des procédures de sécurités !', "white");
|
||||
}
|
||||
else erreur('Mot de passe incorrect !');
|
||||
}
|
||||
?>
|
||||
36
game/jeu/admin/ip.php
Normal file
36
game/jeu/admin/ip.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
$pagea = 'vip';
|
||||
$titre = 'Vérification IP';
|
||||
|
||||
$timelimit = date('Y-m-d', mktime(0, 0, 0, date("m"), date("d"), date("Y"))); //2008-06-17 18:15:00
|
||||
$chapeau->connexion();
|
||||
$page = gpc('v');
|
||||
if (empty($page) || !is_numeric($page)) $page = 0;
|
||||
|
||||
$act = gpc('act');
|
||||
if ($act == 'multiok') $chapeau->query("UPDATE $table_user SET multi = '1' WHERE id = ".$_GET['util'].";");
|
||||
|
||||
if (isset($_GET['ip'])) $req = mysql_query("SELECT R.id, R.id_util, R.time, R.ip, U.pseudo, U.mv, U.multi FROM $table_registre_identification R INNER JOIN $table_user U ON R.id_util = U.id WHERE ip = '".$_GET['ip']."' ORDER BY ip ASC;");
|
||||
elseif (isset($_GET['util']) && isset($_GET['comp'])) $req = mysql_query("SELECT R.id, R.id_util, R.time, R.ip, U.pseudo, U.mv, U.multi FROM $table_registre_identification R INNER JOIN $table_user U ON R.id_util = U.id WHERE id_util = ".$_GET['util']." OR id_util = ".$_GET['comp']." ORDER BY ip ASC;");
|
||||
elseif (isset($_GET['util'])) $req = mysql_query("SELECT R.id, R.id_util, R.time, R.ip, U.pseudo, U.mv, U.multi FROM $table_registre_identification R INNER JOIN $table_user U ON R.id_util = U.id WHERE id_util = '".$_GET['util']."' ORDER BY ip ASC;");
|
||||
elseif (isset($_GET['tri'])) $req = mysql_query("SELECT R.id, R.id_util, R.time, R.ip, U.pseudo, U.mv, U.multi FROM $table_registre_identification R INNER JOIN $table_user U ON R.id_util = U.id ORDER BY ".$_GET['tri']." ASC;");
|
||||
else $req = mysql_query("SELECT R.id, R.id_util, R.time, R.ip, U.pseudo, U.mv, U.multi FROM $table_registre_identification R INNER JOIN $table_user U ON R.id_util = U.id WHERE R.time > '$timelimit 00:00:00' ORDER BY R.ip ASC LIMIT ".($page*75).",75;");
|
||||
//SELECT last_ip,COUNT(*) FROM user GROUP BY last_ip HAVING COUNT(*)>1
|
||||
$nbpage = $chapeau->unique_query("SELECT COUNT(id) AS nb FROM $table_registre_identification WHERE time > '$timelimit 00:00:00';");
|
||||
$chapeau->deconnexion();
|
||||
|
||||
$anc = array('ip' => 0, 'id_util' => 0);
|
||||
$tableau = array();
|
||||
while($resultat = mysql_fetch_array($req)) {
|
||||
if ($resultat['mv'] == 3) $color = 'DFBF00';
|
||||
elseif ($resultat['multi'] == 1 && $anc['ip'] == $resultat['ip'] && $anc['id_util'] != $resultat['id_util']) $color = 'EE66EE';
|
||||
elseif ($anc['ip'] == $resultat['ip'] && $anc['id_util'] != $resultat['id_util']) $color = 'FF0000';
|
||||
else $color = false;
|
||||
$tableau[] = array($resultat['ip'], gethostbyaddr($resultat['ip']), $resultat['id_util'], $resultat['pseudo'], $resultat['time'], $resultat['mv'], $color);
|
||||
$anc = $resultat;
|
||||
}
|
||||
$template->assign('ips', $tableau);
|
||||
$template->assign('numpage', $page);
|
||||
$template->assign('nbpage', floor($nbpage['nb']/75));
|
||||
?>
|
||||
52
game/jeu/admin/joueur.php
Normal file
52
game/jeu/admin/joueur.php
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
$pagea = 'print';
|
||||
$titre = 'Vérification joueur';
|
||||
|
||||
$template->assign('linkpage', 'vjoueurs');
|
||||
|
||||
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);
|
||||
$reqJ = $chapeau->unique_query("SELECT * FROM $table_user WHERE id = '$id_plan';");
|
||||
$req = $chapeau->unique_query("DESCRIBE $table_user $key;");
|
||||
$chapeau->deconnexion();
|
||||
$template->assign('tableau', $reqJ);
|
||||
$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_user SET $key = '$mod' WHERE id = '$id_plan';");
|
||||
$chapeau->deconnexion();
|
||||
}
|
||||
$chapeau->connexion();
|
||||
$req = $chapeau->unique_query("SELECT * FROM $table_user 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_user WHERE pseudo = '$name';");
|
||||
$chapeau->deconnexion();
|
||||
header('Location: admin.php?p=vjoueurs&id='.$req['id']);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
$pagea = 'print_choixU';
|
||||
}
|
||||
?>
|
||||
49
game/jeu/admin/mail.php
Normal file
49
game/jeu/admin/mail.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
$pagea = 'mail_liste';
|
||||
$titre = 'Demandes et problèmes de la galaxie';
|
||||
|
||||
$template->assign('linkpage', 'courrier');
|
||||
|
||||
if (!empty($_GET['w']) || !empty($_GET['x'])) {
|
||||
if (!empty($_GET['w'])) $id = $_GET['w'];
|
||||
else $id = $_GET['x'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($id);
|
||||
$req = $chapeau->unique_query("SELECT $table_user.pseudo, $table_ope_mail.statut, $table_ope_mail.time, $table_ope_mail.titre, $table_ope_mail.contenu, $table_ope_mail.id FROM $table_ope_mail INNER JOIN $table_user ON $table_user.id = $table_ope_mail.id_user WHERE $table_ope_mail.id = '$id';");
|
||||
if ($req['statut'] >= 6) $chapeau->query("UPDATE $table_ope_mail SET statut = '0' WHERE id = '$id';");
|
||||
else $chapeau->query("UPDATE $table_ope_mail SET statut = statut + 1 WHERE id = '$id';");
|
||||
$chapeau->deconnexion();
|
||||
|
||||
if (isset($_GET['x'])) header('Location: admin.php?p=courrier&v='.$id);
|
||||
else header('Location: admin.php?p=courrier');
|
||||
exit;
|
||||
}
|
||||
elseif (!empty($_GET['v'])) {
|
||||
$id = $_GET['v'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($id);
|
||||
$req = $chapeau->unique_query("SELECT $table_user.pseudo, $table_ope_mail.statut, $table_ope_mail.time, $table_ope_mail.titre, $table_ope_mail.contenu, $table_ope_mail.id FROM $table_ope_mail INNER JOIN $table_user ON $table_user.id = $table_ope_mail.id_user WHERE $table_ope_mail.id = '$id';");
|
||||
$chapeau->deconnexion();
|
||||
|
||||
$template->assign('req', $req);
|
||||
$template->assign('id', $id);
|
||||
$pagea = 'mail_view';
|
||||
}
|
||||
elseif (!empty($_GET['d']) && $sess->values['auth_level'] >= 5) {
|
||||
$id = $_GET['d'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($id);
|
||||
$chapeau->query("DELETE FROM $table_ope_mail WHERE id = '$id';");
|
||||
$chapeau->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=courrier');
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
$chapeau->connexion();
|
||||
$req = $chapeau->query("SELECT $table_user.pseudo, $table_ope_mail.statut, $table_ope_mail.time, $table_ope_mail.titre, $table_ope_mail.contenu, $table_ope_mail.id FROM $table_ope_mail INNER JOIN $table_user ON $table_user.id = $table_ope_mail.id_user ORDER BY $table_ope_mail.time DESC;");
|
||||
$chapeau->connexion();
|
||||
$template->assign('mails', $req);
|
||||
}
|
||||
?>
|
||||
55
game/jeu/admin/planete.php
Normal file
55
game/jeu/admin/planete.php
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
$pagea = 'print';
|
||||
$titre = 'Vérification planète';
|
||||
|
||||
$template->assign('linkpage', 'vplanetes');
|
||||
|
||||
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);
|
||||
$reqp = $chapeau->unique_query("SELECT * FROM $table_planete WHERE id = '$id_plan';");
|
||||
$req = $chapeau->unique_query("DESCRIBE $table_planete $key;");
|
||||
$chapeau->deconnexion();
|
||||
$template->assign('tableau', $reqp);
|
||||
$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->query("UPDATE $table_planete SET $key = '$mod' WHERE id = '$id_plan';");
|
||||
$chapeau->deconnexion();
|
||||
}
|
||||
$chapeau->connexion();
|
||||
$req = $chapeau->unique_query("SELECT * FROM $table_planete WHERE id = '$id_plan';");
|
||||
$chapeau->deconnexion();
|
||||
$template->assign('tableau', $req);
|
||||
$template->assign('idPlan', $id_plan);
|
||||
}
|
||||
elseif (isset($_GET['amas']) && isset($_GET['ss']) && !empty($_GET['pos'])) {
|
||||
$amas = $_GET['amas'];
|
||||
$ss = $_GET['ss'];
|
||||
$pos = $_GET['pos'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($amas);
|
||||
$chapeau->escape($ss);
|
||||
$chapeau->escape($pos);
|
||||
$req = $chapeau->unique_query("SELECT * FROM $table_planete WHERE galaxie = '$amas' AND ss = '$ss' AND position = '$pos';");
|
||||
$chapeau->deconnexion();
|
||||
header('Location: admin.php?p=vplanetes&id='.$req['id']);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
$pagea = 'print_choixP';
|
||||
}
|
||||
?>
|
||||
36
game/jeu/admin/prendre_controle.php
Normal file
36
game/jeu/admin/prendre_controle.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
$titre = 'Prise de contrôle d\'un joueur';
|
||||
$pagea = 'erreur';
|
||||
|
||||
$template->assign('linkpage', 'cjoueurs');
|
||||
|
||||
if ($sess->values['auth_level'] >= 5 && !empty($_GET['id'])) {
|
||||
$name = $_GET['id'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($name);
|
||||
$req = $chapeau->unique_query("SELECT auth_level FROM $table_user WHERE id = '$name';");
|
||||
$chapeau->deconnexion();
|
||||
if ($req['auth_level'] >= 3) {
|
||||
$template->assign('message', 'Vous ne pouvez pas prendre le contrôle de cet utilisateur !');
|
||||
}
|
||||
else {
|
||||
$sess->values['id'] = $_GET['id'];
|
||||
$sess->put();
|
||||
|
||||
$template->assign('message', 'Vous contrôlez maintenant le joueur '.$_GET['id'].'.<br />Pensez à sélectionner sa planète !');
|
||||
}
|
||||
}
|
||||
elseif (!empty($_GET['name'])) {
|
||||
$name = $_GET['name'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($name);
|
||||
$req = $chapeau->unique_query("SELECT id FROM $table_user WHERE pseudo = '$name';");
|
||||
$chapeau->deconnexion();
|
||||
header('Location: admin.php?p=cjoueurs&id='.$req['id']);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
$pagea = 'print_choixU';
|
||||
}
|
||||
?>
|
||||
26
game/jeu/admin/rapport.php
Normal file
26
game/jeu/admin/rapport.php
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
$pagea = 'rapports';
|
||||
$titre = 'Afficher les rapports d\'un joueur';
|
||||
|
||||
$template->assign('linkpage', 'vrapports');
|
||||
|
||||
if (!empty($_GET['name'])) {
|
||||
$id_user = $_GET['name'];
|
||||
$chapeau->connexion();
|
||||
$req = $chapeau->query("SELECT * FROM $table_mail WHERE destinataire = '$id_user' AND expediteur = '' ORDER BY temps DESC;");
|
||||
$chapeau->deconnexion();
|
||||
$template->assign('tableau', $req);
|
||||
$template->assign('idPlan', $id_user);
|
||||
}
|
||||
elseif (!empty($_GET['id'])) {
|
||||
$chapeau->connexion();
|
||||
$req = $chapeau->unique_query("SELECT * FROM $table_user WHERE id = '".mysql_real_escape_string($_GET['id'])."';");
|
||||
$chapeau->deconnexion();
|
||||
header('Location: admin.php?p=vrapports&name='.$req['pseudo']);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
$pagea = 'print_choixU';
|
||||
}
|
||||
?>
|
||||
42
game/jeu/admin/sanction_joueur.php
Normal file
42
game/jeu/admin/sanction_joueur.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
$titre = 'Sanction joueur';
|
||||
$pagea = 'erreur';
|
||||
|
||||
$template->assign('linkpage', 'sjoueurs');
|
||||
|
||||
if (!empty($_GET['id']) && !empty($_GET['sanc']) && (!empty($_GET['raisonmv']) || $_GET['sanc'] < 0)) {
|
||||
$raisonmv = $_GET['raisonmv'];
|
||||
$id_plan = $_GET['id'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($raisonmv);
|
||||
$chapeau->escape($id_plan);
|
||||
|
||||
if ($_GET['sanc'] == 'definitif' || $_GET['sanc'] == 'définitif' || $_GET['sanc'] == 'd') {
|
||||
$chapeau->query("UPDATE $table_user SET mv = '3', raisonmv = '$raisonmv', operateurmv = '$id_user' WHERE id = '$id_plan';");
|
||||
$chapeau->deconnexion();
|
||||
|
||||
$template->assign('message', 'Le joueur a été banni définitivement !');
|
||||
}
|
||||
else {
|
||||
$sanc = $_GET['sanc'];
|
||||
$time = time() + $_GET['sanc'] * 86400 - 259200;
|
||||
$chapeau->query("UPDATE $table_user SET mv = '2', last_visite = '$time', raisonmv = '$raisonmv', operateurmv = '$id_user' WHERE id = '$id_plan';");
|
||||
$chapeau->deconnexion();
|
||||
|
||||
$template->assign('message', 'Le joueur a été placé en mode vacances !');
|
||||
}
|
||||
}
|
||||
elseif (!empty($_GET['name']) && !empty($_GET['sanc']) && isset($_GET['raisonmv'])) {
|
||||
$name = $_GET['name'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($name);
|
||||
$req = $chapeau->unique_query("SELECT * FROM $table_user WHERE pseudo = '$name';");
|
||||
$chapeau->deconnexion();
|
||||
header('Location: admin.php?p=sjoueurs&sanc='.$_GET['sanc'].'&raisonmv='.$_GET['raisonmv'].'&id='.$req['id']);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
$pagea = 'sanctionU_choix';
|
||||
}
|
||||
?>
|
||||
42
game/jeu/admin/supprimer_joueur.php
Normal file
42
game/jeu/admin/supprimer_joueur.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
$titre = '!!! Supprimer joueur !!!';
|
||||
$pagea = 'erreur';
|
||||
|
||||
$template->assign('linkpage', 'djoueurs');
|
||||
|
||||
if ($sess->values['auth_level'] >= 5 && !empty($_GET['id'])) {
|
||||
$id = $_GET['id'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($id);
|
||||
$req = $chapeau->unique_query("SELECT * FROM $table_user WHERE id = '$id';");
|
||||
$chapeau->deconnexion();
|
||||
if ($req) {
|
||||
$nom = trouvNom($id);
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($nom);
|
||||
$chapeau->query("DELETE FROM $table_mail WHERE destinataire = '$nom';");
|
||||
$chapeau->query("DELETE FROM $table_user WHERE id = '$id';");
|
||||
$chapeau->query("DELETE FROM $table_flottes WHERE id_user = '$id';");
|
||||
$chapeau->query("DELETE FROM $table_planete WHERE id_user = '$id';");
|
||||
$chapeau->deconnexion();
|
||||
$template->assign('message', 'Le joueur a été supprimé du jeu ainsi que toutes les données le concernant !');
|
||||
}
|
||||
else {
|
||||
$chapeau->deconnexion();
|
||||
$template->assign('message', 'Le joueur n\'a pas été trouvé !');
|
||||
}
|
||||
}
|
||||
elseif (!empty($_GET['name'])) {
|
||||
$name = $_GET['name'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($name);
|
||||
$req = $chapeau->unique_query("SELECT * FROM $table_user WHERE pseudo = '$name';");
|
||||
$chapeau->deconnexion();
|
||||
header('Location: admin.php?p=djoueurs&id='.$req['id']);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
$pagea = 'print_choixU';
|
||||
}
|
||||
?>
|
||||
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