<commit_before><?php

function show_statement($userid)
{
    $show_increments = false;
    $show_prices = true;

    $aud_precision = 2;
    $btc_precision = 4;
    $price_precision = 4;

    echo "<div class='content_box'>\n";
    echo "<h3>Statement (UID $userid)</h3>\n";

    $query = "
        SELECT
            txid, a_orderid AS orderid,
            a_amount AS gave_amount, 'AUD' AS gave_curr,
            (b_amount-b_commission) AS got_amount,  'BTC' AS got_curr,
            NULL as reqid,  NULL as req_type,
            NULL as amount, NULL as curr_type,
            " . sql_format_date('transactions.timest') . " AS date,
            transactions.timest as timest
        FROM
            transactions
        JOIN
            orderbook
        ON
            orderbook.orderid = transactions.a_orderid
        WHERE
            uid=$userid AND b_amount != -1
        UNION
        SELECT
            txid, b_orderid AS orderid,
            b_amount AS gave_amount, 'BTC' AS gave_curr,
            (a_amount-a_commission) AS got_amount,  'AUD' AS got_curr,
            NULL, NULL,
            NULL, NULL,
            " . sql_format_date('transactions.timest') . " AS date,
            transactions.timest as timest
        FROM
            transactions
        JOIN
            orderbook
        ON
            orderbook.orderid=transactions.b_orderid
        WHERE
            uid=$userid AND b_amount != -1
        UNION
        SELECT
            NULL, NULL,
            NULL, NULL,
            NULL, NULL,
            reqid,  req_type,
            amount, curr_type,
            " . sql_format_date('timest') . " AS date,
            timest
        FROM
            requests
        WHERE
            uid=$userid AND status != 'CANCEL'
        ORDER BY
            timest
    ";

    $first = true;
    $result = do_query($query);
    $aud = 0;
    $btc = 0;

    $first = false;
    echo "<table class='display_data'>\n";
    echo "<tr>";
    echo "<th>Date</th>";<commit_msg>Quote the userid in SQL queries.<commit_after><?php

function show_statement($userid)
{
    $show_increments = false;
    $show_prices = true;

    $aud_precision = 2;
    $btc_precision = 4;
    $price_precision = 4;

    echo "<div class='content_box'>\n";
    echo "<h3>Statement (UID $userid)</h3>\n";

    $query = "
        SELECT
            txid, a_orderid AS orderid,
            a_amount AS gave_amount, 'AUD' AS gave_curr,
            (b_amount-b_commission) AS got_amount,  'BTC' AS got_curr,
            NULL as reqid,  NULL as req_type,
            NULL as amount, NULL as curr_type,
            " . sql_format_date('transactions.timest') . " AS date,
            transactions.timest as timest
        FROM
            transactions
        JOIN
            orderbook
        ON
            orderbook.orderid = transactions.a_orderid
        WHERE
            uid='$userid' AND b_amount != -1
        UNION
        SELECT
            txid, b_orderid AS orderid,
            b_amount AS gave_amount, 'BTC' AS gave_curr,
            (a_amount-a_commission) AS got_amount,  'AUD' AS got_curr,
            NULL, NULL,
            NULL, NULL,
            " . sql_format_date('transactions.timest') . " AS date,
            transactions.timest as timest
        FROM
            transactions
        JOIN
            orderbook
        ON
            orderbook.orderid=transactions.b_orderid
        WHERE
            uid='$userid' AND b_amount != -1
        UNION
        SELECT
            NULL, NULL,
            NULL, NULL,
            NULL, NULL,
            reqid,  req_type,
            amount, curr_type,
            " . sql_format_date('timest') . " AS date,
            timest
        FROM
            requests
        WHERE
            uid='$userid' AND status != 'CANCEL'
        ORDER BY
            timest
    ";

    $first = true;
    $result = do_query($query);
    $aud = 0;
    $btc = 0;

    $first = false;
    echo "<table class='display_data'>\n";
    echo "<tr>";
    echo "<th>Date</th>";
{'fraction_non_alphanumeric': 0.09494144031896337, 'fraction_numerical': 0.00448542237727386, 'mean_word_length': 1.52294154619736, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 17, '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': '2522475', 'n_tokens_mistral': 1246, 'n_tokens_neox': 1218, 'n_words': 304}