Skip to content

Instantly share code, notes, and snippets.

<?php
class Tasks_Model extends CI_Model
{
public function __construct()
{
parent:: __construct();
}
public function get_tasks($month)
{
<?php
public function search($searchterm,$limit)
{
$sql = "SELECT * FROM Country
WHERE Continent LIKE '%" . $searchterm . "%' LIMIT " .$limit . ",20";
$q = $this->db->query($sql);
if($q->num_rows() > 0)
{
foreach($q->result() as $row)
{
<?php
public function search()
{
$searchterm = $this->search_model->searchterm_handler($this->input->get_post('searchterm', TRUE));
$limit = ($this->uri->segment(3) > 0)?$this->uri->segment(3):0;
$config['base_url'] = base_url() . 'welcome/search';
$config['total_rows'] = $this->search_model->search_record_count($searchterm);
$config['per_page'] = 20;
$config['uri_segment'] = 3;
<?php
public function search_record_count($searchterm)
{
$sql = "SELECT COUNT(*) As cnt FROM Country WHERE Continent LIKE '%" . $searchterm . "%'";
$q = $this->db->query($sql);
$row = $q->row();
return $row->cnt;
}
<?php
public function show()
{
$year = $this->uri->segment(3);
$month = $this->uri->segment(4);
$day = $this->uri->segment(5);
$date = $year . '-' . $month . '-' . $day;
$data['day'] = date('d/m/Y', strtotime($date));
$data['tasks'] = $this->tasks_model->day_tasks($date);
<?php
class Tasks_Model extends CI_Model
{
public function __construct()
{
parent:: __construct();
}
public function get_tasks($month)
{
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
function active($name, $number)
{
$ci = get_instance();
if($name == 'home' && $ci->uri->segment(2) == "" && $number == 1)
{
return "class='active'";
}
<?php
$searchterm =$this->search_model->searchterm_handler($this->input->get_post('searchterm', TRUE));
<?php
public function search
{
$searchterm = $this->input->post('searchterm',TRUE);
<?php
/**
* Layout management library based on:
* a library that used to be in the CodeIgniter Wiki*
* Extended layout placeholders and javascript and css files inclusion.
*/
class Layout
{