You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.php 15 KiB

10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
10 jaren geleden
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. <?php include "header.php";
  2. $message[0]='';
  3. $message[1]='
  4. <div class="col-lg-6 alert alert-dismissable alert-success">
  5. <button type="button" class="close" data-dismiss="alert">X</button>
  6. <h4>C\'est bon !</h4>
  7. <p>Vous pouvez à présent vous connecter pour commencer à configurer votre partie.</p>';
  8. $message[2]='
  9. <div class="col-lg-6 alert alert-dismissable alert-warning">
  10. <button type="button" class="close" data-dismiss="alert">X</button>
  11. <h4>Hey !</h4>
  12. <p>Vous avez déjà un compte !</p>';
  13. $message[3]='
  14. <div class="col-lg-6 alert alert-dismissable alert-danger">
  15. <button type="button" class="close" data-dismiss="alert">X</button>
  16. <h4>Erreur !</h4>
  17. <p>Votre email/mot de passe est invalide !</p>';
  18. $message[4]='
  19. <div class="col-lg-6 alert alert-dismissable alert-info">
  20. <button type="button" class="close" data-dismiss="alert">X</button>
  21. <h4>Oups !</h4>
  22. <p>Vous devez vous connecter pour pouvoir jouer ;)</p>';
  23. $message[5]='
  24. <div class="col-lg-6 alert alert-dismissable alert-success">
  25. <button type="button" class="close" data-dismiss="alert">X</button>
  26. <h4>OK !</h4>
  27. <p>Votre carte est à jour !</p>';
  28. ?>
  29. <!DOCTYPE html>
  30. <html lang="fr">
  31. <head>
  32. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  33. <title>EcoMonde</title>
  34. <meta name="viewport" content="width=device-width, initial-scale=1">
  35. <link rel="stylesheet" href="./css/bootstrap.css" media="screen">
  36. <link rel="stylesheet" href="./css/bootswatch.min.css">
  37. <link rel="stylesheet" href="./css/ecomonde.css">
  38. </head>
  39. <body>
  40. <div class="container-fluid">
  41. <div class="col-lg-1"></div>
  42. <div class="col-lg-3">
  43. <a href="#"><img class="img-responsive" src="./img/logo_<?php echo rand(1, 6); ?>.png" alt="logo" /></a>
  44. </div>
  45. <div class="col-lg-6">
  46. <div class="navbar navbar-default">
  47. <div class="navbar-header">
  48. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
  49. <span class="icon-bar"></span>
  50. <span class="icon-bar"></span>
  51. <span class="icon-bar"></span>
  52. </button>
  53. </div>
  54. <div class="navbar-collapse collapse navbar-responsive-collapse">
  55. <ul class="nav navbar-nav">
  56. <li><a href="http://wiki.ecomonde.land"><i class="glyphicon glyphicon-book"></i>&nbsp;&nbsp;WIKI</a></li>
  57. <li><a href="https://github.com/heuzef/ecomonde"><i class="glyphicon glyphicon-new-window"></i>&nbsp;&nbsp;GITHUB</a></li>
  58. </ul>
  59. <ul class="nav navbar-nav navbar-right">
  60. <?php if($status != 0): ?>
  61. <li><?php echo '<img class="img-circle" src="http://gravatar.com/avatar/'.$hash.'?s=50" alt="gravatar" />'; ?>&nbsp;&nbsp;<strong><?php echo strtoupper($pseudo); ?></strong></li>
  62. <li><a href="logout.php"><i class="glyphicon glyphicon-off"></i>&nbsp;&nbsp;DECONNEXION</a></li>
  63. <?php elseif($status == 0): ?>
  64. <li><a data-toggle="modal" data-target="#modal_login"><i class="glyphicon glyphicon-log-in"></i>&nbsp;&nbsp;CONNEXION</a></li>
  65. <?php endif; ?>
  66. </ul>
  67. </div>
  68. </div>
  69. </div>
  70. <div class="col-lg-1"></div>
  71. </div>
  72. <hr />
  73. <?php if(isset($_GET["msg"])){?>
  74. <div class="container-fluid">
  75. <div class="col-lg-3"></div>
  76. <?php echo $message[$_GET["msg"]]; ?>
  77. </div>
  78. <div class="col-lg-3"></div>
  79. </div>
  80. <?php } else {} ?>
  81. <?php if($status != 0):?>
  82. <div class="container-fluid">
  83. <div class="col-lg-3"></div>
  84. <div class="col-lg-6 alert alert-dismissable alert-info">
  85. <button type="button" class="close" data-dismiss="alert">X</button>
  86. <p><i class="glyphicon glyphicon-wrench"></i>&nbsp;&nbsp;EcoMonde est encore en Beta, certaines fonctions ne sont pas encore disponibles.</p>
  87. </div>
  88. <div class="col-lg-3"></div>
  89. </div>
  90. <div class="container-fluid">
  91. <div class="col-lg-1"></div>
  92. <div class="col-lg-3">
  93. <div class="panel panel-default">
  94. <div class="panel-heading"><i class="glyphicon glyphicon-cog"></i>&nbsp;&nbsp;<strong>Configurer votre partie</strong></div>
  95. <div class="panel-body">
  96. <p>
  97. <a href="play" class="btn btn-info btn-lg" target="_blank"><i class="glyphicon glyphicon-play"></i>&nbsp;&nbsp;Lancer votre partie</a>
  98. <p>
  99. <hr />
  100. <p>
  101. <a data-toggle="modal" data-target="#modal_new_player" class="btn btn-default btn-lg"><i class="glyphicon glyphicon-plus"></i>&nbsp;&nbsp;Créer un joueur</a>
  102. </p>
  103. <hr />
  104. <p>
  105. <a href="#" class="btn btn-default btn-lg disabled"><i class="glyphicon glyphicon-import"></i>&nbsp;&nbsp;Importer un joueur (.XML)</a>
  106. </p>
  107. <hr />
  108. <p>
  109. <div class="btn-group">
  110. <a href="#" class="btn btn-default btn-lg dropdown-toggle disabled" data-toggle="dropdown">
  111. <i class="glyphicon glyphicon-music"></i>&nbsp;&nbsp;Changer les musiques
  112. <span class="caret"></span>
  113. </a>
  114. <ul class="dropdown-menu">
  115. <li><a href="#" style="color:#CCC;"><i class="glyphicon glyphicon-music"></i>&nbsp;&nbsp;SOFT</a></li>
  116. <li class="divider"></li>
  117. <li><a href="#" style="color:#AAA;"><i class="glyphicon glyphicon-music"></i>&nbsp;&nbsp;TONIC</a></li>
  118. <li class="divider"></li>
  119. <li><a href="#" style="color:#000;"><i class="glyphicon glyphicon-music"></i>&nbsp;&nbsp;HARD</a></li>
  120. <li class="divider"></li>
  121. <li><a href="#" style="color:#ADDFFF;"><i class="glyphicon glyphicon-music"></i>&nbsp;&nbsp;LIGHT</a></li>
  122. <li class="divider"></li>
  123. <li><a href="#" style="color:#8128B5;"><i class="glyphicon glyphicon-music"></i>&nbsp;&nbsp;DARK</a></li>
  124. </ul>
  125. </div>
  126. </p>
  127. <hr />
  128. <p>
  129. <a data-toggle="modal" data-target="#modal_change_map" class="btn btn-default btn-lg"><i class="glyphicon glyphicon-map-marker"></i>&nbsp;&nbsp;Changer la carte</a>
  130. </p>
  131. </div>
  132. </div>
  133. </div>
  134. <div class="col-lg-7">
  135. <div class="panel panel-default">
  136. <div class="panel-heading"><i class="glyphicon glyphicon-user"></i>&nbsp;&nbsp;<strong>Joueurs présents dans votre partie :</strong></div>
  137. <div class="panel-body">
  138. <table class="table table-striped table-hover ">
  139. <thead>
  140. <tr>
  141. <th></th>
  142. <th>Nom</th>
  143. <th><i class="glyphicon glyphicon-heart" style="color:red;"></i></th>
  144. <th><i class="glyphicon glyphicon-flash" style="color:#FFD700;"></i></th>
  145. <th><i class="glyphicon glyphicon-fire" style="color:#28b62c"></i></th>
  146. <th><i class="glyphicon glyphicon-fire" style="color:#158cba"></i></th>
  147. <th><i class="glyphicon glyphicon-fire" style="color:#ffd000"></i></th>
  148. <th><i class="glyphicon glyphicon-fire" style="color:#ff4136"></i></th>
  149. <th><i class="glyphicon glyphicon-fire" style="color:#ADDFFF"></i></th>
  150. <th><i class="glyphicon glyphicon-fire" style="color:#8128B5"></i></th>
  151. </tr>
  152. </thead>
  153. <tbody>
  154. <?php
  155. // nombre de gamers
  156. $f = 0;
  157. foreach(glob('*.xml') as $f) {$f+=1;}
  158. $nb_membres = count(glob('./medias/'.$hash.'/*.xml'));
  159. // liste des gamers
  160. $folder = "./medias/".$hash."/";
  161. $dossier = opendir($folder);
  162. while ($fichier = readdir($dossier))
  163. {
  164. if ($fichier != "." && $fichier != ".." && $fichier != "map.jpg" && $fichier != "soft.mp3" && $fichier != "tonic.mp3" && $fichier != "hard.mp3" && $fichier != "light.mp3" && $fichier != "dark.mp3")
  165. {
  166. $gamers = explode(".xml", $fichier);
  167. $xml = simplexml_load_file('./medias/'.$hash.'/'.$fichier);
  168. if (!isset($itemnb)) {
  169. $itemnb=0;
  170. } else {
  171. $itemnb++;
  172. }
  173. foreach($xml->entry as $entry) {
  174. echo '<tr class="active">
  175. <td><a href="del.php?player='.$fichier.'" class="btn btn-danger btn-xs"><i class="glyphicon glyphicon-trash"></i></a>&nbsp;&nbsp;<a href="./medias/'.$hash.'/'.$fichier.'" target="_blank" class="btn btn-success btn-xs"><i class="glyphicon glyphicon-export"></i></a></td>
  176. <td>'.$entry->nom.'</td>
  177. <td>'.$entry->hp.'</td>
  178. <td>'.$entry->xp.'</td>
  179. <td>'.$entry->ecos->verte.'</td>
  180. <td>'.$entry->ecos->bleue.'</td>
  181. <td>'.$entry->ecos->jaune.'</td>
  182. <td>'.$entry->ecos->rouge.'</td>
  183. <td>'.$entry->ecos->blanche.'</td>
  184. <td>'.$entry->ecos->noire.'</td>
  185. </tr>';
  186. }
  187. }
  188. }
  189. closedir($dossier);
  190. ?>
  191. </tbody>
  192. </table>
  193. </div>
  194. </div>
  195. </div>
  196. <div class="col-lg-1"></div>
  197. </div>
  198. <div class="modal fade" id="modal_new_player">
  199. <div class="modal-dialog">
  200. <div class="modal-content">
  201. <form class="form-horizontal well" role="form" method="post" action="new_player.php" enctype="multipart/form-data">
  202. <div class="modal-header">
  203. <a type="button" class="close" data-dismiss="modal" aria-hidden="true" style="color:black;">X</a>
  204. <h4 class="modal-title"><i class="glyphicon glyphicon-log-in"></i>&nbsp;&nbsp;NOUVEAU JOUEUR</h4>
  205. </div>
  206. <div class="modal-body">
  207. <div class="form-group">
  208. <label class="control-label" for="focusedInput">Nom :</label>
  209. <input class="form-control" id="focusedInput" type="text" name="player_name" value="Derpy">
  210. </div>
  211. <div class="form-group">
  212. <label class="control-label" for="focusedInput">Nombre d'XP</label>
  213. <div class="input-group">
  214. <span class="input-group-addon"><i class="glyphicon glyphicon-flash" style="color:#FFD700;";></i></span>
  215. <select class="form-control" id="focusedInput" name="player_xp">
  216. <option>0</option>
  217. <option>10</option>
  218. <option>50</option>
  219. <option>100</option>
  220. <option>999</option>
  221. </select>
  222. </div>
  223. </div>
  224. </div>
  225. <div class="modal-footer">
  226. <button type="submit" class="btn btn-info">Création du joueur</button>
  227. </div>
  228. </form>
  229. </div>
  230. </div>
  231. </div>
  232. <div class="modal fade" id="modal_change_map">
  233. <div class="modal-dialog">
  234. <div class="modal-content">
  235. <form class="form-horizontal well" role="form" method="post" action="" enctype="multipart/form-data">
  236. <div class="modal-header">
  237. <a type="button" class="close" data-dismiss="modal" aria-hidden="true" style="color:black;">X</a>
  238. <h4 class="modal-title"><i class="glyphicon glyphicon-map-marker"></i>&nbsp;&nbsp;CHANGER LA CARTE</h4>
  239. </div>
  240. <div class="modal-body">
  241. <?php
  242. if($_POST){
  243. $url_map = $_POST['url_map'];
  244. $name = basename($url_map);
  245. list($txt, $ext) = explode(".", $name);
  246. $name = "map.jpg";
  247. if($ext == "jpg"){
  248. $upload = file_put_contents("./medias/".$name,file_get_contents($url_map));}}
  249. ?>
  250. <h4>Entrez le lien du fichier. Seul les fichiers <strong>.jpg</strong> sont autorisés.</h4>
  251. <label class="control-label" for="focusedInput">URL :</label>
  252. <input class="form-control" id="focusedInput" type="text" name="url_map" value="http://ecomonde/medias/default/map.jpg">
  253. </div>
  254. <div class="modal-footer">
  255. <button type="submit" class="btn btn-info">Mise à jour de la carte</button>
  256. </div>
  257. </form>
  258. </form>
  259. </div>
  260. </div>
  261. </div>
  262. <?php elseif($status == 0): ?>
  263. <div class="container-fluid">
  264. <div class="col-lg-1"></div>
  265. <div class="col-lg-5">
  266. <h2>Présentation</h2>
  267. <p><strong>EcoMonde est un Jeu de Rôle d'aventure interactif.</strong></p>
  268. <p class="text-success">Celui-ci dispose d'une interface de jeu permetant au Maître du Jeu de contrôler la partie directement sans avoir besoin de matériel.</p>
  269. <p class="text-primary">Le jeu ne requière qu'un PC relié à internet et de quelques dés. Tout est automatisé.</p>
  270. <p class="text-warning">Le Maître du Jeu peut ensuite créer sa partie en s'appuyant sur tout les outils existants.</p>
  271. <p class="text-danger">Un <a href="http://wiki.ecomonde.land"><i class="glyphicon glyphicon-book"></i>&nbsp;&nbsp;WIKI</a> est à disposition pour un plus grand partage des ressources.</p>
  272. </div>
  273. <div class="col-lg-5">
  274. <h2>Créer un compte</h2>
  275. <form class="form-horizontal well" role="form" method="post" action="register.php" enctype="multipart/form-data">
  276. <fieldset>
  277. <div class="form-group">
  278. <label for="pseudo" class="col-lg-3 control-label">Pseudo</label>
  279. <div class="col-lg-9">
  280. <input type="text" class="form-control" name="pseudo" placeholder="Pseudo">
  281. </div>
  282. </div>
  283. <div class="form-group">
  284. <label for="Email" class="col-lg-3 control-label">E-mail</label>
  285. <div class="col-lg-9">
  286. <input type="text" class="form-control" name="email" placeholder="E-mail">
  287. </div>
  288. </div>
  289. <div class="form-group">
  290. <label for="password" class="col-lg-3 control-label">Mot de passe</label>
  291. <div class="col-lg-9">
  292. <input type="password" class="form-control" name="pass" placeholder="Mot de passe">
  293. </div>
  294. </div>
  295. <div class="form-group">
  296. <div class="col-lg-9 col-lg-offset-3">
  297. <button type="submit" class="btn btn-primary"><i class="glyphicon glyphicon-ok"></i>&nbsp;&nbsp;OK</button>
  298. </div>
  299. </div>
  300. </fieldset>
  301. </form>
  302. </div>
  303. <div class="col-lg-1"></div>
  304. </div>
  305. <div class="modal fade" id="modal_login">
  306. <div class="modal-dialog">
  307. <div class="modal-content">
  308. <form class="form-horizontal well" role="form" method="post" action="session.php" enctype="multipart/form-data">
  309. <div class="modal-header">
  310. <a type="button" class="close" data-dismiss="modal" aria-hidden="true" style="color:black;">X</a>
  311. <h4 class="modal-title"><i class="glyphicon glyphicon-log-in"></i>&nbsp;&nbsp;CONNEXION</h4>
  312. </div>
  313. <div class="modal-body">
  314. <div class="form-group">
  315. <label class="control-label" for="focusedInput">Email :</label>
  316. <input class="form-control" id="focusedInput" type="text" name="email">
  317. </div>
  318. <div class="form-group">
  319. <label class="control-label" for="focusedInput">Mot de passe :</label>
  320. <input class="form-control" id="focusedInput" type="password" name="password">
  321. </div>
  322. </div>
  323. <div class="modal-footer">
  324. <a href="mailto:contact@heuzef.com?subject=Contact%20depuis%20heuzef.com" onclick="window.open('https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=contact@heuzef.com&amp;cc=&amp;bcc=&amp;su=[EcoMonde]%20Probleme%20avec%20mon%20compte&amp;body=Bonjour,','_blank');return false;">Un problème avec votre compte ?</a>
  325. &nbsp;&nbsp;<button type="submit" class="btn btn-info">Connexion</button>
  326. </div>
  327. </form>
  328. </div>
  329. </div>
  330. </div>
  331. <?php endif; ?>
  332. <script src="./js/jquery-1.10.2.min.js"></script>
  333. <script src="./js/bootstrap.min.js"></script>
  334. <script src="./js/bootswatch.js"></script>
  335. </body>
  336. </html>