@php $profileStaffId = $staff_id ?? $id ?? ''; $profileFirstName = $firstname ?? ''; $profileLastName = $lastname ?? ''; $profileStatus = $staff_status ?? ''; $profileFarm = $farm_nevecske ?? ''; if ($profileStaffId !== '') { $profileStaffRows = DB::select( 'SELECT firstname, lastname, status FROM ourstaffs WHERE BINARY stat = BINARY ? LIMIT 1', [$profileStaffId] ); if (!empty($profileStaffRows)) { $profileFirstName = base64_decode(\App\Http\Controllers\LogController::kodold_ki($profileStaffRows[0]->firstname)); $profileLastName = base64_decode(\App\Http\Controllers\LogController::kodold_ki($profileStaffRows[0]->lastname)); $profileStatus = $profileStaffRows[0]->status; } $profileFarmRows = DB::select( 'SELECT farm.farm_name FROM farm_staffs JOIN farm ON farm_staffs.farm_id = farm.id WHERE BINARY farm_staffs.staff_id = BINARY ? ORDER BY farm_staffs.id DESC LIMIT 1', [$profileStaffId] ); if (!empty($profileFarmRows)) { $profileFarm = $profileFarmRows[0]->farm_name; } } @endphp