<commit_before><?php
session_start();
require_once('inc/def.php');

$conn = new mysqli(DBHOST, DBUSER, DBPASS, DBNAME);

if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

$sql = "SELECT Side, SUM(LastQty) AS TotalQty, AVG(LastPx) As AvgPrice, Symbol FROM FIXExecutionReport GROUP BY Symbol, Side ORDER BY Symbol";

$result = $conn->query($sql);

$size = $result->num_rows;

if($size <= 0){
    print json_encode("empty");
    exit;
}

while($fetch = $result->fetch_array()) {

    $output[] = array (
        $fetch["Side"],$fetch["TotalQty"],$fetch["AvgPrice"],$fetch["Symbol"]
    );
}

echo json_encode($output);
exit;
?>
<commit_msg>PL stored proc<commit_after><?php
session_start();
require_once('inc/def.php');

$conn = new mysqli(DBHOST, DBUSER, DBPASS, DBNAME);

if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

$sql = "call get_pl";

$result = $conn->query($sql);

$size = $result->num_rows;

if($size <= 0){
    print json_encode("empty");
    exit;
}

while($fetch = $result->fetch_array()) {

    $output[] = array (
        $fetch["CcyPair"],$fetch["BoughtQty"],$fetch["SoldQty"],$fetch["SettledQty"],$fetch["BoughtAVG"],$fetch["SoldAVG"],$fetch["Banked"],$fetch["OutstandingQty"]
    );
}

echo json_encode($output);
exit;
?>

{'fraction_non_alphanumeric': 0.2086824067022087, 'fraction_numerical': 0.0015232292460015233, 'mean_word_length': 5.2274881516587675, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, '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': '7507146', 'n_tokens_mistral': 490, 'n_tokens_neox': 481, 'n_words': 86}