Your IP : 216.73.216.39


Current Path : /home/wirbesti/unwaehlbar.ch/
Upload File :
Current File : /home/wirbesti/unwaehlbar.ch/top10.php

<?php
  $days = $_GET['days'];
  $topflop = $_GET['topflop'];
  try {
    require_once "settings.config.php";
    require_once "DBConnection.php";
    $database = new DbConnection($config);

    require_once "./DAO/stats.php";
    require_once "baseurl.php";
    require_once "language.php";
    $stats = new Stats($database);
    $top10up = $stats->top10VotesByDays($days,$topflop);
    echo '<table class="table table-striped">';
    echo '<thead>';
        echo'<th>#</th>';
        echo '<th></th>';
        echo '<th>Name</th>';
        echo '<th><span># <i class="far fa-thumbs-'.($topflop == 1 ? 'up' : 'down').'"></span></th>';
    echo '</thead>';
    $rank = 0;
    if ($top10up == null || count($top10up) == 0) {
        return;
    }
    foreach ($top10up as $top10item) {
        $id = $top10item['politicianid'];
        $name = $top10item['name'];
        $picture = $top10item['picture'];
        $seedup = $top10item['seedup'];
        $votes = $top10item['votes'];

        $rank++;

        echo '<tr>';
        echo '<td>';
            echo '<h6>';
                echo '<p ';
                    echo 'style="font-family: \'Segoe UI\', Tahoma, Geneva, Verdana, sans-serif; margin-top: 6px;">';
                    echo $rank;
                echo '</p>';
            echo '</h6>';
        echo '</td>';
        echo '<td><img class="dropshadowimgsmall" ';
                echo 'src="./images/'.$picture.'" ';
                echo ' alt="" height="40px" width="40px"></td>';
        echo '<td>';
            echo '<h6>';
                echo '<p ';
                    echo 'style="font-family: \'Segoe UI\', Tahoma, Geneva, Verdana, sans-serif; margin-top: 6px;">';
                    echo '<a href="'.$baseUrl.'personDetail2.php?id='.$id.'&language='.$language.'" ';
                        echo ' target="_blank">'.$name.'</a>';
                echo '</p>';
            echo '</h6>';
        echo '</td>';
        echo '<td>';
            echo '<h6>';
                echo '<p ';
                    echo 'style="font-family: \'Segoe UI\', Tahoma, Geneva, Verdana, sans-serif; margin-top: 6px;">';
                    echo abs($votes);
                echo '</p>';
            echo '</h6>';
        echo '</td>';
        echo '</tr>';

      }
  echo '</table>';

  } catch (\Throwable $e) {
      echo $e.'<br/>';
  }

?>