This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Tasks_Model extends CI_Model | |
{ | |
public function __construct() | |
{ | |
parent:: __construct(); | |
} | |
public function get_tasks($month) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Tasks_Model extends CI_Model | |
{ | |
public function __construct() | |
{ | |
parent:: __construct(); | |
} | |
public function get_tasks($month) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$searchterm =$this->search_model->searchterm_handler($this->input->get_post('searchterm', TRUE)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function search | |
{ | |
$searchterm = $this->input->post('searchterm',TRUE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
{ |
NewerOlder