根據client_type登錄後我想在codeigniter中顯示儀表板。請幫忙。根據用戶類型登錄後將顯示儀表板
這裏是我的控制器登錄:
public function login()
{
$data['error'] ="Invalid Login";
$this->load->view('auth/header');
if($this->input->post())
{
$user = $this->UserModel->login($this->input->post());
if(count($user)>0)
{
$array = array(
'client_id' => $user['client_id'],
'email' => $user['email'],
'password' => $user['password'],
);
$this->session->set_userdata($array);
}
else
{
$data["error_message"]="Invalid User Name and Password combination";
}
//$this->UserModel->login($this->input->post());
//redirect(base_url('../fms'));
}
$this->load->view('auth/signin',$data);
$this->load->view('auth/footer');
}
是否有'client_type'在返回'$ user'?如果是的話,爲什麼不使用它來將用戶重定向到適當的儀表板?如果不是,那麼你應該存儲並返回那種信息。 – gdros
是的,有client_type_id – user3663
我有兩個client_types如果client_type_id是1它必須去管理儀表板和client_type_id是2它必須去用戶儀表板 – user3663