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

class Admin extends CI_Controller {
	public function index()
	{
		$this->load->view('admin/login');
	}

	public function admin_login()
	{
		$this->load->view('admin/login');
	}
	
	public function admin_view() {
	    if(isset($_SESSION['username'])){
			$username = $_SESSION['username'];

			//Load Detail Profil
		    $this->load->model('M_login');
			$detail = $this->M_login->detailAdmin($username);
			$data['detail'] = $detail;

			//Load Para Alumni
			$this->load->model('M_alumni');
			$data['data_alumni'] = $this->M_alumni->tampil_data();

			//Load View
			$this->load->view('admin/header',$data);
			$this->load->view('admin/dashboard',$data);
			//$this->load->view('admin/revisi',$data);
			$this->load->view('admin/footer');
		}else{
			redirect('admin/admin_login');
		}
	}
}