<?php
require_once($global['root-model']."Crud.php");
$obj_crud = new Crud();

require_once($global['root-model']."Admin.php");
$obj_user = new Admin();

require_once($global['root-model']."Region.php");
$obj_region = new Region();

require_once($global['root-model']."Access.php");
$obj_access = new Access();

if(!isset($_GET['action'])){ 
    $O_status = isset($_GET['status']) ? $_GET['status'] : "open";

    $data_user = $obj_user->get_list_picker($obj_crud);
    $data_region = $obj_region->get_data_select($obj_crud);

    $acsp_create = $obj_access->check_access($obj_cruds,$_SESSION['admin_id'],'create_po');
    $acsp_export = $obj_access->check_access($obj_cruds,$_SESSION['admin_id'],'export_po');
    $acsp_admin_region = $obj_access->check_access($obj_cruds,$_SESSION['admin_id'],'show_admin_region');
    $acsp_hide_amount = $obj_access->check_access($obj_cruds,$_SESSION['admin_id'],'hide_amount');

    if($acsg_po != 1){
        header("Location:".$path['dashboard']);
    }
    
    if(isset($_SESSION['vmessage'])){
        foreach($_SESSION['vmessage'] as $svm){
            $vmessage[] = $svm;
        }
        unset($_SESSION['vmessage']);
    } else {
        $vmessage = "";
    }

    if(isset($_SESSION['valert'])){
        foreach($_SESSION['valert'] as $vlr){
            $valert[] = $vlr;
        }
        unset($_SESSION['valert']);
    } else {
        $valert = "";
    }
}
?>