<commit_before><?php
$sql = "SELECT * FROM `klandring` WHERE ((team = $arguments[id]) AND (verdict != 0))";
$result = $db->query($sql);

$klandringer = [];
$ids = [];
$users = [];

while ($row = $result->fetch_assoc()) {
    $klandringer[] = $row;
}
$result->free();

if (count($klandringer)) {
    foreach ($klandringer as $klandring) {
        $ids[] = intval($klandring["from"]);
        $ids[] = intval($klandring["to"]);
    }

    // todo: solve in one go, instead of 3.
    $ids = array_values(array_unique($ids));
    sort($ids);

    $users = array_combine($ids, get_user_infos_arr($ids));
}

$losings = 0;
$debt = 0;
?>
<div class="panel panel-default">
    <div class="panel-heading">Klandringshistorik for <?= $arguments["name"] ?></div>
    <div class="panel-body">
        <p>Holdet har indtjent <i id="total">0</i> kr.</p>
        <p>Holdet skylder <i id="debt">0</i> kr.</p>
        <p>Holdet har brugt for <i id="spent">TODO</i> kr.</p>
    </div>
<?php if(count($klandringer) > 0) : ?>
    <table class='table table-hover'>
        <thead>
            <tr>
                <th>Dato</th>
                <th>Titel</th><commit_msg>added button from team page to admin page<commit_after><?php
$sql = "SELECT * FROM `klandring` WHERE ((team = $arguments[id]) AND (verdict != 0))";
$result = $db->query($sql);

$klandringer = [];
$ids = [];
$users = [];

while ($row = $result->fetch_assoc()) {
    $klandringer[] = $row;
}
$result->free();

if (count($klandringer)) {
    foreach ($klandringer as $klandring) {
        $ids[] = intval($klandring["from"]);
        $ids[] = intval($klandring["to"]);
    }

    // todo: solve in one go, instead of 3.
    $ids = array_values(array_unique($ids));
    sort($ids);

    $users = array_combine($ids, get_user_infos_arr($ids));
}

$losings = 0;
$debt = 0;
?>
<div class="panel panel-default">
    <div class="panel-heading clearfix">
        <div class="pull-left panel-title" style="padding-top:7.5px;">Klandringshistorik for <?= $arguments["name"] ?></div>
        <div class="btn-group pull-right">
        <?php if($arguments["roleid"] == ROLE_ADMIN) {
            echo "<a href=\"$arguments[slug]/admin\" class=\"btn btn-default\" style=\"\"><i class=\"glyphicon glyphicon-pencil\"> </i> Administrerer</a>";
        }?>
        </div>
    </div>
    <div class="panel-body">
        <p>Holdet har indtjent <i id="total">0</i> kr.</p>
        <p>Holdet skylder <i id="debt">0</i> kr.</p>
        <p>Holdet har brugt for <i id="spent">TODO</i> kr.</p>
    </div>
<?php if(count($klandringer) > 0) : ?>
    <table class='table table-hover'>
        <thead>
            <tr>
                <th>Dato</th>
                <th>Titel</th>
{'fraction_non_alphanumeric': 0.2164068299925761, 'fraction_numerical': 0.005939123979213066, 'mean_word_length': 2.9690721649484537, 'pattern_counts': {'":': 0, '<': 66, '<?xml version=': 0, '>': 74, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '748478', 'n_tokens_mistral': 1017, 'n_tokens_neox': 975, 'n_words': 207}