. */ 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-2011 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"]; } if (isset($_POST["expand"])) $_SESSION["expand"] = "1"; else $_SESSION["expand"] = "0"; $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; while($operation = $operations->fetchArray()) { 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"]; if (!($operation["transfert"] == "" || ($operation["amount"] > 0 && $_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"]; } } ?>
>Expand groups
Disconnect

accounts as $i => $account) { $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, 2) . "" . number_format($accounts[$account["id"]]["cur"] + $val, 2) . "" . number_format($accounts[$account["id"]]["cur"] + $val, 2) . "" . number_format($accounts[$account["id"]]["total"] + $val, 2) . "


fetchArray()) { if ($_SESSION["expand"] == "1") { if ($operation["meta"] == "1") continue; } else { if ($operation["parent"] != "") continue; } $category = $_SESSION["user"]->GetCategory($operation["category"]); 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 = ""; } echo ""; echo ""; if ($operation["meta"] == "1" && $operation["amount"] == 0) { $amount = MetaPositiveAmount($operation["id"]); echo ""; echo ""; } else { if ($operation["amount"] < 0) echo ""; } if ($operation["meta"] != "1") echo ""; else echo ""; echo "\n"; } ?>
DescriptionDateDebitCreditCategoryAccount
" . $operation["description"] . "" . date("d/m/Y", mktime(0, 0, 0, $operation["month"]+1, $operation["day"]+1, $operation["year"])) . "" . number_format($amount, 2) . "" . number_format($amount, 2) . "" . number_format(-$operation["amount"], 2) . ""; else echo "" . number_format($operation["amount"], 2) . "" . $category["name"] . ""; echo "" . $_SESSION["user"]->GetAccountName($operation["account"]) . "
" . number_format($total_incomes - $total_outcomes, 2) . ""; else echo ""; ?> categories as $i => $category) { $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, 2) . "
_
" . $category["name"]. "" . number_format($categories[$category["id"]], 2) . " ($percent %)


KissCount © 2010-2011 Grégory Soutadé