public static function render_shortcode($atts, $content = null) { $dataManager = new DataManager(); $data = $dataManager->participants(); $html = '<table class="hre-participants-wrapper" border="0">'; $grouping = null; foreach ($data as $participant) { if ($grouping != $participant['gender']) { $title = ''; switch ($participant['gender']) { case 'Man': $title = 'Mannen'; break; case 'Vrouw': $title = 'Vrouwen'; break; } $html .= "<tr><th colspan=\"2\" class=\"hre-participant-name\"><a name=\"{$participant['gender']}\"> </a><h2>{$title}</h2></th></tr>"; $grouping = $participant['gender']; } $html .= '<tr class="hre-participant">'; $html .= "<td class=\"hre-participant-name\">{$participant['Name']}</td>"; $html .= "<td class=\"hre-participant-city\">{$participant['city']}</td>"; $html .= '</tr>'; } $html .= '</table>'; return $html; }
public static function showStats() { $dataManager = new DataManager(); $data = $dataManager->data(); $stats = null; if (count($data) > 0) { foreach ($data as $item) { $stats[$item['order_item_name']] = $item['Total']; } } return $stats; }