}
    for ($i = 0; $i < count($arr_usernames); $i++) {
        $cl = "";
        if ($i % 2 == 0) {
            $cl = "data";
        } else {
            $cl = "data_alt";
        }
        echo "<tr class=\"" . $cl . "\"><td>" . $arr_usernames[$i] . "</td><td>" . $arr_texttimes[$i] . "</td></tr>\n";
    }
}
// the following code is only for getting the checkins of a specific user
if (isset($_POST['searchuser'])) {
    if (isset($_POST['usersearched'])) {
        $username = $_POST['usersearched'];
        $result = $api->getCheckIns($username);
        //echo $result;
        $table = json_decode($result);
        if (count($table) > 0) {
            echo "Showing check-ins for {$username}.";
        }
        // show only past 10 check-ins
        $numcheckins = min(10, count($table));
        for ($i = 0; $i < $numcheckins; $i++) {
            echo "<li>" . $table[$i] . "</li>";
            //echo "<br />";
        }
    } else {
        echo "<p>Please specify a valid username.</p>";
    }
}