@props(['demographyconfigId','result','rowid','moduleid']) @php use App\Models\Demography; $Field=DB::table('DemographyConfig')->where('DemographyConfigId',$demographyconfigId)->get()->first(); $DisplayName=$Field->LabelValue; $ColumnName=$Field->ColumnName; $LabelValue=$result->$ColumnName; $files = []; if (!empty($LabelValue)) { $ids = array_values(array_filter(array_map('trim', explode(',', (string) $LabelValue)))); if ($ids) { $rows = DB::table('TemporaryFiles') ->whereIn('TemporaryFilesId', $ids) ->where('DeletedStatus', 0) ->get(['TemporaryFilesId', 'FileName', 'FilePath']) ->keyBy('TemporaryFilesId'); foreach ($ids as $id) { if (isset($rows[$id])) { $files[] = [ 'id' => $id, 'name' => $rows[$id]->FileName ?? 'UnknownFile', 'path' => $rows[$id]->FilePath ?? '', ]; } } } } $DependentField=$Field->DependentField; $DependentFieldId=$Field->DependentFieldId; $displayColumn=1; if($DependentField && $DependentFieldId) { $DropdownResult=DB::table('DropDownLists')->where('DropDownListId',$DependentFieldId)->get(['DropDownNameId'])->first(); try { $dependentFieldDropdownId=$DropdownResult->DropDownNameId; $GetParentColumnName=DB::table('DemographyConfig')->where('ModuleId',$moduleid)->where('DisplayType','26')->where('DropDownNameId',$dependentFieldDropdownId)->get(['ColumnName'])->first(); $ParentColumnName=$GetParentColumnName->ColumnName; if($result->$ParentColumnName==$DependentFieldId) { $displayColumn=1; } else { $displayColumn=0; } } catch(\Exception $e){} } if($displayColumn) { $displayDiv="style=''"; } else { $displayDiv="style='display:none';"; } @endphp
@if(!empty($files)) @endif