summaryrefslogtreecommitdiffstats
path: root/views/search/index.html.php
diff options
context:
space:
mode:
authorraylu <raylu@mixpanel.com>2011-07-12 00:50:00 -0700
committerraylu <raylu@mixpanel.com>2011-07-12 00:50:00 -0700
commit657d270864c6f8f77d083fe4aa6ba636ecbbd372 (patch)
tree1dc4ecd23df4486f6ea637c608513dc87c1e1b50 /views/search/index.html.php
parentfa1c7d7646da4552dd5894f7c8440f89d1c10c53 (diff)
downloadotakuhub-657d270864c6f8f77d083fe4aa6ba636ecbbd372.tar.xz
rework a lot of search
/search will eventually search all /search/anime searches only anime
Diffstat (limited to 'views/search/index.html.php')
-rw-r--r--views/search/index.html.php67
1 files changed, 22 insertions, 45 deletions
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' => '')) ?>