Team 2022/2023
Saison 2022/2023
BARMER 2. Basketball Bundesliga ProB Nord
{source}<?php
//error_reporting(E_ALL);
$url = "api.zweite-basketball-bundesliga.de";
$api = "kader";
$key = "c7cb6802b2c9788b961011d721a73e24";
$json = file_get_contents('https://' . $url . '/' . $api . '/' . $key);
//https://api.2basketballbundesliga.de/kader/c7cb6802b2c9788b961011d721a73e24
//true wandelt in Array anstatt Object
$arr = json_decode($json, true);
if (!empty($arr)) {
$arr['kader'][] = array('number' => 100, 'firstname' => 'Patrick', 'lastname' => 'Mouchard', 'position1_short' => 'Team-Manager', 'nationality_short' => 'DE', 'nationality' => 'Deutschland');
$arr['kader'][] = array('number' => 101, 'firstname' => 'Johannes', 'lastname' => 'Dersch', 'position1_short' => 'Physio', 'nationality_short' => 'DE', 'nationality' => 'Deutschland');
$arr['kader'][] = array('number' => 102, 'firstname' => 'Caroline', 'lastname' => 'Imrock', 'position1_short' => 'Atlethiktrainerin', 'nationality_short' => 'DE', 'nationality' => 'Deutschland');
//error_reporting(E_ALL);
$url = "api.zweite-basketball-bundesliga.de";
$api = "kader";
$key = "c7cb6802b2c9788b961011d721a73e24";
$json = file_get_contents('https://' . $url . '/' . $api . '/' . $key);
//https://api.2basketballbundesliga.de/kader/c7cb6802b2c9788b961011d721a73e24
//true wandelt in Array anstatt Object
$arr = json_decode($json, true);
if (!empty($arr)) {
$arr['kader'][] = array('number' => 100, 'firstname' => 'Patrick', 'lastname' => 'Mouchard', 'position1_short' => 'Team-Manager', 'nationality_short' => 'DE', 'nationality' => 'Deutschland');
$arr['kader'][] = array('number' => 101, 'firstname' => 'Johannes', 'lastname' => 'Dersch', 'position1_short' => 'Physio', 'nationality_short' => 'DE', 'nationality' => 'Deutschland');
$arr['kader'][] = array('number' => 102, 'firstname' => 'Caroline', 'lastname' => 'Imrock', 'position1_short' => 'Atlethiktrainerin', 'nationality_short' => 'DE', 'nationality' => 'Deutschland');
$arr['kader'][] = array('number' => 103, 'firstname' => 'Dr. med. Ewgeni', 'lastname' => 'Ziring', 'position1_short' => 'Teamarzt', 'nationality_short' => 'DE', 'nationality' => 'Deutschland');
date_default_timezone_set("Europe/Berlin");
echo '<table id="pointers-team" class="uk-table uk-table-striped uk-table-condensed uk-table-hover tablesorter sort_firstcol_asc">';
echo '<thead>';
echo '<tr>';
echo '<th style="text-align: center;">#</th>';
echo '<th style="text-align: left;">NAME</th>';
echo '<th style="text-align: center;">POS</th>';
echo '<th style="text-align: center;">M</th>';
echo '<th style="text-align: center;">KG</th>';
echo '<th style="text-align: center;">ALTER</th>';
echo '<th style="text-align: center;">NAT</th>';
echo '</tr>';
echo '</thead>';
echo '<tbody>';
foreach ($arr['kader'] as $player) {
if ($player['number'] <= 97) {

$datum1 = new DateTime($player['birthdate_ymd']); //Geburtsdatum

$datum2 = new DateTime(date('Y-m-d') ); //Aktuelles Datum

$interval = $datum2->diff($datum1);

echo '<tr>';

echo '<td style="text-align: center;">' . $player['number'] . '</td>';

echo '<td style="text-align: left;"><a href="https://www.2basketballbundesliga.de/teams/kader/spieler/' . $player['id'] . '/" target="_blank">' . $player['firstname'] . ' ' . $player['lastname'] . '</a></td>';

echo '<td style="text-align: center;">' . $player['position1_short'];

if ($player['position2_short'] != "") {


echo '/' . $player['position2_short'];

}

echo '</td>';

echo '<td style="text-align: center;">' . number_format($player['height'], 2, ",", ".") . ' m</td>';

echo '<td style="text-align: center;">' . $player['weight'] . ' kg</td>';

echo '<td style="text-align: center;">' . $interval->format("%Y") . '</td>';

echo '<td style="text-align: center;" data-uk-tooltip="{pos:\'left\'}" title="' . $player['nationality'] . '"><span class="flag-icon" title="' . strtolower($player['nationality']) . '" style=" text-indent: -9999px; height:20px; background-image:url(https://www.2basketballbundesliga.de/wp-content/themes/enfold/flags/4x3/' . strtolower($player['nationality_short']) . '.svg);">' . $player['nationality_short'] . '</span></td>';

echo '</tr>';
}
}
echo '</tbody>';
echo '<tfoot>';
foreach ($arr['kader'] as $player) {
if ($player['number'] > 97) {

$datum1 = new DateTime($player['birthdate_ymd']); //Geburtsdatum

$datum2 = new DateTime(date('Y-m-d')); //Aktuelles Datum

$interval = $datum2->diff($datum1);

echo '<tr>';

echo '<td style="text-align: center;"></td>';

if ($player['id']) {


echo '<td style="text-align: left;"><a href="https://www.2basketballbundesliga.de/teams/kader/spieler/' . $player['id'] . '/" target="_blank">' . $player['firstname'] . ' ' . $player['lastname'] . '</a></td>';

} else {


echo '<td style="text-align: left;">' . $player['firstname'] . ' ' . $player['lastname'] . '</td>';

}

echo '<td style="text-align: center;">' . $player['position1_short'];

if ($player['position2_short'] != "") {


echo '/' . $player['position2_short'];

}

echo '</td>';

echo '<td style="text-align: center;"></td>';

echo '<td style="text-align: center;"></td>';

echo '<td style="text-align: center;"></td>';

echo '<td style="text-align: center;" data-uk-tooltip="{pos:\'left\'}" title="' . $player['nationality'] . '"><span class="flag-icon" title="' . strtolower($player['nationality']) . '" style=" text-indent: -9999px; height:20px; background-image:url(https://www.2basketballbundesliga.de/wp-content/themes/diejungeliga/flags/4x3/' . strtolower($player['nationality_short']) . '.svg);">' . $player['nationality_short'] . '</span></td>';

echo '</tr>';
}
}
echo '</tfoot>';
echo '</table>';}
// echo '<pre>';
// print_r($arr);
// echo '</pre>';
?>{/source}






































