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

class LoginLogs extends CI_Controller {

    public function __construct()
    {
        parent::__construct();

        if (!isset($_SESSION['qurbani_user_id']) || ($_SESSION['qurbani_role'] != 'sa' && $_SESSION['qurbani_role'] != 'a')) {
            redirect('/admin');
        }

        $this->load->model('User_model', 'log');
    }

    public function index()
    {
        $data['logs'] = $this->log->get_all_logs();
        $data['title'] = 'User Login Logs';
        $data['mainContent'] = 'admin/login_logs/index';
        $this->load->view('admin/layout/master', $data);
    }
}
