@extends('index') @section("body") {{-- Redirect to login if no session --}} @if (!Session::get("username")) @else

LIST OF ASSET




{{-- Search form --}}
@csrf
{{-- List of Computer Assets --}}

List of Computer/Laptop

@foreach($CompAsset as $Ad) @endforeach
Id BRAND MODEL ASSET TAG SERIAL NO Remarks STATUS LOCATION ACTION
{{$Ad->id}} {{$Ad->brand}} {{$Ad->model}} {{$Ad->assetTag}} {{$Ad->Serial_No}} {{$Ad->Remarks}} {{$Ad->status}} {{$Ad->location}} {{-- Display the request form if the asset is available --}} @if($Ad->status == 'Available')
@csrf
@elseif($Ad->status == 'In Use') Asset is currently in use. @endif
@if($Ad->status == 'In Use') {{-- Check if the logged-in user is the one who requested the asset --}} @php $assetHistory = DB::table('AssetHistory')->where('asset_id', $Ad->id) ->where('user_id', Session::get('user_id')) // Match with current user from session ->where('status', 'In Use') ->first(); @endphp @if($assetHistory)
@csrf
@endif @endif
@if (Session::get('userlevel') === 'admin') @if ($Ad->status === 'Pending')
@csrf
@endif @endif



{{-- List of Printer Assets --}}

List of Printer

@foreach($PrintAsset as $d) @endforeach
Id TYPE DEPARTMENT BRAND MODEL ASSET TAG SERIAL NO REMARKS STATUS LOCATION ACTION
{{$d->id}} {{$d->type}} {{$d->dept}} {{$d->brand}} {{$d->model}} {{$d->assetTag}} {{$d->Serial_No}} {{$d->remarks}} {{$d->status}} {{$d->location}} {{-- Display the request form if the asset is available --}} @if($d->status == 'Available')
@csrf
@elseif($d->status == 'In Use') Asset is currently in use. @endif
@if($d->status == 'In Use') {{-- Check if the logged-in user is the one who requested the asset --}} @php $assetHistory = DB::table('AssetHistory')->where('asset_id', $d->id) ->where('user_id', Session::get('user_id')) // Match with current user from session ->where('status', 'In Use') ->first(); @endphp @if($assetHistory)
@csrf
@endif @endif
@if (Session::get('userlevel') === 'admin') @if ($d->status === 'Pending')
@csrf
@endif @endif



{{-- List of Other Assets --}}

List of Other Assets

@foreach($Asset as $a) @endforeach
Id ITEM SERIAL NO ASSET TAG REMARKS STATUS LOCATION ACTION
{{$a->id}} {{$a->item}} {{$a->serial_no}} {{$a->assetTag}} {{$a->remarks}} {{$a->status}} {{$a->location}} {{-- Display the request form if the asset is available --}} @if($a->status == 'Available')
@csrf
@elseif($a->status == 'In Use') Asset is currently in use. @endif
@if($a->status == 'In Use') {{-- Check if the logged-in user is the one who requested the asset --}} @php $assetHistory = DB::table('AssetHistory')->where('asset_id', $a->id) ->where('user_id', Session::get('user_id')) // Match with current user from session ->where('status', 'In Use') ->first(); @endphp @if($assetHistory)
@csrf
@endif @endif
@if (Session::get('userlevel') === 'admin') @if ($a->status === 'Pending')
@csrf
@endif @endif
@endif @endsection {{--
--}}