@extends('SuperAdmin.layout.layout') @section('title',"Employee") @section('page-name',"Employee") @section('page-detail',"All Employees Information") @section('pagelink', 'employee') @section('body')
| Employee Name | Employee ID | Department | Role | Category | Assigned Emojis | Join Date | Status | Action | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
@if (!empty($employee->image))
@if($latestEmoji->emoji->type === 'emoji')
{{ $latestEmoji->emoji->emoji_text }}
@else
@endif
{{ Str::limit($employee->name, 15) }} |
{{$employee->employee_id}} | @if($employee->department === null){{"Unspecfied"}} | @else{{$employee->department->name ?? 'N/A'}} | @endif @if($employee->role === null){{"Unspecfied"}} | @else{{$employee->role ?? 'N/A'}} | @endif @if($employee->category === null){{"Unspecfied"}} | @else{{ Str::limit($employee->category ?? 'N/A', 15) }} | @endif
@php
// Query emoji assignments - tenant_id can be Admin ID or SuperAdmin ID
$assignedEmojis = \App\Models\EmojiAssignment::with('emoji')
->where('assignable_id', $employee->employee_id)
->where('assignable_type', 'App\Models\Employee')
->whereIn('tenant_id', $adminIds ?? [$employee->tenant_id])
->orderBy('created_at', 'desc')
->take(3)
->get();
@endphp
@if($assignedEmojis->count() > 0)
@foreach($assignedEmojis as $assignment)
@else
None
@endif
@if($assignment->emoji->type === 'emoji')
{{ $assignment->emoji->emoji_text }}
@else
@endforeach
@php
$totalEmojiCount = \App\Models\EmojiAssignment::where('assignable_id', $employee->employee_id)->where('assignable_type', 'App\Models\Employee')->whereIn('tenant_id', $adminIds ?? [$employee->tenant_id])->count();
@endphp
@if($totalEmojiCount > 3)
+{{ $totalEmojiCount - 3 }}
@endif
|
{{ $employee->created_at->format('m-d-y') }} | @if($employee->status === '2') Active @elseif($employee->status === '1') Inactive @else Pending @endif |