@php echo "
";
	//print_r($fieldsList);
	//print_r($results);
	
	$results_obj = $results;
echo "
"; use \Str as Str; $RowId=(string)Str::uuid(); $UniqueReferenceId = ''; // Get UniqueReferenceId from existing document upload fields foreach($fieldsList as $field) { if($field->DisplayType == 16) { // Document upload type $columnName = $field->ColumnName; try { $existingValue = $results_obj->$columnName ?? ''; if(!empty($existingValue)) { // Get UniqueReferenceId from first file $fileIds = array_filter(array_map('trim', explode(',', $existingValue))); if(!empty($fileIds)) { $firstFile = DB::table('TemporaryFiles') ->where('TemporaryFilesId', $fileIds[0]) ->where('DeletedStatus', 0) ->first(['UniqueReferenceId']); if($firstFile) { $UniqueReferenceId = $firstFile->UniqueReferenceId; break; } } } } catch(\Exception $e) {} } } // If no existing UniqueReferenceId found, generate new one if(empty($UniqueReferenceId)) { $UniqueReferenceId = (string)Str::uuid(); } //$PanelType=0; try { $AllowedTypes=[]; $AllowedResults=DB::table('AllowedFileTypes')->where('ActiveStatus',1)->where('FileType',1)->get(['FileExtention']); foreach($AllowedResults as $Ar) { $AllowedTypes[]=$Ar->FileExtention; } } catch(\Exception $e) { $AllowedTypes=['text/html','text/plain']; } $acceptedFileTypes=json_encode($AllowedTypes); $ValidateacceptedFileTypes=implode(",",$AllowedTypes); try { $AllowedImageTypes=[]; $AllowedResults=DB::table('AllowedFileTypes')->where('ActiveStatus',1)->where('FileType',2)->get(['FileExtention']); foreach($AllowedResults as $Ar) { $AllowedImageTypes[]=$Ar->FileExtention; } } catch(\Exception $e) { $AllowedImageTypes=['image/gif','image/jpeg','image/png','image/webp']; } $acceptedImageTypes=json_encode($AllowedImageTypes); @endphp
@if($PanelType==1)
@else
@endif
@foreach($fieldsList as $fieldList) @php $field_name=$fieldList->ColumnName; try{ $LabelValue = $results_obj->$field_name; } catch(\Exception $e){ $LabelValue=""; echo $e; } @endphp @endforeach