Пример #1
0
        $label2 = 'provincie Zuid-Holland';
        $q = $dbh->prepare("select {$col} AS val_tot from {$table} where indeling = 'tot'");
        $q->execute();
        $result = $q->fetch();
        $perc_tot = $result[val_tot];
        unset($cbs2);
        unset($cbs3);
        if ($regio2) {
            $label3 = get_ras($regio2);
            $query = "select {$col} AS val1 from {$table} where indeling = 'RAS' and indeling_cd = {$regio2}";
            $result = mysql_query($query);
            $row = mysql_fetch_array($result);
            $perc2 = $row[val1];
        }
        if ($regio3) {
            $label4 = get_ras($regio3);
            $query = "select {$col} AS val1 from {$table} where indeling = 'RAS' and indeling_cd = {$regio3}";
            $result = mysql_query($query);
            $row = mysql_fetch_array($result);
            $perc3 = $row[val1];
        }
    }
    $xml .= "<set label='{$label1}' value='{$perc}' color='{$color['2']}' />" . "\r\n";
    if ($regio2 || $cbs2 || $pzh2) {
        $xml .= "<set label='{$label3}' value='{$perc2}' color='{$color['3']}' />" . "\r\n";
    }
    if ($regio3 || $cbs3) {
        $xml .= "<set label='{$label4}' value='{$perc3}' color='{$color['4']}' />" . "\r\n";
    }
    $xml .= "<set label='{$label2}' value='{$perc_tot}' color='{$color['0']}]' />" . "\r\n";
}
Пример #2
0
function get_table_headers($table_title, $cbs, $regio, $cbs2, $regio2)
{
    $table_title = urldecode($table_title);
    if ($cbs) {
        $gemeente = get_gemeente($cbs);
        $stedelijkheid = get_stedelijkheid_oms($cbs);
    }
    if ($cbs2) {
        $gemeente2 = get_gemeente($cbs2);
    }
    if ($regio) {
        $regionaam = get_ras($regio);
    }
    if ($regio2) {
        $regionaam2 = get_ras($regio2);
    }
    if ($cbs && !$cbs2 && !$regio2) {
        $table_header = "<table class=tablesorter border=0 width=100% cellpadding=4 cellspacing=0><thead><tr VALIGN=top>\n      <th width=30% align=left>{$table_title}</th>\n      <th width=10% align=right>jaar</th>\n      <th width=20% align=right>{$gemeente}</th>\n      <th width=20% align=right>{$stedelijkheid}</th>\n      <th width=20% align=right>provincie Zuid-Holland</th></tr></thead><tbody>";
    }
    if ($cbs && ($cbs2 || $regio2)) {
        $table_header = "<table class=tablesorter border=0 width=100% cellpadding=4 cellspacing=0><thead><tr VALIGN=top>\n      <th width=30% align=left>{$table_title}</th>\n      <th  width=10% align=right>jaar</th>\n      <th width=15% align=right>{$gemeente}</th>\n      <th width=15% align=right>{$gemeente2}{$regionaam2}</th>\n      <th width=15% align=right>{$stedelijkheid}</th>\n      <th width=15% align=right>provincie Zuid-Holland</th></tr></thead><tbody>";
    }
    if ($regio && !$cbs2 && !$regio2) {
        $table_header = "<table class=tablesorter border=0 width=100% cellpadding=4 cellspacing=0><thead><tr VALIGN=top>\n      <th width=40% align=left>{$table_title}</th>\n      <th width=10% align=right>jaar</th>\n      <th width=30% align=right>{$regionaam}</th>\n      <th width=30% align=right>provincie Zuid-Holland</th></tr></thead><tbody>";
    }
    if ($regio && ($cbs2 || $regio2)) {
        $table_header = "<table class=tablesorter border=0 width=100% cellpadding=4 cellspacing=0><thead><tr VALIGN=top>\n      <th width=30% align=left>{$table_title}</th>\n      <th width=10% align=right>jaar</th>\n      <th width=20% align=right>{$regionaam}</th>\n      <th width=20% align=right>{$gemeente2}{$regionaam2}</th>\n      <th width=20% align=right>provincie Zuid-Holland</th></tr></thead><tbody>";
    }
    return $table_header;
}
Пример #3
0
function get_table_headers($regio, $cbs, $num_comparisons, $compare, $screen_width, $pijler, $compare_years)
{
    if ($cbs || is_numeric($compare[0]) || is_numeric($compare[1])) {
        if ($cbs) {
            $gemeente = get_gemeente($cbs);
            $stedelijkheid = get_stedelijkheid_oms($cbs);
            $stedelijkheid = str_replace(' ', '<br>', $stedelijkheid);
            $stedelijkheid_oms = $stedelijkheid . 'e';
            $stedelijkheid_oms = str_replace(' ', '<br>', $stedelijkheid_oms);
            $kenmerk = get_stedelijkheid($cbs);
            $num_gemeenten = get_count_gemeenten($kenmerk);
        }
    }
    if ($regio) {
        $regio_nm = get_ras($regio);
    }
    echo "<table class='barometer_table {$pijler}' border=0 width=100% cellpadding=4 cellspacing=0>";
    echo "<thead><tr VALIGN=top>";
    if ($compare_years == "on") {
        $peildatum1 = 'mei 2012';
        $peildatum2 = 'mei 2015';
        echo "<th align=left colspan=2>&nbsp;</th>";
        if ($gemeente) {
            echo "<th colspan=10 align=center>{$gemeente}</th>";
        } else {
            echo "<th colspan=10 align=center>{$regio_nm}</th>";
        }
        if ($stedelijkheid) {
            echo "<th colspan=8 align=center>{$stedelijkheid}</th>";
        } else {
            echo "<th colspan=8 align=center>provincie Zuid-Holland</th>";
        }
        echo "</tr>";
        echo "<tr valign=top>";
        echo "<th align=left colspan=2>&nbsp;</th>";
        echo "<th colspan=4 align=center class=cell_variable_text>{$peildatum1}</th>";
        echo "<th class=cell_variable_image><a href=# title='De meting van mei 2012 betreft verschillende peildata, de exacte peildatum kunt u zien door in de kolom \r\n      relatief de toelichting te bekijken.' class=toelichting_header><img src=images/red.png class=image_toelichting></a></th>";
        echo "<th colspan=4 align=center class=cell_variable_text>{$peildatum2}</th>";
        echo "<th class=cell_variable_image><a href=# title='De meting van mei 2015 betreft verschillende peildata, de exacte peildatum kunt u zien door in de kolom \r\n      relatief de toelichting te bekijken.' class=toelichting_header><img src=images/red.png class=image_toelichting></a></th>";
        echo "<th colspan=4 align=center>{$peildatum1}</th>";
        echo "<th colspan=4 align=center>{$peildatum2}</th>";
        echo "</tr>";
        echo "<tr valign=top>";
        echo "<th align=left colspan=2>&nbsp;</th>";
        echo "<th align=right>absoluut</th>";
        echo "<th align=right colspan=2>relatief</th>";
        echo "<th align=right colspan=2>index</th>";
        echo "<th align=right>absoluut</th>";
        echo "<th align=right colspan=2>relatief</th>";
        echo "<th align=right colspan=2>index</th>";
        echo "<th align=right>absoluut</th>";
        echo "<th align=right colspan=2>relatief</th>";
        echo "<th align=right>index</th>";
        echo "<th align=right>absoluut</th>";
        echo "<th align=right colspan=2>relatief</th>";
        echo "<th align=right>index</th>";
        echo "</tr>";
    }
    if ($compare_years == "off") {
        if ($num_comparisons == 0) {
            echo "<th align=left colspan=2>&nbsp;</th>";
            echo "<th align=left>&nbsp;</th>";
            if ($gemeente) {
                echo "<th colspan=6 align=center>{$gemeente}</th>";
            } else {
                echo "<th colspan=4 align=center>{$regio_nm}</th>";
            }
            if ($stedelijkheid) {
                echo "<th colspan=4 align=center>{$stedelijkheid}</th></tr>";
            } else {
                echo "<th colspan=4 align=center>provincie Zuid-Holland</th></tr>";
            }
            echo "<tr><th align=left colspan=2>&nbsp;</th>";
            echo "<th align=left>peildatum</th>";
            if ($gemeente) {
                echo "<th align=right>absoluut</th>";
                echo "<th align=right colspan=2>relatief</th>";
                echo "<th align=right>rangorde<br>alle<br>gemeenten<br> (n=60)</th>";
                echo "<th align=right>rangorde<br>{$stedelijkheid_oms}<br> gemeenten<br> (n={$num_gemeenten})</th>";
                echo "<th align=right>index<br> ({$stedelijkheid} <br>=100)</th>";
            } else {
                echo "<th align=right>absoluut</th>";
                echo "<th align=right colspan=2>relatief</th>";
                echo "<th align=right>index (provincie=100)</th>";
            }
            //provincie
            echo "<th align=right>absoluut</th>";
            echo "<th align=right colspan=2>relatief</th>";
            echo "<th align=right>index</th>";
            echo "</tr>";
        }
        if ($num_comparisons == 1) {
            echo "<th align=left colspan=2>&nbsp;</th>";
            echo "<th align=left>&nbsp;</th>";
            if ($gemeente) {
                echo "<th colspan=6 align=center>{$gemeente}</th>";
            } else {
                echo "<th colspan=4 align=center>{$regio_nm}</th>";
            }
            if (is_numeric($compare[0])) {
                $compare1 = get_gemeente($compare[0]);
            }
            if (substr($compare[0], 0, 1) == 'R') {
                $compare1 = get_ras($compare[0]);
            }
            if (substr($compare[0], 0, 1) == 'p') {
                $compare1 = 'provincie Zuid-Holland';
            }
            if (is_numeric($compare[0])) {
                if ($cbs && get_stedelijkheid($cbs) == get_stedelijkheid($compare[0])) {
                    echo "<th colspan=6 align=center>{$compare1}</th>";
                } else {
                    echo "<th colspan=4 align=center>{$compare1}</th>";
                }
            } elseif ($cbs) {
                echo "<th colspan=3 align=center>{$compare1}</th>";
            } elseif (!$cbs) {
                echo "<th colspan=4 align=center>{$compare1}</th>";
            }
            if ($stedelijkheid) {
                echo "<th colspan=4 align=center>{$stedelijkheid}</th></tr>";
            } else {
                echo "<th colspan=4 align=center>provincie Zuid-Holland</th></tr>";
            }
            echo "<tr><th align=left colspan=2>&nbsp;</th>";
            if ($screen_width < 1050) {
                echo "<th align=left>peil-<br>datum</th>";
            } else {
                echo "<th align=left>peildatum</th>";
            }
            if ($gemeente) {
                if ($screen_width < 1050) {
                    echo "<th align=right>abs</th>";
                    echo "<th align=right colspan=2>rel</th>";
                    echo "<th align=right>rang-<br>orde alle gem. (n=60)</th>";
                    echo "<th align=right>rang-<br>orde {$stedelijkheid_oms} gem. (n={$num_gemeenten})</th>";
                } else {
                    echo "<th align=right>absoluut</th>";
                    echo "<th align=right colspan=2>relatief</th>";
                    echo "<th align=right>rangorde<br>alle<br>gemeenten (n=60)</th>";
                    echo "<th align=right>rangorde<br>{$stedelijkheid_oms}<br>gemeenten<br>(n={$num_gemeenten})</th>";
                }
                echo "<th align=right>index ({$stedelijkheid} =100)</th>";
            } else {
                echo "<th align=right>absoluut</th>";
                echo "<th align=right colspan=2>relatief</th>";
                echo "<th align=right>index (provincie=100)</th>";
            }
            if (is_numeric($compare[0])) {
                if ($screen_width < 1050) {
                    echo "<th align=right>abs</th>";
                    echo "<th align=right colspan=2>rel</th>";
                    echo "<th align=right>rang-<br>orde alle gem. (n=60)</th>";
                    if ($cbs && get_stedelijkheid($cbs) == get_stedelijkheid($compare[0])) {
                        echo "<th align=right>rang-<br>orde {$stedelijkheid_oms} gem. (n={$num_gemeenten})</th>";
                        echo "<th align=right>index ({$stedelijkheid} =100)</th>";
                    }
                } else {
                    echo "<th align=right>absoluut</th>";
                    echo "<th align=right colspan=2>relatief</th>";
                    echo "<th align=right>rangorde<br>alle<br>gemeenten (n=60)</th>";
                    if ($cbs && get_stedelijkheid($cbs) == get_stedelijkheid($compare[0])) {
                        echo "<th align=right>rangorde<br>{$stedelijkheid_oms}<br>gemeenten<br>(n={$num_gemeenten})</th>";
                        echo "<th align=right>index ({$stedelijkheid}<br>=100)</th>";
                    }
                }
            } elseif ($cbs) {
                echo "<th align=right>absoluut</th>";
                echo "<th align=right colspan=2>relatief</th>";
            } elseif (!$cbs) {
                echo "<th align=right>absoluut</th>";
                echo "<th align=right colspan=2>relatief</th>";
                echo "<th align=right>index (provincie=100)</th>";
            }
            //provincie
            if ($screen_width < 1050) {
                echo "<th align=right>abs</th>";
                echo "<th align=right colspan=2>rel</th>";
            } else {
                echo "<th align=right>absoluut</th>";
                echo "<th align=right colspan=2>relatief</th>";
            }
            echo "<th align=right>index</th>";
            echo "</tr>";
        }
        if ($num_comparisons == 2) {
            echo "<th align=left colspan=2>&nbsp;</th>";
            echo "<th align=left>&nbsp;</th>";
            echo "<th colspan=4 align=center>{$regio_nm}</th>";
            if (is_numeric($compare[0])) {
                $compare1 = get_gemeente($compare[0]);
            }
            if (substr($compare[0], 0, 1) == 'R') {
                $compare1 = get_ras($compare[0]);
            }
            if (is_numeric($compare[1])) {
                $compare2 = get_gemeente($compare[1]);
            }
            if (substr($compare[1], 0, 1) == 'R') {
                $compare2 = get_ras($compare[1]);
            }
            echo "<th colspan=4 align=center>{$compare1}</th>";
            echo "<th colspan=4 align=center>{$compare2}</th>";
            echo "<th colspan=4 align=center>provincie Zuid-Holland</th></tr>";
            echo "<tr><th align=left colspan=2>&nbsp;</th>";
            echo "<th align=left>peildatum</th>";
            echo "<th align=right>absoluut</th>";
            echo "<th align=right colspan=2>relatief</th>";
            echo "<th align=right>index (provincie=100)</th>";
            if (is_numeric($compare[0])) {
                echo "<th align=right>absoluut</th>";
                echo "<th align=right colspan=2>relatief</th>";
                echo "<th align=right>rangorde alle gemeenten (n=60)</th>";
            } else {
                echo "<th align=right>absoluut</th>";
                echo "<th align=right colspan=2>relatief</th>";
                echo "<th align=right>index (provincie=100)</th>";
            }
            if (is_numeric($compare[1])) {
                echo "<th align=right>absoluut</th>";
                echo "<th align=right colspan=2>relatief</th>";
                echo "<th align=right>rangorde alle gemeenten (n=60)</th>";
            } else {
                echo "<th align=right>absoluut</th>";
                echo "<th align=right colspan=2>relatief</th>";
                echo "<th align=right>index (provincie=100)</th>";
            }
            //provincie
            echo "<th align=right>absoluut</th>";
            echo "<th align=right colspan=2>relatief</th>";
            echo "<th align=right>index</th>";
            echo "</tr>";
        }
    }
    echo "</thead><tbody>";
}