Skip to content

Commit fa984e0

Browse files
author
Raunak Gupta
committed
Tweak - ctr, screenshot and lint index file.
1 parent a1a1246 commit fa984e0

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

index.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
<?php
2+
23
session_start();
34
require_once 'vendor/autoload.php';
45

5-
if(!APP_DEBUG){
6+
if (!APP_DEBUG) {
67
error_reporting(0);
7-
}
8-
else{
8+
} else {
99
error_reporting(E_ERROR | E_WARNING | E_PARSE);
1010
}
1111

1212
if (!empty(filter_input(INPUT_POST, 'consent', FILTER_SANITIZE_STRING))) {
1313
if ($_SESSION['csrf_token'] !== filter_input(INPUT_POST, 'csrf_token', FILTER_SANITIZE_STRING)) {
14-
14+
1515
// CSRF miss-match so redirecting to home page
16-
header('Location: '. getSiteURL('/'));
16+
header('Location: '.getSiteURL('/'));
1717
die();
1818
}
19-
$tradingPair = !empty(filter_input(INPUT_POST, 'trading_pair', FILTER_DEFAULT , FILTER_REQUIRE_ARRAY)) ? $_POST['trading_pair'] : ['inr'];
19+
$tradingPair = !empty(filter_input(INPUT_POST, 'trading_pair', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY)) ? $_POST['trading_pair'] : ['inr'];
2020
$apiKey = $_SESSION['api_key'] = filter_input(INPUT_POST, 'api_key', FILTER_SANITIZE_STRING);
2121
$apiSecret = $_SESSION['api_secret'] = filter_input(INPUT_POST, 'api_secret', FILTER_SANITIZE_STRING);
22-
22+
2323
$obj = new \BalanceSheet\BalanceSheet();
2424
$obj->listOrders($apiKey, $apiSecret, $tradingPair);
2525
die();
2626
}
2727

2828
$obj = new \BalanceSheet\BalanceSheet();
29-
$obj->index();
29+
$obj->index();

screenshots/full-page-view.png

3 KB
Loading

src/BalanceSheet.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public function jsonToTable(array $invests, float $usableBalance): void
201201
'invests' => $cards,
202202
'avg_percentage' => round(($totalPer / $ctr), 2, PHP_ROUND_HALF_UP),
203203
'total_profit' => round($totalProfit, 2, PHP_ROUND_HALF_UP),
204-
'total_crypto' => ($ctr + 1),
204+
'total_crypto' => $ctr,
205205
'wallet_balance' => $usableBalance,
206206
'csrf_token' => generateCSRFToken(),
207207
]);

0 commit comments

Comments
 (0)