. */ 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 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; while($operation = $operations->fetchArray()) { $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"] != "") continue; 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) { $val = GetAccountAmount($account["id"], $_SESSION["cur_month"], $_SESSION["cur_year"]); echo ""; 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["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()) { $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["amount"] < 0) echo ""; echo ""; echo ""; echo "\n"; } ?>
DescriptionDateDebitCreditCategoryAccount
" . $operation["description"] . "" . date("d/m/Y", mktime(0, 0, 0, $operation["month"]+1, $operation["day"]+1, $operation["year"])) . "" . number_format(-$operation["amount"], 2) . ""; else echo "" . number_format($operation["amount"], 2) . "" . $category["name"] . "" . $_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 Grégory Soutadé