function manage($page = 1) { $this->viewdata["function_title"] = _('Manage'); $comics = new Comic(); if ($this->input->post('search')) { $search = $this->input->post('search'); $comics->ilike('name', $search)->limit(20); $this->viewdata["extra_title"][] = _('Searching') . ': ' . htmlspecialchars($search); } $comics->order_by('name', 'ASC'); $comics->get_paged_iterated($page, 20); $data["comics"] = $comics; $this->viewdata["main_content_view"] = $this->load->view("admin/series/manage.php", $data, TRUE); $this->load->view("admin/default.php", $this->viewdata); }
public function search() { if (!$this->input->post('search')) { $this->template->title(_('Search')); $this->template->build('search_pre'); return TRUE; } $search = HTMLpurify($this->input->post('search'), 'unallowed'); $this->template->title(_('Search')); $comics = new Comic(); $comics->ilike('name', $search)->limit(20)->get(); foreach ($comics->all as $comic) { $comic->latest_chapter = new Chapter(); $comic->latest_chapter->where('comic_id', $comic->id)->order_by('created', 'DESC')->limit(1)->get()->get_teams(); } $this->template->set('search', $search); $this->template->set('comics', $comics); $this->template->build('search'); }