@php
$getefile = DB::table('efileshares')->where('id', $getfileshare->id)->first();
@endphp
@php
$draftremarks = DB::table('draftremarks')->where('draft_id' , $getefile->draft_id)->get();
@endphp
Date: {{ \Carbon\Carbon::parse($getefile->created_at)->format('j F, Y') }}
Letter No.: {{ $getefile->doc_no }}
Title: {{ $getefile->subject }}
Received Department: {{ $getefile->rec_dep }}
Assigned Section: {{ $getefile->asigned_section }}
@php
$getname = DB::table('users')->where('id', $efile->sharefrom)->first();
$getsection = DB::table('departments')->where('id', $getname->department_id)->first();
@endphp
Created by: {{ $getname->name }} ({{$getname->jobtitle}}) - @if(isset($getsection)) {{$getsection->name}} @endif
@php
$draftre = DB::table('draftremarks')->where('draft_id' , $efile->draft_id)->orderBy('id', 'DESC')->first();
@endphp
@if(isset($draftre->user_id))
@php
$getuname = DB::table('users')->where('id', $draftre->user_id)->first();
@endphp
@endif
@if(isset($getuname, $draftre))
Last Activity: {{$getuname->name}} ({{$getuname->jobtitle}})
@endif
@php
$geteattachments = DB::table('draft_attachments')->where('draft_id', $getefile->id)->get();
@endphp
@foreach ($geteattachments as $geteattachment)
@if (str_contains($geteattachment->path, '.pdf'))
Attachment
@else
@endif
@endforeach
Action Taken:
Notings
@php
$getnottingsname = DB::table('users')->where('id', $getefile->sharefrom)->first();
@endphp
@if(isset($getnottingsname->name))
@if(isset($getefile->nottings))
{{$getnottingsname->name}} ({{$getnottingsname->jobtitle}}):({{ \Carbon\Carbon::parse($getefile->created_at)->format('d/m/y H:i') }} ) (1): {!!$getefile->nottings!!}
@endif
@endif
@php
$counter = 2;
@endphp
@foreach ($draftremarks as $draftremark)
@php
$getname = DB::table('users')->where('id', $draftremark->user_id)->first();
@endphp
@if(isset($draftremark->scale_id))
@if(Auth::user()->scale_level < 6)
@if(isset($draftremark->remark))
@if(str_contains($draftremark->remark, '.pdf'))
@if(isset($getname->name))
{{$getname->name}} ({{$draftremark->job_title}}): View Attachment {{ \Carbon\Carbon::parse($draftremark->created_at)->format('d/m/y H:i') }}
@endif
@else
@if(isset($getname->name))
{{$getname->name}} ({{$draftremark->job_title}}): @php echo $counter @endphp: {!! nl2br($draftremark->remark) !!} {{ \Carbon\Carbon::parse($draftremark->created_at)->format('d/m/y H:i') }}
@php
$counter++;
@endphp
@endif
@endif
@endif
@if(isset($draftremark->notify))
@if(isset($getname->name))
{{$getname->name}} ({{$draftremark->job_title}}): {{$draftremark->notify}}
@endif
@endif
@endif
@endif
@endforeach
@if(Auth::user()->jobtitle == 'Secretary')
Notify
@endif
@php
$notifycheck = DB::table('draftremarks')->where('draft_id' , $getefile->draft_id)->where('job_title' , "Secretary")->where('notify' , "Notify")->get();
@endphp
@if($notifycheck->count()>0 AND Auth::user()->jobtitle == 'Draftsman')
Notify
@endif
@php
$notifycheckAS = DB::table('draftremarks')->where('draft_id' , $getefile->draft_id)->where('job_title' , "Draftsman")->where('notify' , "Notify")->get();
$getSecretary = DB::table('users')->where('jobtitle', 'Draftsman')->where('odep_id', Auth::user()->odep_id)->first();
$getexistanceSecretary = DB::table('draftshares')->where('draft_id', $getefile->id)->where('touser', $getSecretary->id)->first();
@endphp
@if($notifycheckAS->count()>0 AND Auth::user()->jobtitle == 'AS')
Notify
@elseif(isset($getexistanceSecretary) AND Auth::user()->jobtitle == 'AS')
Notify
@endif
@php
$notifycheckDS = DB::table('draftremarks')->where('draft_id' , $getefile->draft_id)->where('job_title' , "AS")->where('notify' , "Notify")->get();
$getDraftsman = DB::table('users')->where('jobtitle', 'Draftsman')->where('odep_id', Auth::user()->odep_id)->first();
$getexistanceDraftsman = DB::table('draftshares')->where('draft_id', $getefile->id)->where('touser', $getDraftsman->id)->first();
$getSecretary = DB::table('users')->where('jobtitle', 'Draftsman')->where('odep_id', Auth::user()->odep_id)->first();
$getexistanceSecretary = DB::table('draftshares')->where('draft_id', $getefile->id)->where('touser', $getSecretary->id)->first();
@endphp
@if($notifycheckDS->count()>0 AND Auth::user()->jobtitle == 'DS')
Notify
@elseif(isset($getexistanceDraftsman) AND Auth::user()->jobtitle == 'DS')
Notify
@elseif(isset($getexistanceSecretary) AND Auth::user()->jobtitle == 'DS')
Notify
@endif
@php
$notifycheckSO = DB::table('draftremarks')->where('draft_id' , $getefile->draft_id)->where('job_title' , "DS")->where('notify' , "Notify")->get();
$getAS = DB::table('users')->where('jobtitle', 'AS')->where('odep_id', Auth::user()->odep_id)->first();
$getexistanceAS = DB::table('draftshares')->where('draft_id', $getefile->id)->where('touser', $getAS->id)->first();
$getDraftsman = DB::table('users')->where('jobtitle', 'Draftsman')->where('odep_id', Auth::user()->odep_id)->first();
$getexistanceDraftsman = DB::table('draftshares')->where('draft_id', $getefile->id)->where('touser', $getDraftsman->id)->first();
$getSecretary = DB::table('users')->where('jobtitle', 'Draftsman')->where('odep_id', Auth::user()->odep_id)->first();
$getexistanceSecretary = DB::table('draftshares')->where('draft_id', $getefile->id)->where('touser', $getSecretary->id)->first();
@endphp
@if($notifycheckSO->count()>0 AND Auth::user()->jobtitle == 'SO')
Notify
@elseif(isset($getexistanceAS) AND Auth::user()->jobtitle == 'SO')
Notify
@elseif(isset($getexistanceDraftsman) AND Auth::user()->jobtitle == 'SO')
Notify
@elseif(isset($getexistanceSecretary) AND Auth::user()->jobtitle == 'SO')
Notify
@endif
Add noting
@php
$quickreplies = DB::table('quickreplies')->get();
@endphp
@foreach ($quickreplies as $quickreply)
{{ $quickreply->name }}
@endforeach
Assigned Section:
{{ $getefile->asigned_section }}
@php
$getseclist = DB::table('departments')->get();
@endphp
@foreach ($getseclist as $seclist)
{{$seclist->name}}
@endforeach
Member to share
@if(Auth::user()->jobtitle == 'SC')
@php
$getuser = DB::table('users')->where('jobtitle', 'SO')->get();
@endphp
@foreach ($getuser as $getus)
@php
$getdept = DB::table('departments')->where('id', $getus->department_id)->first();
@endphp
@if(isset($getdept))
{{ Str::of($getus->name)->limit(110)->upper() }} (SO) - {{$getdept->name}}
@endif
@endforeach
@elseif(Auth::user()->jobtitle == 'SO')
@if($notifycheckSO->count()>0)
@php
$getuserSC = DB::table('users')->where('jobtitle', 'SC')->where('odep_id', Auth::user()->odep_id)->first();
$getuserexistanceSC = DB::table('draftshares')->where('draft_id', $getfileshare->id)->where('touser', $getuserSC->id)->first();
@endphp
@if(isset($getuserexistanceSC))
{{ Str::of($getuserSC->name)->limit(110)->upper() }} (SC)
@endif
@else
@php
$getuser = DB::table('users')->where('jobtitle', 'DS')->where('odep_id', Auth::user()->odep_id)->get();
@endphp
@foreach ($getuser as $getus)
@php
$getdept = DB::table('departments')->where('id', $getus->department_id)->first();
@endphp
{{ Str::of($getus->name)->limit(110)->upper() }} (DS) - {{$getdept->name}}
@endforeach
@endif
@elseif(Auth::user()->jobtitle == 'DS')
{{ Auth::user()->jobtitle}}
{{ Auth::user()->jobtitle}}{{ Auth::user()->jobtitle}}
@if($notifycheckDS->count()>0)
@php
$getuserSO = DB::table('users')->where('jobtitle', 'SO')->where('odep_id', Auth::user()->odep_id)->first();
$getuserexistanceSO = DB::table('draftshares')->where('draft_id', $getfileshare->id)->where('touser', $getuserSO->id)->first();
$getuserSC = DB::table('users')->where('jobtitle', 'SO')->where('odep_id', Auth::user()->odep_id)->first();
$getuserexistanceSC = DB::table('draftshares')->where('draft_id', $getfileshare->id)->where('touser', $getuserSC->id)->first();
@endphp
@if(isset($getuserexistanceSO))
{{ Str::of($getuserSO->name)->limit(110)->upper() }} (SO)
@elseif(isset($getuserexistanceSC))
{{ Str::of($getuserSC->name)->limit(110)->upper() }} (SC)
@endif
@else
@php
$getuser = DB::table('users')->where('jobtitle', 'AS')->where('odep_id', Auth::user()->odep_id)->get();
@endphp
@foreach ($getuser as $getus)
@php
$getdept = DB::table('departments')->where('id', $getus->department_id)->first();
@endphp
{{ Str::of($getus->name)->limit(110)->upper() }} (AS) - {{$getdept->name}}
@endforeach
@endif
@elseif(Auth::user()->jobtitle == 'AS')
@if($notifycheckAS->count()>0)
@php
$getuser = DB::table('users')->where('jobtitle', 'DS')->where('odep_id', Auth::user()->odep_id)->first();
$getuserexistance = DB::table('draftshares')->where('draft_id', $getfileshare->id)->where('touser', $getuser->id)->first();
$getuserSO = DB::table('users')->where('jobtitle', 'SO')->where('odep_id', Auth::user()->odep_id)->first();
$getuserexistanceSO = DB::table('draftshares')->where('draft_id', $getfileshare->id)->where('touser', $getuserSO->id)->first();
$getuserSC = DB::table('users')->where('jobtitle', 'SO')->where('odep_id', Auth::user()->odep_id)->first();
$getuserexistanceSC = DB::table('draftshares')->where('draft_id', $getfileshare->id)->where('touser', $getuserSC->id)->first();
@endphp
@if(isset($getuserexistance))
{{ Str::of($getuser->name)->limit(110)->upper() }} (DS)
@elseif(isset($getuserexistanceSO))
{{ Str::of($getuserSO->name)->limit(110)->upper() }} (SO)
@elseif(isset($getuserexistanceSC))
{{ Str::of($getuserSC->name)->limit(110)->upper() }} (SC)
@endif
@else
@php
$getuser = DB::table('users')->where('jobtitle', 'Draftsman')->where('odep_id', Auth::user()->odep_id)->get();
@endphp
@foreach ($getuser as $getus)
@php
$getdept = DB::table('departments')->where('id', $getus->department_id)->first();
@endphp
{{ Str::of($getus->name)->limit(110)->upper() }} (Draftsman) - {{$getdept->name}}
@endforeach
@endif
@elseif(Auth::user()->jobtitle == 'Draftsman')
@if($notifycheck->count()>0)
@php
$getuserAS = DB::table('users')->where('jobtitle', 'AS')->where('odep_id', Auth::user()->odep_id)->first();
$getuserexistanceAS = DB::table('draftshares')->where('draft_id', $getfileshare->id)->where('touser', $getuserAS->id)->first();
$getuser = DB::table('users')->where('jobtitle', 'DS')->where('odep_id', Auth::user()->odep_id)->first();
$getuserexistance = DB::table('draftshares')->where('draft_id', $getfileshare->id)->where('touser', $getuser->id)->first();
$getuserSO = DB::table('users')->where('jobtitle', 'SO')->where('odep_id', Auth::user()->odep_id)->first();
$getuserexistanceSO = DB::table('draftshares')->where('draft_id', $getfileshare->id)->where('touser', $getuserSO->id)->first();
$getuserSC = DB::table('users')->where('jobtitle', 'SO')->where('odep_id', Auth::user()->odep_id)->first();
$getuserexistanceSC = DB::table('draftshares')->where('draft_id', $getfileshare->id)->where('touser', $getuserSC->id)->first();
@endphp
@if(isset($getuserexistanceAS))
{{ Str::of($getuserAS->name)->limit(110)->upper() }} (AS)
@elseif(isset($getuserexistance))
{{ Str::of($getuser->name)->limit(110)->upper() }} (DS)
@elseif(isset($getuserexistanceSO))
{{ Str::of($getuserSO->name)->limit(110)->upper() }} (SO)
@elseif(isset($getuserexistanceSC))
{{ Str::of($getuserSC->name)->limit(110)->upper() }} (SC)
@endif
@else
@php
$getuser = DB::table('users')->where('jobtitle', 'Secretary')->where('odep_id', Auth::user()->odep_id)->get();
@endphp
@foreach ($getuser as $getus)
@php
$getdept = DB::table('departments')->where('id', $getus->department_id)->first();
@endphp
{{ Str::of($getus->name)->limit(110)->upper() }} (Secretary) - {{$getdept->name}}
@endforeach
@endif
@elseif(Auth::user()->jobtitle == 'Secretary')
@php
$getuserDF = DB::table('users')->where('jobtitle', 'Draftsman')->where('odep_id', Auth::user()->odep_id)->first();
$getuserexistanceDF = DB::table('draftshares')->where('draft_id', $getfileshare->id)->where('touser', $getuserDF->id)->first();
$getuserAS = DB::table('users')->where('jobtitle', 'AS')->where('odep_id', Auth::user()->odep_id)->first();
$getuserexistanceAS = DB::table('draftshares')->where('draft_id', $getfileshare->id)->where('touser', $getuserAS->id)->first();
$getuser = DB::table('users')->where('jobtitle', 'DS')->where('odep_id', Auth::user()->odep_id)->first();
$getuserexistance = DB::table('draftshares')->where('draft_id', $getfileshare->id)->where('touser', $getuser->id)->first();
$getuserSO = DB::table('users')->where('jobtitle', 'SO')->where('odep_id', Auth::user()->odep_id)->first();
$getuserexistanceSO = DB::table('draftshares')->where('draft_id', $getfileshare->id)->where('touser', $getuserSO->id)->first();
$getuserSC = DB::table('users')->where('jobtitle', 'SO')->where('odep_id', Auth::user()->odep_id)->first();
$getuserexistanceSC = DB::table('draftshares')->where('draft_id', $getfileshare->id)->where('touser', $getuserSC->id)->first();
@endphp
@if(isset($getuserexistanceDF))
{{ Str::of($getuserDF->name)->limit(110)->upper() }} (Draftsman)
@elseif(isset($getuserexistanceAS))
{{ Str::of($getuserAS->name)->limit(110)->upper() }} (AS)
@elseif(isset($getuserexistance))
{{ Str::of($getuser->name)->limit(110)->upper() }} (DS)
@elseif(isset($getuserexistanceSO))
{{ Str::of($getuserSO->name)->limit(110)->upper() }} (SO)
@elseif(isset($getuserexistanceSC))
{{ Str::of($getuserSC->name)->limit(110)->upper() }} (SC)
@endif
@else
Select Member
@endif
@foreach ($users as $user)
@php
$getdep = DB::table('departments')->where('id', $user->department_id)->first();
@endphp
{{ Str::of($user->name)->limit(110)->upper() }} ({{$user->jobtitle}}) @if(isset($getdep->name)) - {{$getdep->name}} @endif
@endforeach
@php
$getefile = DB::table('efileshares')->where('id', $getfileshare->id)->first();
@endphp