@props(['demographyconfigId','moduleid','mandatory','results']) @php $Field=DB::table('DemographyConfig')->where('DemographyConfigId',$demographyconfigId)->get()->first(); $DisplayName=$Field->LabelValue; $ColumnName=$Field->ColumnName; $DropDownNameId=$Field->DropDownNameId; $DependentField=$Field->DependentField; use App\Models\Demography; $DependentFieldId=explode(",",$Field->DependentFieldId); $DependentFieldColumnName=""; $DependentFieldColumnNameValue=""; try { if($DependentFieldId[0]) { $DependentFieldColumnName=Demography::GetDependentFieldColumnName($moduleid,$DependentFieldId[0]); $DependentFieldColumnNameValue=$results->$DependentFieldColumnName; } } catch(\Exception $e){} $parentDropDownListValues=[]; $LabelValue=$results->$ColumnName; $DropDownNameData=DB::table('DropDownNames')->where('DropDownNameId',$DropDownNameId)->get()->First(); $ParentDropDownNameId=$DropDownNameData->ReferenceID; $ParentColumnValue=""; if($ParentDropDownNameId) { $ParentColumn=DB::table('DemographyConfig')->where('ModuleId',$moduleid)->where('DropDownNameId',$ParentDropDownNameId)->get(['ColumnName'])->first(); $ParentColumnName=$ParentColumn->ColumnName; } $DropdownsList=DB::table('DropDownLists')->where('DropDownNameId',$DropDownNameId)->where('DropDownListStatus',1)->get(['DropDownListId','DropDownListName','ReferenceID']); if($mandatory==1) { $ReruiredField="required"; $DisplayredStar="*"; } else { $ReruiredField=""; $DisplayredStar=""; } //print_r($parentDropDownListValues); $checkApi=explode("/",$_SERVER['REQUEST_URI']); $apiUrl=""; if(strtolower($checkApi[1])=="api") { $apiUrl="api/"; } if($DependentField==1) { if(in_array($DependentFieldColumnNameValue,$DependentFieldId)) { $displayHide=""; } else { $displayHide="displayHide"; $RequiredField=""; } } else { $displayHide=""; } @endphp