$smarty->assign('selected_groups', $selected_groups); // FILTER $filter = ['{' . implode(', ', array_keys($selected_countries)) . '}', '{' . implode(', ', array_keys($selected_groups)) . '}']; // SHOW, default: countries if (isset($_GET['show'])) { if (in_array($_GET['show'], ['groups', 'countries', 'parties', 'people'])) { $show = $_GET['show']; } else { $show = 'countries'; } } else { $show = 'countries'; } $smarty->assign('show', $show); // CALCULATE 1/3s $thirds = thirds($show, $dbconn); $smarty->assign('thirds', $thirds); // DATA switch ($show) { case 'people': $as = get('activities_people', $dbconn, $filter); break; case 'parties': $as = get('activities_parties', $dbconn, $filter); break; case 'groups': $as = get('activities_groups', $dbconn, $filter); break; case 'countries': $as = get('activities_countries', $dbconn, $filter); }
<?php session_start(); //error_reporting(E_ALL); error_reporting(0); $path2root = "../"; require $path2root . "common.php"; require "common.php"; include "queries.php"; $smarty->assign('page', 'mep'); // CALCULATE 1/3s $thirds = thirds('people', $dbconn); $smarty->assign('thirds', $thirds); //GET DATA if (isset($_GET['id'])) { if (intval($_GET['id'])) { $id = intval($_GET['id']); } else { $id = 0; } } $data = get('activities_person', $dbconn, $id); $smarty->assign('data', $data); $smarty->assign('last_updated', last_updated("activities.json")); $smarty->display('mep.tpl');