Browse Source

creer un joueur

master
heuzef 10 years ago
parent
commit
999820fbc8
7 changed files with 60 additions and 9 deletions
  1. +0
    -1
      del.php
  2. +23
    -2
      index.php
  3. +18
    -0
      medias/c0f08ae603e364cb554fe71c9fc94ffd/Afyaka.xml
  4. +1
    -1
      medias/c0f08ae603e364cb554fe71c9fc94ffd/Heuzef.xml
  5. +2
    -2
      medias/c0f08ae603e364cb554fe71c9fc94ffd/Tyrek.xml
  6. +3
    -3
      medias/c0f08ae603e364cb554fe71c9fc94ffd/Zycheron.xml
  7. +13
    -0
      new_player.php

+ 0
- 1
del.php View File

@@ -1,6 +1,5 @@
<?php
include "header.php";
$hash=md5($email);
unlink("medias/".$hash."/".$_GET['player']);
header("location:index.php");
?>

+ 23
- 2
index.php View File

@@ -97,7 +97,7 @@ $message[4]='
<p>
<hr />
<p>
<a href="#" class="btn btn-default btn-lg disabled"><i class="glyphicon glyphicon-plus"></i>&nbsp;&nbsp;Créer un joueur</a>
<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>
</p>
<hr />
<p>
@@ -197,9 +197,30 @@ $message[4]='
</div>
<div class="col-lg-1"></div>
</div>
<?php elseif($status == 0): ?>

<div class="modal fade" id="modal_new_player">
<div class="modal-dialog">
<div class="modal-content">
<form class="form-horizontal well" role="form" method="post" action="new_player.php" enctype="multipart/form-data">
<div class="modal-header">
<a type="button" class="close" data-dismiss="modal" aria-hidden="true" style="color:black;">X</a>
<h4 class="modal-title"><i class="glyphicon glyphicon-log-in"></i>&nbsp;&nbsp;NOUVEAU JOUEUR</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label class="control-label" for="focusedInput">Nom :</label>
<input class="form-control" id="focusedInput" type="text" name="player_name">
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-info">Création du joueur</button>
</div>
</form>
</div>
</div>
</div>

<?php elseif($status == 0): ?>

<div class="container-fluid">
<div class="col-lg-1"></div>


+ 18
- 0
medias/c0f08ae603e364cb554fe71c9fc94ffd/Afyaka.xml View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<response>
<entry>
<nom>Afyaka</nom>
<hp>10</hp>
<xp>20</xp>
<ecos>
<verte>0</verte>
<bleue>0</bleue>
<jaune>0</jaune>
<rouge>0</rouge>
<blanche>5</blanche>
<noire>0</noire>
</ecos>
<trans>light</trans>
<notes>...</notes>
</entry>
</response>

medias/c0f08ae603e364cb554fe71c9fc94ffd/player1.xml → medias/c0f08ae603e364cb554fe71c9fc94ffd/Heuzef.xml View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<response>
<entry>
<nom>player1</nom>
<nom>Heuzef</nom>
<hp>10</hp>
<xp>20</xp>
<ecos>

medias/c0f08ae603e364cb554fe71c9fc94ffd/player2.xml → medias/c0f08ae603e364cb554fe71c9fc94ffd/Tyrek.xml View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<response>
<entry>
<nom>player2</nom>
<nom>Tyrek</nom>
<hp>10</hp>
<xp>20</xp>
<xp>200</xp>
<ecos>
<verte>0</verte>
<bleue>0</bleue>

medias/c0f08ae603e364cb554fe71c9fc94ffd/player3.xml → medias/c0f08ae603e364cb554fe71c9fc94ffd/Zycheron.xml View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<response>
<entry>
<nom>player3</nom>
<nom>Zycheron</nom>
<hp>10</hp>
<xp>20</xp>
<ecos>
@@ -10,9 +10,9 @@
<jaune>0</jaune>
<rouge>0</rouge>
<blanche>0</blanche>
<noire>0</noire>
<noire>5</noire>
</ecos>
<trans>default</trans>
<trans>dark</trans>
<notes>...</notes>
</entry>
</response>

+ 13
- 0
new_player.php View File

@@ -0,0 +1,13 @@
<?php
include "header.php";
$player_name=$_POST['player_name'];
copy("medias/default/player1.xml", "medias/".$hash."/".$player_name.".xml");

$xml = simplexml_load_file('./medias/'.$hash.'/'.$player_name.'.xml');

$xml->entry->nom = $player_name;

$xml->asXml('./medias/'.$hash.'/'.$player_name.'.xml');

header("location: index.php");
?>

Loading…
Cancel
Save