. */ include "kisscount.php" ; session_start(); ?> KissCount

Invalid password

\n"; else $display_login = 0; } if ($display_login == 1) { $users = GetUsers(); echo "

KissCount



\n"; echo "
\n"; echo "Login :

\n"; echo "Password :

\n"; echo "\n"; echo "
\n"; echo "

\n"; echo "
KissCount © 2010-2018 Grégory Soutadé
\n"; die(); } else $_SESSION["user"] = LoadUser($_POST["user"]); } if (!isset($_SESSION["operations"])) { $_SESSION["operations"] = GetAllOperations($_SESSION["user"], $_SESSION["last_year"], $_SESSION["last_month"]); } if (!isset($_POST["year"])) { $_SESSION["cur_year"] = $_SESSION["last_year"]; $_SESSION["cur_month"] = $_SESSION["last_month"]; } else { $_SESSION["cur_year"] = $_POST["year"]; $_SESSION["cur_month"] = $_POST["month"]; } $operations = LoadMonth($_SESSION["user"], $_SESSION["cur_month"], $_SESSION["cur_year"]); $cur_date = mktime(0, 0, 0, date("m") , date("d"), date("Y")); $total_incomes = $total_outcomes = $cur_incomes = $cur_outcomes = 0; $categories = array(); $accounts = array(); // Init arrays foreach($_SESSION["user"]->accounts as $i => $account) { $accounts[$account["id"]]["total"] = 0; $accounts[$account["id"]]["cur"] = 0; } foreach($_SESSION["user"]->categories as $i => $category) { $categories[$category["id"]] = 0; } // Statistics foreach($operations as $i => $operation) { if ($operation["meta"] == "1") continue; $date = mktime(0, 0, 0, $operation["month"]+1, $operation["day"]+1, $operation["year"]); $accounts[$operation["account"]]["total"] += $operation["amount"]; if ($date <= $cur_date) $accounts[$operation["account"]]["cur"] += $operation["amount"]; // Forgive transfert on non blocked accounts if ($operation["transfert"] != "" && !$_SESSION["user"]->IsAccountBlocked($operation["account"])) continue; // Forgive credit on blocked account if ($operation["transfert"] == "" && $_SESSION["user"]->IsAccountBlocked($operation["account"])) continue; if ($operation["transfert"] != "") $operation["amount"] = -$operation["amount"]; if ($operation["amount"] < 0) { $categories[$operation["category"]] -= $operation["amount"]; $total_outcomes -= $operation["amount"]; if ($date <= $cur_date) $cur_outcomes -= $operation["amount"]; } else { $total_incomes += $operation["amount"]; if ($date <= $cur_date) $cur_incomes += $operation["amount"]; } } ?>
Disconnect

accounts as $i => $account) { $cur_date = $_SESSION["cur_year"] . "-" . $_SESSION["cur_month"]; if ($account["hidden"] == "1" || $account["end"] < ($cur_date . "-01") || $account["start"] > ($cur_date . "-30")) continue; $val = GetAccountAmount($account["id"], $_SESSION["cur_month"], $_SESSION["cur_year"]); echo ""; if ($account["shared"] == "1") echo ""; else echo ""; echo ""; echo ""; if (($accounts[$account["id"]]["cur"] + $val) < 0) echo "" ; else echo "" ; echo "" ; echo "\n"; } ?>
Account numberAccount nameInitial valueCur valueFinal value
" . $account["number"] . "*" . $account["number"] . "" . $account["name"] . "" . number_format($val/100, 2) . "" . number_format(($accounts[$account["id"]]["cur"] + $val)/100, 2) . "" . number_format(($accounts[$account["id"]]["cur"] + $val)/100, 2) . "" . number_format(($accounts[$account["id"]]["total"] + $val)/100, 2) . "


$operation) { $category = $_SESSION["user"]->GetCategory($operation["category"]); $tag = $_SESSION["user"]->GetTag($operation["tag"]); if ($operation["fix_cost"] == "0") { $cur_week = date("W", mktime(0, 0, 0, $operation["month"]+1, $operation["day"]+1, $operation["year"])); if ($cur_week > $prev_week) { $tr_class = "class=\"new_week\""; $prev_week = $cur_week; } else $tr_class = ""; } else $tr_class = ""; if ($operation["meta"] == "1") echo ""; else { if ($operation["parent"] == "") echo ""; else echo ""; } echo ""; if ($operation["meta"] == "1" && $operation["amount"] == 0) { $amount = MetaPositiveAmount($operation["id"])/100; echo ""; echo ""; } else { if ($operation["amount"] < 0) echo ""; } if ($operation["meta"] != "1" && $category["id"] > 1) echo ""; else echo ""; echo ""; echo "\n"; } ?>
DescriptionDateDebitCreditCategoryAccountTag
" . $operation["description"] . "
" . $operation["description"] . "
" . number_format(($total_incomes - $total_outcomes)/100, 2) . ""; else echo ""; ?> categories as $i => $category) { // Non fix if ($i == 1) { $value = $total_outcomes - $categories[1]; if ($total_outcomes == 0) $percent = 0; else { $percent = ($value * 100) / $total_outcomes; $percent = round($percent, 0); $percent = ($percent < 10) ? "0$percent" : "$percent"; } echo "\n"; } if ($total_outcomes == 0) $percent = 0; else { $percent = ($categories[$category["id"]] * 100) / $total_outcomes; $percent = round($percent, 0); $percent = ($percent < 10) ? "0$percent" : "$percent"; } echo "\n"; } ?>
Cur credit
Cur debit
Total credit
Total debit
Remains " . number_format(($total_incomes - $total_outcomes)/100, 2) . "
_
Non fix" . number_format($value/100, 2) . " ($percent %)
" . $category["name"]. "" . number_format($categories[$category["id"]]/100, 2) . " ($percent %)


KissCount © 2010-2018 Grégory Soutadé