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

class ADMIN_Controller extends Controller {
    function ADMIN_Controller()
    {
        parent::Controller();
        
        $this->load->helper('url');
        
        // 共通の処理をここに書く
        // ...
        
        $this->load->library('phpsession');
        
        $userid = $this->phpsession->get('userid');
        $usertype = $this->phpsession->get('usertype');
        if ($userid > 0 && $usertype != 'admin')
        {
            // 管理者ログインページへ
            // TODO
        }
        $box['loginbox'][1] = '<a href="' . site_url('admin/users/logout') . '">ログアウト</a>';
        $this->load->vars($box);
    }
}
?>