Clear some bullshit code

This commit is contained in:
Djery-Tom 2021-10-15 09:41:18 +01:00
parent 532241006a
commit 2a1d4f05f0
1 changed files with 10 additions and 54 deletions

View File

@ -10,60 +10,16 @@
use Brick\Money\Money; use Brick\Money\Money;
$context = new \Brick\Money\Context\AutoContext(); $context = new \Brick\Money\Context\AutoContext();
$month = time(); //$month = time();
$months[] = convertDate(date("M")); //$months[] = convertDate(date("M"));
$label_months [] = date("M") . " " . date("Y"); //$label_months [] = date("M") . " " . date("Y");
$years[] = date("Y"); //$years[] = date("Y");
for ($i = 1; $i <= 11; $i++) { //for ($i = 1; $i <= 11; $i++) {
$month = strtotime('last month', $month); // $month = strtotime('last month', $month);
$months [] = convertDate(date("M", $month)); // $months [] = convertDate(date("M", $month));
$years[] = date("Y", $month); // $years[] = date("Y", $month);
$label_months [] = date("M", $month) . " " . date("Y", $month); // $label_months [] = date("M", $month) . " " . date("Y", $month);
} //}
/**
** Retraits
**/
$date = date("Y");
$retraits_data[] = '';
$retraits_data = array();
for ($i = 1; $i <= 12; $i++) {
$retraits_query_mounth = $this->db->query("SELECT id FROM infos_transaction
WHERE network_id='" . $network_id . "'
AND MONTH(date_created) = '" . $months[$i - 1] . "'
AND YEAR(date_created) = '" . $years[$i - 1] . "'
AND type_transac='debit'");
$retraits_data[] = $retraits_query_mounth->num_rows();
}
$startDate = (new DateTime('01-' . $months[11] . '-' . $years[11]))->format('Y-m-d H:i:s');
$endDate = date_create_from_format('m/Y', $months[0] . '/' . $years[0])->format('Y-m-d H:i:s');
$retraits = $this->db->query("SELECT * FROM infos_transaction
WHERE network_id='" . $network_id . "'
AND date_created BETWEEN '" . $startDate . "' AND '" . $endDate . "'
AND type_transac='debit'");
/**
** Dépots
**/
$date = date("Y");
$depots_data[] = '';
$depots_data = array();
for ($i = 1; $i <= 12; $i++) {
$depots_query_mounth = $this->db->query("SELECT id FROM infos_transaction
WHERE network_id='" . $network_id . "'
AND MONTH(date_created) = '" . $months[$i - 1] . "'
AND YEAR(date_created) = '" . $years[$i - 1] . "'
AND type_transac='credit'");
$depots_data[] = $depots_query_mounth->num_rows();
}
$depots = $this->db->query("SELECT * FROM infos_transaction
WHERE network_id='" . $network_id . "'
AND date_created BETWEEN '" . $startDate . "' AND '" . $endDate . "'
AND type_transac='credit'");
//if ($transactions != false) { //if ($transactions != false) {
// $transac = $transactions->num_rows(); // $transac = $transactions->num_rows();