Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

action.php 2.3 KiB

10 år sedan
10 år sedan
10 år sedan
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php include "../header.php";
  2. $nom_modif="";
  3. if (isset($_GET['entry'])) {
  4. $nom_modif = $_GET['entry'];
  5. } else {
  6. header("location: ./index.php");
  7. end;
  8. }
  9. $xml = simplexml_load_file('../medias/'.$hash.'/'.$nom_modif.'.xml');
  10. if (isset($_GET['hp_plus']) && $xml->entry->hp<10) {
  11. $xml->entry->hp++;
  12. }
  13. if (isset($_GET['hp_moins']) && $xml->entry->hp>0) {
  14. $xml->entry->hp--;
  15. }
  16. if (isset($_GET['xp_plus']) && $xml->entry->xp<99999) {
  17. $xml->entry->xp++;
  18. }
  19. if (isset($_GET['xp_moins']) && $xml->entry->xp>0) {
  20. $xml->entry->xp--;
  21. }
  22. if (isset($_GET['xp_plusplus']) && $xml->entry->xp<99989) {
  23. $xml->entry->xp+=10;
  24. }
  25. if (isset($_GET['xp_moinsmoins']) && $xml->entry->xp>9) {
  26. $xml->entry->xp-=10;
  27. }
  28. if (isset($_GET['eco_verte_plus']) && $xml->entry->ecos->verte<5) {
  29. $xml->entry->ecos->verte++;
  30. }
  31. if (isset($_GET['eco_verte_moins']) && $xml->entry->ecos->verte>0) {
  32. $xml->entry->ecos->verte--;
  33. }
  34. if (isset($_GET['eco_bleue_plus']) && $xml->entry->ecos->bleue<5) {
  35. $xml->entry->ecos->bleue++;
  36. }
  37. if (isset($_GET['eco_bleue_moins']) && $xml->entry->ecos->bleue>0) {
  38. $xml->entry->ecos->bleue--;
  39. }
  40. if (isset($_GET['eco_jaune_plus']) && $xml->entry->ecos->jaune<5) {
  41. $xml->entry->ecos->jaune++;
  42. }
  43. if (isset($_GET['eco_jaune_moins']) && $xml->entry->ecos->jaune>0) {
  44. $xml->entry->ecos->jaune--;
  45. }
  46. if (isset($_GET['eco_rouge_plus']) && $xml->entry->ecos->rouge<5) {
  47. $xml->entry->ecos->rouge++;
  48. }
  49. if (isset($_GET['eco_rouge_moins']) && $xml->entry->ecos->rouge>0) {
  50. $xml->entry->ecos->rouge--;
  51. }
  52. if (isset($_GET['eco_blanche_plus']) && $xml->entry->ecos->blanche<5) {
  53. $xml->entry->ecos->blanche++;
  54. }
  55. if (isset($_GET['eco_blanche_moins']) && $xml->entry->ecos->blanche>0) {
  56. $xml->entry->ecos->blanche--;
  57. }
  58. if (isset($_GET['eco_noire_plus']) && $xml->entry->ecos->noire<5) {
  59. $xml->entry->ecos->noire++;
  60. }
  61. if (isset($_GET['eco_noire_moins']) && $xml->entry->ecos->noire>0) {
  62. $xml->entry->ecos->noire--;
  63. }
  64. if (isset($_GET['trans_default'])) {
  65. $xml->entry->trans="default";
  66. }
  67. if (isset($_GET['trans_light'])) {
  68. $xml->entry->trans="light";
  69. }
  70. if (isset($_GET['trans_dark'])) {
  71. $xml->entry->trans="dark";
  72. }
  73. if (isset($_GET['edit_notes'])) {
  74. $xml->entry->notes = $_POST["notes"];
  75. }
  76. $xml->asXml('../medias/'.$hash.'/'.$nom_modif.'.xml');
  77. header("location: index.php");
  78. ?>