@extends('layouts.rti-layout') @section('title', 'KSRTC- RTI - Seat Allocation') @section('content')

Seat Allocation

Manage seat assignments for: {{ $user->name }}

@if(session('error')) @endif
{{ $user->name }}

{{ $user->email }}
{{ $user->mobile_number }}
{{ $user->gspark_id }}

{{ $user->is_active ? 'Active' : 'Inactive' }}

Total Seats: {{ $user->seats->count() }}
Active Seats: {{ $user->seats->where('pivot.is_active', true)->count() }}
Current Seats:
@php $activeSeats = $user->seats()->wherePivot('is_active', true)->get(); @endphp @if($activeSeats->count() > 0) @foreach($activeSeats as $seat) {{ $seat->name }} @if($seat->section && $seat->section->office) ({{ $seat->section->office->name }}) @endif @endforeach @else No Seat Assigned @endif
Assign Seat
@csrf
Seat Assignment History
@forelse($user->seats as $seat) @empty @endforelse
Seat Name Seat Code Section Office Role Status Assigned Date Relieved Date Action
{{ $seat->name }} {{ $seat->seat_code ?? 'N/A' }} {{ $seat->section->name ?? 'N/A' }} {{ $seat->section->office->name ?? 'N/A' }} {{ $seat->role->name ?? 'N/A' }} {{ $seat->pivot->is_active ? 'Active' : 'Inactive' }} {{ $seat->pivot->created_at ? $seat->pivot->created_at->format('d-m-Y H:i') : 'N/A' }} @if(!$seat->pivot->is_active && $seat->pivot->updated_at) {{ $seat->pivot->updated_at->format('d-m-Y H:i') }} @else - @endif @if($seat->pivot->is_active) @else @endif
No seat assignments found
Seat Relieving History
@php $relievedSeats = $user->seats->filter(function($seat) { return !$seat->pivot->is_active; }); @endphp @forelse($relievedSeats as $seat) @empty @endforelse
Seat Name Seat Code Section Office Role Status Assigned Date Relieved Date Relieved By
{{ $seat->name }} {{ $seat->seat_code ?? 'N/A' }} {{ $seat->section->name ?? 'N/A' }} {{ $seat->section->office->name ?? 'N/A' }} {{ $seat->role->name ?? 'N/A' }} Relieved {{ $seat->pivot->created_at ? $seat->pivot->created_at->format('d-m-Y H:i') : 'N/A' }} @if($seat->pivot->updated_at) {{ $seat->pivot->updated_at->format('d-m-Y H:i') }} @else N/A @endif @php $staffSeat = App\Models\StaffSeatMaster::where('user_id', $user->id) ->where('seat_id', $seat->id) ->where('is_active', false) ->first(); @endphp {{ $staffSeat && $staffSeat->updatedBy ? $staffSeat->updatedBy->name : 'System' }}
No relieving history found
@endsection @push('scripts') @endpush