@@ -1,6 +1,5 @@ | |||||
<?php | <?php | ||||
include "header.php"; | include "header.php"; | ||||
$hash=md5($email); | |||||
unlink("medias/".$hash."/".$_GET['player']); | unlink("medias/".$hash."/".$_GET['player']); | ||||
header("location:index.php"); | header("location:index.php"); | ||||
?> | ?> |
@@ -97,7 +97,7 @@ $message[4]=' | |||||
<p> | <p> | ||||
<hr /> | <hr /> | ||||
<p> | <p> | ||||
<a href="#" class="btn btn-default btn-lg disabled"><i class="glyphicon glyphicon-plus"></i> 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> Créer un joueur</a> | |||||
</p> | </p> | ||||
<hr /> | <hr /> | ||||
<p> | <p> | ||||
@@ -197,9 +197,30 @@ $message[4]=' | |||||
</div> | </div> | ||||
<div class="col-lg-1"></div> | <div class="col-lg-1"></div> | ||||
</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> 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="container-fluid"> | ||||
<div class="col-lg-1"></div> | <div class="col-lg-1"></div> | ||||
@@ -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> |
@@ -1,7 +1,7 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||
<response> | <response> | ||||
<entry> | <entry> | ||||
<nom>player1</nom> | |||||
<nom>Heuzef</nom> | |||||
<hp>10</hp> | <hp>10</hp> | ||||
<xp>20</xp> | <xp>20</xp> | ||||
<ecos> | <ecos> |
@@ -1,9 +1,9 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||
<response> | <response> | ||||
<entry> | <entry> | ||||
<nom>player2</nom> | |||||
<nom>Tyrek</nom> | |||||
<hp>10</hp> | <hp>10</hp> | ||||
<xp>20</xp> | |||||
<xp>200</xp> | |||||
<ecos> | <ecos> | ||||
<verte>0</verte> | <verte>0</verte> | ||||
<bleue>0</bleue> | <bleue>0</bleue> |
@@ -1,7 +1,7 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||
<response> | <response> | ||||
<entry> | <entry> | ||||
<nom>player3</nom> | |||||
<nom>Zycheron</nom> | |||||
<hp>10</hp> | <hp>10</hp> | ||||
<xp>20</xp> | <xp>20</xp> | ||||
<ecos> | <ecos> | ||||
@@ -10,9 +10,9 @@ | |||||
<jaune>0</jaune> | <jaune>0</jaune> | ||||
<rouge>0</rouge> | <rouge>0</rouge> | ||||
<blanche>0</blanche> | <blanche>0</blanche> | ||||
<noire>0</noire> | |||||
<noire>5</noire> | |||||
</ecos> | </ecos> | ||||
<trans>default</trans> | |||||
<trans>dark</trans> | |||||
<notes>...</notes> | <notes>...</notes> | ||||
</entry> | </entry> | ||||
</response> | </response> |
@@ -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"); | |||||
?> |