[insert_php]

setlocale(LC_ALL,’nl_NL’);
global $wpdb;
global $wp;
$current_url = home_url(add_query_arg(array($_GET), $wp->request));
$url_components = parse_url($current_url);
parse_str($url_components[‘query’], $params);

$categ=$params[‘cat’];

$query = $wpdb->get_results(“select id,omschrijving from categorie where id= ‘” . $categ . “‘ “);
foreach ($query as $row) {
echo “Top 10 ” . $row->omschrijving . ” (” . $row->id . “)
“;
}
echo “Outdoor“;

switch($categ) {
case “BENJ”:
$arr = array(1,2,0);
break;
case “BENM”:
$arr = array(1,2,0);
break;
}

foreach ($arr as &$proef) {

echo “

“;
echo “

“;
echo “

“;
$query = $wpdb->get_results(“select voornaam,naam,date_format(pres_dat,’%d-%m-%Y’) datum,proef,locatie,tijd,case when tijd=tijd2 then 1 else 0 end electijd from atleet_prestaties where categorie= ‘” . $categ . “‘ and proef_id = ” . $proef . ” and indoor=0 order by tijd2 asc limit 0,10 “);

foreach ($query as $row) {
echo “

“;
if ( $row-> electijd == 1 )
{
echo “

“;
}
else
{
echo “

“;
}
echo “

“;
}
echo “

“;
echo “

Discipline Atleet Prestatie Datum Locatie Opmerking
” . $row->proef . “ ” . $row->voornaam . ” ” . $row->naam . “ ” . substr($row->tijd, 0, -1) . “ ” . substr($row->tijd, 0, -1) . “* ” . $row->datum . “ ” . $row->locatie . “

“;
echo “* Handmatige tijdsopname“;
}

switch($categ) {
case “BENJ”:
$arr = array(12,13,14,15);
break;
case “BENM”:
$arr = array(12,13,14,15);
break;
}

foreach ($arr as &$proef) {

echo “

“;
echo “

“;
echo “

“;

$query = $wpdb->get_results(“select voornaam,naam,date_format(pres_dat,’%d-%m-%Y’) datum,proef,locatie,afstand from atleet_prestaties where categorie= ‘” . $categ . “‘ and proef_id = ” . $proef . ” and indoor=0 order by afstand desc limit 0,10 “);

foreach ($query as $row) {
echo “

“;
}
echo “

“;
echo “

Discipline Atleet Prestatie Datum Locatie Opmerking
” . $row->proef . “ ” . $row->voornaam . ” ” . $row->naam . “ ” . $row->afstand . “m ” . $row->datum . “ ” . $row->locatie . “

“;
}

$arr = array();
foreach ($arr as &$proef) {

echo “

“;
echo “

“;
echo “

“;

$query = $wpdb->get_results(“select voornaam,naam,date_format(pres_dat,’%d-%m-%Y’) datum,proef,locatie,punten from atleet_prestaties where categorie= ‘” . $categ . “‘ and proef_id = ” . $proef . ” and indoor=0 order by afstand desc limit 0,10″);

foreach ($query as $row) {
echo “

“;
}
echo “

“;
echo “

Discipline Atleet Prestatie Datum Locatie Opmerking
” . $row->proef . “ ” . $row->voornaam . ” ” . $row->naam . “ ” . $row->punten . ” punten ” . $row->datum . “ ” . $row->locatie . “

“;
}

[/insert_php]

Indoor

[insert_php]

setlocale(LC_ALL,’nl_NL’);
global $wpdb;

//$cat = ‘BENJ’;
switch($categ) {
case “BENJ”:
$arr = array(1,2,0);
break;
case “BENM”:
$arr = array(1,2,0);
break;
}
foreach ($arr as &$proef) {

echo “

“;
echo “

“;
echo “

“;

$query = $wpdb->get_results(“select voornaam,naam,date_format(pres_dat,’%d-%m-%Y’) datum,proef,locatie,tijd,case when tijd=tijd2 then 1 else 0 end electijd from atleet_prestaties where categorie= ‘” . $categ . “‘ and proef_id = ” . $proef . ” and indoor=1 order by tijd2 asc limit 1,10 “);

foreach ($query as $row)
{
echo “

“;
if ( $row-> electijd == 1 )
{
echo “

“;
}
else
{
echo “

“;
}
echo “

“;
}
echo “

“;
echo “

Discipline Atleet Prestatie Datum Locatie Opmerking
” . $row->proef . “ ” . $row->voornaam . ” ” . $row->naam . “ ” . substr($row->tijd, 0, -1) . “ ” . substr($row->tijd, 0, -1) . “* ” . $row->datum . “ ” . $row->locatie . “

“;
echo “* Handmatige tijdsopname“;
}

switch($categ) {
case “BENJ”:
$arr = array(12,13,14,15);
break;
case “BENM”:
$arr = array(12,13,14,15);
break;
}

foreach ($arr as &$proef) {

echo “

“;
echo “

“;
echo “

“;

$query = $wpdb->get_results(“select voornaam,naam,date_format(pres_dat,’%d-%m-%Y’) datum,proef,locatie,afstand from atleet_prestaties where categorie= ‘” . $categ . “‘ and proef_id = ” . $proef . ” and indoor=1 order by afstand desc limit 0,10 “);

foreach ($query as $row) {
echo “

“;
}
echo “

“;
echo “

Discipline Atleet Prestatie Datum Locatie Opmerking
” . $row->proef . “ ” . $row->voornaam . ” ” . $row->naam . “ ” . $row->afstand . “m ” . $row->datum . “ ” . $row->locatie . “

“;
}

switch($categ) {
case “BENJ”:
$arr = array(28);
break;
case “BENM”:
$arr = array(28);
break;
}

foreach ($arr as &$proef) {

echo “

“;
echo “

“;
echo “

“;

$query = $wpdb->get_results(“select voornaam,naam,date_format(pres_dat,’%d-%m-%Y’) datum,proef,locatie,punten from atleet_prestaties where categorie= ‘” . $categ . “‘ and proef_id = ” . $proef . ” and indoor=1 order by afstand desc limit 0,10 “);

foreach ($query as $row) {
echo “

“;
}
echo “

“;
echo “

Discipline Atleet Prestatie Datum Locatie Opmerking
” . $row->proef . “ ” . $row->voornaam . ” ” . $row->naam . “ ” . $row->punten . ” punten ” . $row->datum . “ ” . $row->locatie . “

“;
}
[/insert_php]