view.html.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <h2 class="ribbon full"><a style="color: #FFFFFF" href="/profile/view/<?= $user->username ?>"><?= $user->username ?>'s</a> AnimeList</h2>
  2. <div class="triangle-ribbon"></div>
  3. <br class="cl" />
  4. <table class="table"><tr>
  5. <td><?= $this->html->link("Completed", "#finished", array('class' => 'anchorLink')); ?> </td>
  6. <td><?= $this->html->link("Watching", "#watching", array('class' => 'anchorLink')); ?> </td>
  7. <td><?= $this->html->link("Plans to Watch", "#planning", array('class' => 'anchorLink')); ?> </td>
  8. <td><?= $this->html->link("On-Hold", "#paused", array('class' => 'anchorLink')); ?> </td>
  9. <td><?= $this->html->link("Dropped", "#dropped", array('class' => 'anchorLink')); ?> </td>
  10. </tr>
  11. </table>
  12. <?php function tableHelper($input, &$t) {
  13. echo '<table class="table">';
  14. echo "<tr><th>Entry #</th><th>Anime Title</th><th>Score</th><th>Type</th><th>Progress</th></tr>";
  15. $i = 1;
  16. foreach ($input as $anime) {
  17. echo '<tr>';
  18. echo "<td> $i </td>";
  19. echo "<td> <a href=\"/anime/view/$anime->series_animedb_id/\">$anime->series_title </a></td>";
  20. echo "<td>";
  21. echo ($anime->my_score != 0) ? $anime->my_score : "-";
  22. echo "</td>";
  23. echo "<td> $anime->series_type </td>";
  24. echo "<td>";
  25. echo $anime->my_watched_episodes;
  26. echo "/";
  27. echo ($anime->series_episodes != 0) ? $anime->series_episodes : "-";
  28. echo "</td>";
  29. echo "</tr>";
  30. $i += 1;
  31. }
  32. echo "</table>";
  33. }
  34. ?>
  35. <div class="two_col container_12">
  36. <div class="grid_10">
  37. <?php if (isset($watching)): ?>
  38. <a name="watching" id="watching"><h2 class="ribbon">Watching</h2></a>
  39. <div class="triangle-ribbon"></div>
  40. <br class="cl" />
  41. </div>
  42. <div class="grid_2">
  43. <button class="large" style="margin-left:40px; margin-top:10px"><a href="/animelist/add?iframe=true&height=100%&width=100%">Add</a></button>
  44. </div>
  45. </div>
  46. <?php tableHelper($watching, $this); ?>
  47. <?php endif; ?>
  48. <?php if (isset($finished)): ?>
  49. <a name="finished" id="finished"><h2 class="ribbon">Finished Animes</h2></a>
  50. <div class="triangle-ribbon"></div>
  51. <br class="cl" />
  52. <?php tableHelper($finished, $this); ?>
  53. <?php endif; ?>
  54. <?php if (isset($planning)): ?>
  55. <a name="planning" id="planning"><h2 class="ribbon">Plans to Watch</h2></a>
  56. <div class="triangle-ribbon"></div>
  57. <br class="cl" />
  58. <?php tableHelper($planning, $this); ?>
  59. <?php endif; ?>
  60. <?php if(isset($paused)): ?>
  61. <a name="paused" id="paused"><h2 class="ribbon">Paused</h2></a>
  62. <div class="triangle-ribbon"></div>
  63. <br class="cl" />
  64. <?php tableHelper($paused, $this); ?>
  65. <?php endif; ?>
  66. <?php if (isset($dropped)): ?>
  67. <a name="dropped" id="dropped"><h2 class="ribbon">Dropped</h2></a>
  68. <div class="triangle-ribbon"></div>
  69. <br class="cl" />
  70. <?php tableHelper($dropped, $this); ?>
  71. <?php endif; ?>