view.html.php 2.6 KB

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