View calendar_model.php
<?php
class Tasks_Model extends CI_Model
{
public function __construct()
{
parent:: __construct();
}
public function get_tasks($month)
{
View search_model.php
<?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)
{
View welcome.php
<?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;
View search_model.php
<?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;
}
View welcome.php
<?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);
View tasks_model.php
<?php
class Tasks_Model extends CI_Model
{
public function __construct()
{
parent:: __construct();
}
public function get_tasks($month)
{
View helper.php
<?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'";
}
View handler.php
<?php
$searchterm =$this->search_model->searchterm_handler($this->input->get_post('searchterm', TRUE));
View searchterm.php
<?php
public function search
{
$searchterm = $this->input->post('searchterm',TRUE);
View Layout.php
<?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
{