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.

action.php 2.3 KiB

10 vuotta sitten
10 vuotta sitten
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?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('./gamers/'.$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('./gamers/'.$nom_modif.'.xml');
  77. header("location: index.php");
  78. ?>