Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.82 KB | None | 0 0
  1. <?php
  2. $date = new DateTime();
  3. $ts = "?x=" . $date->getTimestamp();
  4. $typeId = $_GET["typeId"];
  5. ?>
  6. <!DOCTYPE html>
  7. <html>
  8. <head>
  9. <meta charset="UTF-8">
  10. <title>HARDAC - Character</title>
  11. <meta charset="utf-8" />
  12. <meta name="viewport" content="width=device-width, initial-scale=1">
  13. <link rel="stylesheet" href="css/themes/borg.css" />
  14. <link rel="stylesheet" href="css/themes/jquery.mobile.icons.min.css" />
  15. <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile.structure-1.4.5.min.css" />
  16. <link rel="stylesheet" type="text/css" href="css/hardac.css<?php echo $ts ?>" />
  17. <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
  18. <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
  19. <script type="text/javascript" src="js/index_data.js<?php echo $ts ?>"></script>
  20. <script type="text/javascript" src="js/hardac.js<?php echo $ts ?>"></script>
  21. </head>
  22. <body>
  23. <div data-role="page" id="CH-page">
  24. <link rel="stylesheet" type="text/css" href="css/character.css<?php echo $ts ?>" />
  25. <script type="text/javascript" src="js/character.js<?php echo $ts ?>"></script>
  26. <div data-role="header" data-position="fixed">
  27. <div class="ui-btn-left">
  28. <a href="#" data-rel="back" class="ui-btn ui-corner-all ui-btn-icon-notext ui-btn-inline ui-icon-carat-l">Back</a>
  29. <a href="index.php" class="ui-btn ui-corner-all ui-btn-icon-notext ui-btn-inline ui-icon-home"></a>
  30. </div>
  31. <h1>HARDAC - Character</h1>
  32. </div> <!-- data-role="header" -->
  33. <div class="ui-content" id="CH-content">
  34. <div>
  35. <div class="CH-picture">
  36. <img src="" alt="" name="CH-picture" id="CH-picture"/>
  37. </div>
  38. </div>
  39. <div data-role="field-contain">
  40. <label for="CH-player-name">Player Name:</label>
  41. <input type="text" name="CH-player-name" id="CH-player-name" placeholder="Player Name"/>
  42. </div>
  43. <div data-role="field-contain">
  44. <label for="CH-character-name">Character Name:</label>
  45. <input type="text" name="CH-character-name" id="CH-character-name" placeholder="Character Name"/>
  46. </div>
  47. <div data-role="field-contain">
  48. <label for="CH-creature-type" class="select">Creature Type:</label>
  49. <select name="CH-creature-type" id="CH-creature-type">
  50. <option value="0">Unknown</option>
  51. <option value="1">Changeling</option>
  52. <option value="2">Werewolf</option>
  53. </select>
  54. </div>
  55. <div data-role="field-contain">
  56. <label for="CH-virtue" class="select">Virtue:</label>
  57. <select name="CH-virtue" id="CH-virtue">
  58. <option value="0">Unknown</option>
  59. <option value="3">Charity</option>
  60. <option value="4">Faith</option>
  61. <option value="5">Fortitude</option>
  62. <option value="6">Hope</option>
  63. <option value="7">Justice</option>
  64. <option value="8">Prudence</option>
  65. <option value="9">Temperance</option>
  66. </select>
  67. </div>
  68. <div data-role="field-contain">
  69. <label for="CH-vice" class="select">Vice:</label>
  70. <select name="CH-vice" id="CH-vice">
  71. <option value="0">Unknown</option>
  72. <option value="10">Envy</option>
  73. <option value="11">Gluttony</option>
  74. <option value="12">Greed</option>
  75. <option value="13">Lust</option>
  76. <option value="14">Pride</option>
  77. <option value="15">Sloth</option>
  78. <option value="16">Wrath</option>
  79. </select>
  80. </div>
  81. <?php
  82. if ($typeId == 1) {
  83. include("changeling.php");
  84. } else if ($typeId == 2) {
  85. include("werewolf.php");
  86. }
  87. ?>
  88. </div>
  89. </div> <!-- class="ui-content" -->
  90. <div data-role="footer">
  91. </div> <!-- data-role="footer" -->
  92. </div> <!-- data-role="page" -->
  93. </body>
  94. </html>
  95.  
  96. var character = null;
  97. var player = null;
  98.  
  99. $(document).off("pageinit", "#CH-page").on("pageinit", "#CH-page", function (event) {
  100. var parameters = $(this).data("url").split("?")[1];
  101.  
  102. var characterId = getUrlParameter(parameters, "characterId"); // gets characterId either from jQM or browser url
  103. character = getCharacter(characterId);
  104. player = getPlayer(character.playerId);
  105.  
  106. fillSelect("CH-creature-type", character.typeId);
  107. fillSelect("CH-vice", character.viceId);
  108. fillSelect("CH-virtue", character.virtueId);
  109. if (player.picture) {
  110. $("#CH-picture").attr("src", "img/" + player.picture + "");
  111. }
  112. $("#CH-picture").attr("alt", player.name);
  113. $("#CH-player-name").val(player.name);
  114. $("#CH-character-name").val(character.name);
  115. $("#CH-page").trigger("create");
  116. });
  117.  
  118. function fillSelect(selectId, selectedId) {
  119. $("#" + selectId).each(function(){ $(this).val(selectedId); });
  120. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement