summaryrefslogtreecommitdiffstats
path: root/views/search/index.html.php
blob: ffdd82c1f7559a87ccae50e32d307b4c433dffe1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?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";


	foreach ($data as $item)
	{
		echo '<tr>';
		foreach($headers as $key => $value)
		{
			echo '<td>';
			echo $item->$key;
			echo '</td>';
		}
		echo "</tr>\n";
	}
}
?>

<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>