@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) {{-- section content --}} @section('content') @include('layouts.navbars.auth.topnav', ['title' => ''])
| Action | No | {{-- retrieve table header --}} @foreach ($table_header as $header){{ $header->alias }} | @endforeach|||
|---|---|---|---|---|---|
|
@endif
|
{{ $table_detail->firstItem() + $loop->index }} | @foreach ($table_header as $field) @php $string = $field->field; @endphp @if ($field->type == 'number'){{ $detail->$string }} | @if ($field->note != '') @else @endif @if ($field->class == 'check-stock') @endif @elseif ($field->type == 'enum')
@if ($field->query != '')
@php $data_query = DB::select($field->query); @endphp
@if (Str::contains($field->class, 'select-multiple'))
Warning: Undefined variable $detail in /opt/lampp/htdocs/msjrekrutmen/resources/views/master/mstst2/list.blade.php on line 154 Warning: Undefined variable $string in /opt/lampp/htdocs/msjrekrutmen/resources/views/master/mstst2/list.blade.php on line 154 Warning: Attempt to read property "" on null in /opt/lampp/htdocs/msjrekrutmen/resources/views/master/mstst2/list.blade.php on line 154 @foreach ($data_query as $q) @php $sAsArray = array_values((array) $q); if (in_array($sAsArray[0], $multiple)) { $text = $text == '' ? $sAsArray[1] : $text . ',' . $sAsArray[1]; } @endphp @endforeach {{ $text != '' ? $text : $detail->$string ?? '-' }} @else @php $singleText = ''; @endphp @foreach ($data_query as $q) Warning: Undefined variable $q in /opt/lampp/htdocs/msjrekrutmen/resources/views/master/mstst2/list.blade.php on line 171 @if ($detail->$string == $sAsArray[0]) @php $singleText = $sAsArray[1]; @endphp @endif @endforeach {{ $singleText != '' ? $singleText : $detail->$string ?? '-' }} @endif @else {{ $detail->$string ?? '-' }} @endif |
@elseif ($field->type == 'json')
@if (filled($detail->$string))
@php
$jsonData = is_string($detail->$string)
? json_decode($detail->$string, true)
: $detail->$string;
$jsonValue = is_array($jsonData) ? $jsonData : [];
$uiConfig = [
'D' => [
'bg' => 'danger',
'text' => 'text-white',
], // Merah
'I' => [
'bg' => 'warning',
'text' => 'text-white',
], // Kuning
'S' => [
'bg' => 'success',
'text' => 'text-white',
], // Hijau
'C' => ['bg' => 'info', 'text' => 'text-white'], // Biru muda
];
@endphp
@if (!empty($jsonValue))
@foreach ($jsonValue as $item)
@if (is_array($item) && isset($item['type']) && isset($item['text']))
@php
$theme = $uiConfig[
$item['type']
] ?? [
'bg' => 'secondary',
'text' => 'text-white',
];
@endphp
@else
-
@endif
@else
-
@endif
{{ $item['type'] }}
{{ $item['text'] }}
@endif
@endforeach
|
@else
@if ($field->link != '') {{ $detail->$string }} @else {{ $detail->$string }} @endif | @endif @endforeach