<?php

if (empty($access_level) || ($access_level < 2 )) {
 return;
}

if (!empty($_GET['ino_user_id'])) {
// $$class->ino_user_id = $_GET['ino_user_id'];
 $$class->ino_user_id = filter_input(INPUT_GET, 'ino_user_id', FILTER_SANITIZE_NUMBER_INT);
 $$class = $$class->findBy_id($$class->ino_user_id);
}
////else if (empty($$class->ino_user_id) && !empty($_SESSION['user_id'])) {
// $$class->ino_user_id = $_SESSION['user_id'];
// $$class = $$class->findBy_id($$class->ino_user_id);
//}

if (!empty($ino_user->ino_user_id)) {
 $user_id = $ino_user->ino_user_id;
 
 $user_role_object = user_role::find_by_userId($user_id);
 $user_group_object = user_group::find_by_userId($user_id);
 if (empty($user_role_object)) {
  $user_role_object = array(new user_role());
 }
 if (empty($user_group_object)) {
  $user_group_object = array(new user_group());
 }

 //reference address
 $existing_address_arr = address_reference::find_by_reference_detailts('ino_user', $ino_user->ino_user_id);
} else {
 $user_role_object = array(new user_role());
 $user_group_object = array(new user_group());
}


if (!empty($$class->hr_employee_id)) {
 $emp_details = hr_employee::find_by_id($$class->hr_employee_id);
 if ($emp_details) {
  $$class->identification_id = $emp_details->identification_id;
  $$class->employee_name = $emp_details->first_name . ' ' . $emp_details->last_name;
 }
}

if (!empty($$class->ar_customer_id)) {
 $cust_details = ar_customer::find_by_id($$class->ar_customer_id);
 if ($cust_details) {
  $$class->customer_name = $cust_details->customer_name;
 }
}

if (!empty($$class->supplier_id)) {
 $supp_details = supplier::find_by_id($$class->supplier_id);
 if ($supp_details) {
  $$class->supplier_name = $supp_details->supplier_name;
 }
}



$allRoles = role_path::all_roles();
?>