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 Lists extends CI_Controller { | |
private $limit = 10; | |
public function __construct() { | |
parent::__construct(); | |
if(!$this->session->userdata('logged_in')){ | |
//Set error | |
$this->session->set_flashdata('need_login', 'Sorry, you need to be logged in to view the List'); | |
redirect('home/index'); |
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 Home extends CI_Controller { | |
public function index(){ | |
if($this->session->userdata('logged_in')){ | |
//Get the logged in users id | |
$user_id = $this->session->userdata('user_id'); | |
//Get all lists from the model | |
// $this->load->library('/controllers/person'); to load the library | |
$data['person'] = $this->Person_model->list_all(); | |
//$data['lists'] = $this->List_model->get_all_lists($user_id); |