Guest User

Untitled

a guest
Feb 24th, 2024
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. <?php
  2. $data = wpgetapi_endpoint( 'kpi', 'kpi', array('debug' => false) );
  3.  
  4. $html = '<table>';
  5. $html .= '<thead>';
  6. $html .= '<tr>';
  7. $html .= '<th>Observed Date</th>';
  8. $html .= '<th>Region</th>';
  9. $html .= '<th>Longitude/Latitude</th>';
  10. $html .= '<th>Location</th>';
  11. $html .= '</th>';
  12. $html .= '</thead>';
  13.  
  14. $html .= '<tbody>';
  15.  
  16. foreach($data as $key => $item) {
  17. $observed_date = $item['observed_date'];
  18. $region = $item['region'];
  19. $lat = $item['latitude'];
  20. $long = $item['longitude'];
  21. $location = $item['location'];
  22.  
  23. $html .= '<tr>';
  24. $html .= '<td>' . $observed_date . '</td>';
  25. $html .= '<td>' . $region . '</td>';
  26. $html .= '<td>' . $lat . ' / ' . $long . '</td>';
  27. $html .= '<td>' . $location . '</td>';
  28. $html .= '</td>';
  29. }
  30.  
  31. $html .= '</tbody>';
  32. $html .= '</table>';
  33.  
  34. echo $html;
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment