@php // on 29th Nov '21, for ReportType==6, updated on 3rd & 4th Dec '21 // updated on 11th with Date // updated on 13th with AssignedToList $userdetails = Auth::user(); $LoggedUser = $userdetails->name; $DateFormat = $userdetails->DateFormat; $TimeZone = $userdetails->TimeZone; $TimeFormat = $userdetails->TimeFormat; $GmtOffSet = $userdetails->GmtOffSet; $total_count=count($header); $columns = array(); $loopcount=0; $column_data=array(); $header_data=array(); $results_obj=array(); foreach($results as $obj => $key) { if($obj=="x_axis") $column_data=$key; if($obj=="y_axis") $header_data=$key; if($obj=="results") $results_obj=$key; } //echo json_encode($results_obj); echo "
";
    print_r($results);
   // print_r($results_obj);
  //  echo "
Header:
"; // print_r($header); // echo "
Header:
"; // print_r($headers); // echo "
x_axis:
"; // print_r($column_data); // echo "
y_axis:
"; // print_r($header_data); echo "
"; $Column=array(); foreach($results_obj as $k=>$l) { $Column[]=$k; $Columnl[]=$l; } $ColumnName=""; $display_value=""; if(empty($results_obj)) { @endphp @php } else { foreach($column_data as $head) { foreach($head as $display_data=>$display_key) { //echo "$display_data"; @endphp
@foreach($Column as $eachColumn) @endforeach @foreach($column_data as $a) @foreach($a as $b) @foreach($b as $c) @php $DisplayRowValue=$c->ColumnName; @endphp @if(array_key_exists($DisplayRowValue,$AssignedToList)) @php $DisplaytheValue=$AssignedToList[$DisplayRowValue]['name']; @endphp @else @php $DisplaytheValue=$DisplayRowValue; @endphp @endif @foreach($Columnl as $Eachrows) @endforeach @endforeach @endforeach @endforeach
{{$display_data}}{{$eachColumn}}
{{$DisplaytheValue}}{{$Eachrows[$c->ColumnName]}}
@php } } } @endphp @php function multiKeyExists(array $arr, $key) { // is in base array? if (array_key_exists($key, $arr)) { $results[] = $arr; return $results; } // check arrays contained in this array foreach ($arr as $element) { if (is_array($element)) { if (multiKeyExists($element, $key)) { //return true; $results[] = $element; return $results; } } } return false; } @endphp