<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Dashboard extends CI_Controller {

	public function __construct()
    {
        parent::__construct();
        $this->load->model("UserModel");

		if($this->UserModel->isNotLogin()) {
			redirect(site_url('login'));
		} elseif(!($this->UserModel->isAdmin())) {
			redirect(site_url('dashboard'));
		} 
			
		
    }

	public function index()
	{
			if($this->input->get()){
				$get = $this->input->get();
				if(isset($get['pemilik'])){
					$data['del_pemilik']= $get['pemilik'];
				}
				$data['del_msg']= $get['del_msg'];
				
			}

			$data['user_logged'] = $this->session->userdata('user_logged');
			$data['data_pemilik'] = $this->UserModel->getUsers();
			$this->load->view('admin/dashboard',$data);
		
	}

	
}
