@php # Get Current USER $loggedUser = strtoUpper(m3User()); $admin_users = $power_users = $csr = $execUser = ""; $UserCO = $UserWHS = $UserPL = ''; $WDWNAM = ''; $IC670MAllWHS = collect(); $m3Connection = config('m3.connection', 'pgsql'); $getUsers = []; if (\Illuminate\Support\Facades\Schema::connection($m3Connection)->hasTable('icm428m')) { $getUsers = DB::connection($m3Connection) ->table('icm428m') ->select('R428US', 'R428ADMUSR', 'R428PWRUSR', 'R428CO', 'R428PL', 'R428WH', 'R42811A', 'R42821A') ->where('R428US', $loggedUser) ->get(); } foreach ($getUsers as $key=>$user) { if(trim($user->R428ADMUSR)=="Y") { # Different logic from Qinclude version : this not an Array $admin_users=trim($user->R428ADMUSR); } if(trim($user->R428PWRUSR)=="Y") { # Different logic from Qinclude version : this not an Array $power_users=trim($user->R428PWRUSR); } if(trim($user->R42811A)=="C") { $csr="Y"; } if(trim($user->R42821A)=="Y") { $execUser="Y"; } $UserCO = $user->R428CO; $UserWHS = $user->R428WH; $UserPL = $user->R428PL; } # Get current WHS if ($UserCO !== '' && $UserPL !== '' && $UserWHS !== '' && \Illuminate\Support\Facades\Schema::connection($m3Connection)->hasTable('ic670m')) { $IC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m') ->select('WDWNAM') ->where('WDCO', $UserCO) ->where('WDPL', $UserPL) ->where('WDWHS', $UserWHS) ->first(); $WDWNAM = isset($IC670M->WDWNAM) ? trim($IC670M->WDWNAM) : ''; $IC670MAllWHS = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get(); } # Get the current route information $route = app('request')->route(); // dump($route); $pdfURL = str_ends_with($route?->uri() ?? '', 'M3GetPDFFromCache'); // dump("CSR:".$csr .' SDA:'.$pdfURL); $callingProgramPacking = app('request')->request->get('callingProgram')=='Packing' ? true : false; // dump($callingProgramPacking); @endphp
@include('m3::liberty-theme.partials.styles')

M3 INTEGRATION

@yield('title', 'M3')

@if($WDWNAM !== '')

{{ $WDWNAM }}

@endif
@yield('btn')
@hasSection('breadcrumb')
@yield('breadcrumb')
@endif
@if($csr === '' || ($csr === 'Y' && $pdfURL)) @yield('content') @else
403 - Unauthorized
@endif
@include('m3::liberty-theme.partials.scripts') @yield('scripts')