Skip to content

Instantly share code, notes, and snippets.

@imran300
Created July 1, 2017 05:25
Show Gist options
  • Save imran300/0e1debc68aa4009382763c47817ab6c6 to your computer and use it in GitHub Desktop.
Save imran300/0e1debc68aa4009382763c47817ab6c6 to your computer and use it in GitHub Desktop.
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class dashboard extends MY_Controller
{
public function __construct()
{
parent::__construct();
//$this->settings = new stdClass();
//$cms_db = $this->load->database('forum', TRUE);
//$this->orang->cms_db = $this->load->database('forum', TRUE);
if ($this->session->userdata("user_id")) {
} else {
redirect(base_url() . 'index.php/users/login');
}
}
public function imran()
{
ini_set('display_errors', 1);
error_reporting(E_ALL);
// $this->load->database('forum',TRUE);
$this->load->model('orang');
$data['records'] = $this->orang->GetAll(NULL, NULL);
foreach ($data['records']->result() as $item) {
echo $item->User_ID;
}
//var_dump($data);
}
}
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Orang extends CI_Model
{
// public $cms_db;
public function __construct()
{
parent::__construct();
}
public function GetAll($limit, $offset)
{
return $this->model->get('orang',$limit,$offset);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment