<?php
# application/middleware/TestMiddleware.php

class Auth_payroll implements Luthier\MiddlewareInterface
{

    public function run($args = [])
    {
        $paket_arr = ci()->session->userdata('paket_arr');
        $allow     = explode(",", $args);

        $result          = false;
        $is_superadmin   = (ci()->session->userdata('level_user') == '1') ? true : false;
        $is_sales        = ci()->session->userdata('is_sales');
        $is_sales_atasan = ci()->session->userdata('is_sales_atasan');
        $is_sales_admin  = ci()->session->userdata('is_sales_admin');

        if ($paket_arr['sales_activity'] === true) {
            return;
        } else {
            redirect(route('page.not.found'));
        }
    }
}
