index.html.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. $this->styles($this->html->style('pagination'));
  3. //table helper
  4. function table($data, array $headers = array(), array $options = array()) {
  5. //Create the table
  6. echo '<tr>';
  7. foreach ($headers as $k => $v)
  8. {
  9. echo "<th>$v</th>";
  10. }
  11. echo "</tr>\n";
  12. foreach ($data as $item)
  13. {
  14. echo '<tr>';
  15. foreach($headers as $key => $value)
  16. {
  17. echo '<td>';
  18. echo $item->$key;
  19. echo '</td>';
  20. }
  21. echo "</tr>\n";
  22. }
  23. }
  24. ?>
  25. <div class="container_12">
  26. <div class="grid_4">
  27. <h2> Search options </h2>
  28. <hr />
  29. <?= $this->form->create(null, array('method' => 'get')); ?>
  30. <?= $this->form->field('search', array('type' => 'textbox', 'class' => 'sidebar-search', 'style' => 'width:200px')); ?>
  31. <?= $this->form->label('type', 'For:'); ?>
  32. <?= $this->form->select('type', array('Anime' => 'Anime',
  33. 'Manga' => 'Manga',
  34. 'Kdrama' => 'Kdrama')); ?>
  35. <?= $this->form->submit('Search', array('style' => 'width: 100px')); ?>
  36. <?= $this->form->end(); ?>
  37. </div>
  38. <div class="grid_8">
  39. <h2>Search Results</h2>
  40. <hr />
  41. <table class="table">
  42. <?php table($content, $headers); ?>
  43. </table>
  44. <?=$this->Paginator->paginate(array('separator' => '', 'action' => 'index/anime')); ?>
  45. </div>
  46. <br class="cl">
  47. </div>