home.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <?php
  2. /**
  3. * Home view.
  4. *
  5. * Contains the view layout and some code to present the data.
  6. *
  7. * @category View
  8. * @property_read Home_Page $page The page model.
  9. */
  10. namespace swdb;
  11. ?>
  12. <!DOCTYPE html>
  13. <html lang='en'>
  14. <head>
  15. <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
  16. <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
  17. <title><?=$page->title?></title>
  18. <link rel='shortcut icon' href='<?=$page->favicon?>'/>
  19. <!-- CSS files -->
  20. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>ui.css'/>
  21. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>home.css'/>
  22. <!-- Meta tags -->
  23. <link rel='canonical' href='<?=$page->canonical?>'/>
  24. <link rel='author' href='<?=$page->author?>'/>
  25. <link rel='publisher' href='<?=$page->author?>'/>
  26. <meta name='description' content='<?=$page->description?>'/>
  27. <meta property='og:title' content='<?=$page->title?>'/>
  28. <meta property='og:url' content='<?=$page->canonical?>'/>
  29. <meta property='og:description' content='<?=$page->description?>'/>
  30. <meta property='og:image' content='<?=$page->icon?>'/>
  31. <meta property='og:site_name' content='<?=$page->name?>'/>
  32. <meta property='og:type' content='website'/>
  33. <meta property='og:locale' content='en'/>
  34. <meta name='twitter:card' content='summary'/>
  35. <meta name='twitter:title' content='<?=$page->title?>'/>
  36. <meta name='twitter:description' content='<?=$page->description?>'/>
  37. <meta name='twitter:image' content='<?=$page->icon?>'/>
  38. <meta name='twitter:url' content='<?=$page->canonical?>'/>
  39. <meta name='robots' content='index follow'/>
  40. </head>
  41. <body>
  42. <?php
  43. include __DIR__ . "/inc/header.php";
  44. ?>
  45. <section class='content'>
  46. <h2>
  47. <span>
  48. Summoners War DataBase
  49. </span>
  50. </h2>
  51. <article id='profile'>
  52. <h3>
  53. <span id='user_name'>
  54. <?=$page->name?>
  55. </span>
  56. <span id='user_level'>
  57. Lv. <?=$page->level?>
  58. <span id='user_exp'>
  59. (exp: <?=$page->experience?>)
  60. </span>
  61. </span>
  62. </h3>
  63. <?php
  64. if (isset($page->rep)){
  65. ?>
  66. <div id='rep' class='profile_section'>
  67. <h4>
  68. Rep. Monster
  69. </h4>
  70. <div class='monster_panel'>
  71. <?=HTML::unit_panel($page->rep)?>
  72. </div> <!-- .monster_panel -->
  73. </div>
  74. <?php
  75. } // if (isset($page->rep))
  76. ?>
  77. <div id='defense' class='profile_section'>
  78. <h4>
  79. Arena defense
  80. </h4>
  81. <?php
  82. $first = true;
  83. foreach ($page->defense as $defense){
  84. ?>
  85. <div class='monster_panel'>
  86. <?=HTML::unit_panel($defense)?>
  87. </div>
  88. <?php
  89. if ($first && isset($defense->unit->leader_skill) && ($defense->unit->leader_skill->area == $EFFECT_AREA["GENERAL"] || $defense->unit->leader_skill->area == $EFFECT_AREA["ARENA"])){
  90. ?>
  91. <div class='skill'>
  92. <img class='skill_img' title='<?=$defense->unit->leader_skill->create_description()?>' src='<?=$defense->unit->leader_skill->get_image()?>'/>
  93. </div>
  94. <?php
  95. }
  96. $first = false;
  97. }
  98. ?>
  99. </div>
  100. <div id='building' class='profile_section'>
  101. <h4>
  102. Buildings
  103. </h4>
  104. <?php
  105. $half = sizeof($page->building) / 2;
  106. $i = 0;
  107. foreach ($page->building as $building){
  108. if ($i == $half){
  109. ?>
  110. <br class='desktop'/>
  111. <?php
  112. }
  113. ?>
  114. <?=HTML::building_panel($building)?>
  115. <?php
  116. $i ++;
  117. }$i ++;
  118. ?>
  119. </div>
  120. <div id='decoration' class='profile_section'>
  121. <h4>
  122. Decorations
  123. </h4>
  124. <?php
  125. $half = sizeof($page->decoration) / 2;
  126. $i = 0;
  127. foreach ($page->decoration as $decoration){
  128. if ($i == $half){
  129. ?>
  130. <br class='desktop'/>
  131. <?php
  132. }
  133. ?>
  134. <?=HTML::building_panel($decoration)?>
  135. <?php
  136. $i ++;
  137. }
  138. ?>
  139. </div>
  140. <div class='inventory profile_section' id='inventory_scroll'>
  141. <h4>
  142. Scrolls
  143. </h4>
  144. <?php
  145. $half = sizeof($page->building) / 2;
  146. $i = 0;
  147. foreach ($page->inventory_scroll as $item){
  148. if ($half > 6 && $i == $half){
  149. ?>
  150. <br class='desktop'/>
  151. <?php
  152. }
  153. ?>
  154. <?=HTML::item_panel($item)?>
  155. <?php
  156. $i ++;
  157. }
  158. ?>
  159. </div>
  160. <div class='inventory profile_section' id='inventory_craft_rune'>
  161. <h4>
  162. Rune crafting items
  163. </h4>
  164. <?php
  165. $prev = 0;
  166. foreach ($page->inventory_craft_rune as $item){
  167. if ($prev != 0 && $prev + 2000 < $item->id){
  168. ?>
  169. <br class='desktop'/>
  170. <?php
  171. }
  172. ?>
  173. <?=HTML::item_panel($item)?>
  174. <?php
  175. $prev = $item->id;
  176. }
  177. ?>
  178. </div>
  179. <div class='inventory profile_section' id='inventory_craft'>
  180. <h4>
  181. Other crafting items
  182. </h4>
  183. <?php
  184. $prev = 0;
  185. foreach ($page->inventory_craft as $item){
  186. if ($prev != 0 && $prev < 5000 && $item->id > 5000){
  187. ?>
  188. <br class='desktop'/>
  189. <?php
  190. }
  191. ?>
  192. <?=HTML::item_panel($item)?>
  193. <?php
  194. $prev = $item->id;
  195. }
  196. ?>
  197. </div>
  198. <div class='inventory profile_section' id='inventory_essence'>
  199. <h4>
  200. Essences
  201. </h4>
  202. <?php
  203. $prev = "";
  204. foreach ($page->inventory_essence as $item){
  205. if ($prev != "" && $prev != preg_split('/\s+/', $item->name)[2]){
  206. ?>
  207. <br class='desktop'/>
  208. <?php
  209. }
  210. ?>
  211. <?=HTML::item_panel($item)?>
  212. <?php
  213. $prev = preg_split('/\s+/', $item->name)[2];
  214. }
  215. ?>
  216. </div>
  217. <div id='currency' class='profile_section'>
  218. <h4>
  219. Currency
  220. </h4>
  221. <ul>
  222. <li>
  223. <img title='Energy' src='<?=URL::IMG["CURRENCY"]?>energy.png'/>
  224. <?=$page->currency["energy"]?> / <?=$page->currency["energy_max"]?>
  225. </li>
  226. <li>
  227. <img title='Arena Invitations' src='<?=URL::IMG["CURRENCY"]?>arenaenergy.png'/>
  228. <?=$page->currency["arena_energy"]?> / <?=$page->currency["arena_energy_max"]?>
  229. </li>
  230. <li>
  231. <img title='Dimensional Energy' src='<?=URL::IMG["CURRENCY"]?>dimensionenergy.png'/>
  232. <?=$page->currency["dimension_energy"]?> / <?=$page->currency["dimension_energy_max"]?>
  233. </li>
  234. <li>
  235. <img title='Dimensional Crystal' src='<?=URL::IMG["CURRENCY"]?>darkportalenergy.png'/>
  236. <?=$page->currency["darkportal_energy"]?> / <?=$page->currency["darkportal_energy_max"]?>
  237. </li>
  238. <li>
  239. <img title='Mana' src='<?=URL::IMG["CURRENCY"]?>mana.png'/>
  240. <?=$page->currency["mana"]?>
  241. </li>
  242. <li>
  243. <img title='Crystal' src='<?=URL::IMG["CURRENCY"]?>crystal.png'/>
  244. <?=$page->currency["crystal"]?>
  245. </li>
  246. <li>
  247. <img title='Social Points' src='<?=URL::IMG["CURRENCY"]?>socialpoint.png'/>
  248. <?=$page->currency["social_point"]?>
  249. </li>
  250. <li>
  251. <img title='Honor Points' src='<?=URL::IMG["CURRENCY"]?>honor.png'/>
  252. <?=$page->currency["honor_point"]?>
  253. </li>
  254. <li>
  255. <img title='Guild Points' src='<?=URL::IMG["CURRENCY"]?>guildpoint.png'/>
  256. <?=$page->currency["guild_point"]?>
  257. </li>
  258. <li>
  259. <img title='Honor Medals' src='<?=URL::IMG["CURRENCY"]?>badge.png'/>
  260. <?=$page->currency["honor_medal"]?>
  261. </li>
  262. <li>
  263. <img src='<?=URL::IMG["CURRENCY"]?>mark.png'/>
  264. <?=$page->currency["honor_mark"]?>
  265. </li>
  266. <li>
  267. <img title='Ancient Coins' src='<?=URL::IMG["CURRENCY"]?>ancientcoin.png'/>
  268. <?=$page->currency["event_coin"]?>
  269. </li>
  270. <li>
  271. <img title='Ancient Crystal' src='<?=URL::IMG["CURRENCY"]?>ancientstone.png'/>
  272. <?=$page->currency["ancient_stone"]?>
  273. </li>
  274. <li>
  275. <img title='Shapeshifting Stones' src='<?=URL::IMG["CURRENCY"]?>costumestone.png'/>
  276. <?=$page->currency["costume_point"]?>
  277. </li>
  278. </ul>
  279. </div>
  280. </article>
  281. </section>
  282. <?php
  283. include __DIR__ . "/inc/footer.php";
  284. ?>
  285. </body>
  286. </html>