diff options
Diffstat (limited to 'views/search')
-rw-r--r-- | views/search/anime.html.php | 32 | ||||
-rw-r--r-- | views/search/index.html.php | 67 |
2 files changed, 28 insertions, 71 deletions
diff --git a/views/search/anime.html.php b/views/search/anime.html.php index 485e389..4d0332f 100644 --- a/views/search/anime.html.php +++ b/views/search/anime.html.php @@ -1,30 +1,10 @@ <?php +$this->styles($this->html->style('anime')); $this->styles($this->html->style('pagination')); ?> -<div class="container_12"> -<div class="grid_4"> -<h2> Search options </h2> -<hr /> -<?= $this->form->create(null, array('method' => 'get')); ?> - <?= $this->form->field('search', array('type' => 'textbox', 'class' => 'sidebar-search', 'style' => 'width:200px')); ?> - <?= $this->form->label('type', 'For:'); ?> - <?= $this->form->select('type', array('Anime' => 'Anime', - 'Manga' => 'Manga', - 'Kdrama' => 'Kdrama')); ?> - <?= $this->form->submit('Search', array('style' => 'width: 100px')); ?> -<?= $this->form->end(); ?> -</div> -<div class="grid_8"> -<h2>Search Results</h2> -<hr /> - <table class="table"> - <tr><th>img</th><th>Name</th><th>Episodes</th><th>Type</th><th>Score</th></tr> - <?php foreach($content as $item): ?> - <tr><td>"image"</td><td><a href="/anime/view/<?= $item->special_id ?>"><?= $item->title ?></a></td> <td><?= $item->episode_count ?></td><td><?= $item->view_type ?></td><td><?= $item->mal_score ?></td></tr> - <?php endforeach; ?> - </table> -<?=$this->Paginator->paginate(array('separator' => '', 'action' => 'index/anime')); ?> -</div> -<br class="cl"> -</div> +<?= $this->_render('element', 'search') ?> + +<h2>Anime Search Results</h2> +(search instead for ...) +<?= $this->_render('element', 'animetable', compact('anime')) ?> diff --git a/views/search/index.html.php b/views/search/index.html.php index ffdd82c..2afb320 100644 --- a/views/search/index.html.php +++ b/views/search/index.html.php @@ -1,51 +1,28 @@ <?php $this->styles($this->html->style('pagination')); +?> -//table helper -function table($data, array $headers = array(), array $options = array()) { - //Create the table - echo '<tr>'; - foreach ($headers as $k => $v) - { - echo "<th>$v</th>"; - } - echo "</tr>\n"; +<?= $this->_render('element', 'search', compact('anime')) ?> +<?= $this->Paginator->paginate(array('separator' => '')) ?> - foreach ($data as $item) - { - echo '<tr>'; - foreach($headers as $key => $value) - { - echo '<td>'; - echo $item->$key; - echo '</td>'; - } - echo "</tr>\n"; - } -} -?> +<table> +<th>Title</th> +<th>Date</th> +<th>Type</th> +<?php foreach ($content as $item): ?> + <tr> + <td> + <a href="/anime/view/<?= $item->special_id ?>"><?= $item->title ?></a> + </td> + <td> + <?= $item->aired ?> + </td> + <td> + <?= $item->view_type ?> + </td> + </tr> +<?php endforeach ?> +</table> -<div class="container_12"> -<div class="grid_4"> -<h2> Search options </h2> -<hr /> -<?= $this->form->create(null, array('method' => 'get')); ?> - <?= $this->form->field('search', array('type' => 'textbox', 'class' => 'sidebar-search', 'style' => 'width:200px')); ?> - <?= $this->form->label('type', 'For:'); ?> - <?= $this->form->select('type', array('Anime' => 'Anime', - 'Manga' => 'Manga', - 'Kdrama' => 'Kdrama')); ?> - <?= $this->form->submit('Search', array('style' => 'width: 100px')); ?> -<?= $this->form->end(); ?> -</div> -<div class="grid_8"> -<h2>Search Results</h2> -<hr /> - <table class="table"> - <?php table($content, $headers); ?> - </table> -<?=$this->Paginator->paginate(array('separator' => '', 'action' => 'index/anime')); ?> -</div> -<br class="cl"> -</div> +<?= $this->Paginator->paginate(array('separator' => '')) ?> |