@php $userdetails = Auth::user(); $LoggedUser = $userdetails->name; $DateFormat = $userdetails->DateFormat; $TimeZone = $userdetails->TimeZone; $TimeFormat = $userdetails->TimeFormat; echo "
";
//print_r($results);
$results_obj = json_decode($results);
//print_r($ModuleId);
//print_r($field_names);
//print_r($SingleDuplicateId);
//print_r($k);
//print_r($header);
//print_r($results_obj);
echo "
"; @endphp
@foreach($header as $fieldList) @php $field_name=$fieldList['FieldName']; $LabelValue = $results_obj[0]->$field_name; @endphp @endforeach
@foreach($SingleDuplicateId as $DuplicateSingleId=>$vals) @endforeach
@foreach($header as $fieldList) @php $field_name=$fieldList['FieldName']; $DisplayName=$fieldList['DisplayName']; $DisplayType=$fieldList['DisplayType']; $DropDownNameId=$fieldList['DropDownNameId']; $ParentModuleId=$fieldList['ParentModuleId']; $LabelValue=$results_obj[0]->$field_name; @endphp @php if($DisplayType==2) { if(empty($ListBoxNamesIDs) || $DropDownNameId=='') { $LabelValue=""; //$LabelValue=$GetDropdownLists[$LabelValue]; } else { $ListBoxNamesIDVal=$DropDownNameId; if(array_key_exists($ListBoxNamesIDVal,$GetDropdownLists)) { $listBoxVal=$GetDropdownLists[$ListBoxNamesIDVal]; if(array_key_exists($LabelValue,$listBoxVal)) $LabelValue=$listBoxVal[$LabelValue]; } } } if($DisplayType==3) { if(empty($ListBoxNamesIDs) || $DropDownNameId=='') { $LabelValue=""; //$LabelValue=$GetDropdownLists[$LabelValue]; } else { $ListBoxNamesIDVal=$DropDownNameId; if(array_key_exists($ListBoxNamesIDVal,$GetDropdownLists)) { $listBoxVal=$GetDropdownLists[$ListBoxNamesIDVal]; $listArray=explode(",",$LabelValue); $LabelValue=""; foreach($listArray as $listVal) { if(array_key_exists($listVal,$listBoxVal)) $LabelValue.="
  • ".$listBoxVal[$listVal]."
  • "; } } } } if($DisplayType==5) { if(empty($ListBoxNamesIDs) || $DropDownNameId=='') { $LabelValue=""; //$LabelValue=$GetDropdownLists[$LabelValue]; } else { $ListBoxNamesIDVal=$DropDownNameId; if(array_key_exists($ListBoxNamesIDVal,$GetDropdownLists)) { $listBoxVal=$GetDropdownLists[$ListBoxNamesIDVal]; if(array_key_exists($LabelValue,$listBoxVal)) $LabelValue=$listBoxVal[$LabelValue]; } } } if($DisplayType==4 && $DateFormat!="" && $LabelValue!="") { // added on 28th April '21 //echo $LabelValue; if($LabelValue=="0000-00-00" || $LabelValue=="0000-00-00 00:00:00") $LabelValue=""; else $LabelValue = date("$DateFormat", strtotime($LabelValue)); } if($DisplayType==14 && $DateFormat!="" && $TimeFormat!="" && $LabelValue!="") { // updated on 16th Sept '21 if($LabelValue=="0000-00-00 00:00:00") { $LabelValue=""; } else { // added on 29th April '21 $datetime = new DateTime($LabelValue); $datetime->format("$DateFormat $TimeFormat"); $la_time = new DateTimeZone($TimeZone); //$datetime->setTimezone($la_time); $LabelValue = $datetime->format("$DateFormat $TimeFormat"); } } if($DisplayType==8 || $DisplayType==23) { // RelateTo $passArray=array("ModuleId"=>$LabelValue,"RowId"=>$field_name); $row_id=$LabelValue; if($LabelValue!="") { if(array_key_exists($LabelValue,$RelateModules)) { $LabelValue=$RelateModules[$LabelValue]; } } } if($DisplayType==25) { // Self RelateTo @endphp @foreach($selfRelatedList as $selfRelated) @php if($LabelValue==$selfRelated['key']) { $LabelValue=$selfRelated['value']; } @endphp @endforeach @php } if($DisplayType==15 && $LabelValue!="") { // AssignedTo if(array_key_exists($LabelValue,$AssignedToList)) $LabelValue=$AssignedToList[$LabelValue]['name']; } if($DisplayType==7 || $DisplayType==10) { // TextArea OR TextEditor, added on 6th May '21 $LabelValue=strip_tags($LabelValue); } @endphp @php for($i=1;$i<$k;$i++) { $coulmn1 = json_decode($coulmn[$i]); $displayColumn=$coulmn1[0]->$field_name; @endphp @php if($DisplayType==2) { if(empty($ListBoxNamesIDs) || $DropDownNameId=='') { $displayColumn=""; //$displayColumn=$GetDropdownLists[$displayColumn]; } else { $ListBoxNamesIDVal=$DropDownNameId; if(array_key_exists($ListBoxNamesIDVal,$GetDropdownLists)) { $listBoxVal=$GetDropdownLists[$ListBoxNamesIDVal]; if(array_key_exists($displayColumn,$listBoxVal)) $displayColumn=$listBoxVal[$displayColumn]; } } } if($DisplayType==3) { if(empty($ListBoxNamesIDs) || $DropDownNameId=='') { $displayColumn=""; //$displayColumn=$GetDropdownLists[$displayColumn]; } else { $ListBoxNamesIDVal=$DropDownNameId; if(array_key_exists($ListBoxNamesIDVal,$GetDropdownLists)) { $listBoxVal=$GetDropdownLists[$ListBoxNamesIDVal]; $listArray=explode(",",$displayColumn); $displayColumn=""; foreach($listArray as $listVal) { if(array_key_exists($listVal,$listBoxVal)) $displayColumn.="
  • ".$listBoxVal[$listVal]."
  • "; } } } } if($DisplayType==5) { if(empty($ListBoxNamesIDs) || $DropDownNameId=='') { $displayColumn=""; //$displayColumn=$GetDropdownLists[$displayColumn]; } else { $ListBoxNamesIDVal=$DropDownNameId; if(array_key_exists($ListBoxNamesIDVal,$GetDropdownLists)) { $listBoxVal=$GetDropdownLists[$ListBoxNamesIDVal]; if(array_key_exists($displayColumn,$listBoxVal)) $displayColumn=$listBoxVal[$displayColumn]; } } } if($DisplayType==4 && $DateFormat!="" && $displayColumn!="") { // added on 28th April '21 //echo $displayColumn; if($displayColumn=="0000-00-00" || $displayColumn=="0000-00-00 00:00:00") $displayColumn=""; else $displayColumn = date("$DateFormat", strtotime($displayColumn)); } if($DisplayType==14 && $DateFormat!="" && $TimeFormat!="" && $displayColumn!="") { // updated on 16th Sept '21 if($displayColumn=="0000-00-00 00:00:00") { $displayColumn=""; } else { // added on 29th April '21 $datetime = new DateTime($displayColumn); $datetime->format("$DateFormat $TimeFormat"); $la_time = new DateTimeZone($TimeZone); //$datetime->setTimezone($la_time); $displayColumn = $datetime->format("$DateFormat $TimeFormat"); } } if($DisplayType==8 || $DisplayType==23) { // RelateTo $passArray=array("ModuleId"=>$displayColumn,"RowId"=>$field_name); $row_id=$displayColumn; if($displayColumn!="") { if(array_key_exists($displayColumn,$RelateModules)) { $displayColumn=$RelateModules[$displayColumn]; } } } if($DisplayType==25) { // Self RelateTo @endphp @foreach($selfRelatedList as $selfRelated) @php if($displayColumn==$selfRelated['key']) { $displayColumn=$selfRelated['value']; } @endphp @endforeach @php } if($DisplayType==15 && $displayColumn!="") { // AssignedTo if(array_key_exists($displayColumn,$AssignedToList)) $displayColumn=$AssignedToList[$displayColumn]['name']; } if($DisplayType==7 || $DisplayType==10) { // TextArea OR TextEditor, added on 6th May '21 $displayColumn=strip_tags($displayColumn); } @endphp @php } @endphp @endforeach