@extends('index') @section("body") {{-- Redirect to login if no session --}} @if (!Session::get("username")) @else
| BRAND | MODEL | ASSET TAG | SERIAL NO | Remarks | STATUS | LOCATION | ACTION | ||
|---|---|---|---|---|---|---|---|---|---|
| {{$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') @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) @endif @endif | @if (Session::get('userlevel') === 'admin') @if ($Ad->status === 'Pending') @endif @endif |
| TYPE | DEPARTMENT | BRAND | MODEL | ASSET TAG | SERIAL NO | REMARKS | STATUS | LOCATION | ACTION | ||
|---|---|---|---|---|---|---|---|---|---|---|---|
| {{$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') @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) @endif @endif | @if (Session::get('userlevel') === 'admin') @if ($d->status === 'Pending') @endif @endif |
| ITEM | SERIAL NO | ASSET TAG | REMARKS | STATUS | LOCATION | ACTION | ||
|---|---|---|---|---|---|---|---|---|
| {{$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') @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) @endif @endif | @if (Session::get('userlevel') === 'admin') @if ($a->status === 'Pending') @endif @endif |