[eluser]riwakawd[/eluser]
I would like to know. What is the best way to count the users that are online. And when I refresh page if any have logged out will recalculate the total.
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Dashboard_user_online extends MX_Controller {
public function __construct() {
parent::__construct();
$this->load->model('admin/dashboard/dashboard_user_online_model');
if ($this->session->userdata('isLogged')) {
return true;
} else {
redirect('admin');
}
}
public function index() {
$data['total_user_online'] = $this->dashboard_user_online_model->getTotalUserOnline();
return $this->load->view('dashboard/dashboard_user_online', $data);
}
}
Model
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Dashboard_user_online_model extends CI_Model {
public function getTotalUserOnline() {
}
}