Click here to Skip to main content
16,016,227 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi coders

i have an admin web app in codeigniter that works perfectly but wanted to customize it for each user to have a unique dashboard i.e user A dashboard,
user B dashboard, user C dashboard, etc see below for my code
in my controller folder
Auth.php

public function log(){

if($_POST){
$query = $this->login_model->validate_user();

//-- if valid
if($query){
$data = array();
foreach($query as $row){
$data = array(
'id' => $row->id,
'name' => $row->first_name,
'email' =>$row->email,
'role' =>$row->role,
'is_login' => TRUE
);
$this->session->set_userdata($data);
$url = base_url('admin/dashboard');

}
echo json_encode(array('st'=>1,'url'=> $url)); //--success
}else{
echo json_encode(array('st'=>0)); //-- error
}
}else{
$this->load->view('auth',$data);
}
}

What I have tried:

searching stackoverflow and google
Posted
Updated 24-Jul-20 16:28pm

1 solution

That is way beyond the QA, and even an article.

The concept is that you need to redesign your "method" of rendering a dashboard. Think of it as a grid; NxN grid. Each user can create widgets/components on the screen, you can store how those widget details (their ID, their location, etc.) are stored in the database.

Do not create (hand-craft) the dashboards manually. That will be cumbersome, and not everyone will enjoy a ready-made dashboard. If you do want to do that, create a few 5-7, and let users select from them (a radio-button based list).

But that is way beyond the scope of a QA, check out the guides and tutorials on how other platforms are doing this sort of thing.

One of such platform is with WordPress; they offer a nice control over the widgets: WordPress Widgets | WordPress.org[^]. Secondly, although Microsoft does not explain how to create the underlying framework for "widgets", but they offer a good SDK thought to their dashboard widgets; please see Add a dashboard widget - Azure DevOps | Microsoft Docs[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900