0)) ? $auth : $_COOKIE["id"]; $user = get_user($id); /* Get user info */ if (!$user){ include("login.php"); return; } else { $time = time() + $validtime; $session = add_session($id, $time); if ($session > 0) { setcookie("id", $id, $time); setcookie("session", $session, $time); } } $login = $user["login"]; $table = $user["table"]; $type = $user["type"]; $jsflag = $user["jsflag"]; /* Get date */ $yearmonth = $_COOKIE["date"]; if (isset($_POST["month"]) && isset($_POST["year"])) $yearmonth = sprintf("%04d%02d", $_POST["year"], $_POST["month"]); if ($yearmonth != strftime("%Y%m", strtotime($yearmonth."01"))) $yearmonth = strftime ("%Y%m"); setcookie("date", $yearmonth, time() + $validtime); $month = strftime ("%m", strtotime($yearmonth."01")); $year = strftime ("%Y", strtotime($yearmonth."01")); /* chek sort order */ $sort = (isset($_GET["sort"])) ? $_GET["sort"] : ((isset($_COOKIE["sort"])) ? $_COOKIE["sort"] : "d"); setcookie("sort", $sort, time() + $validtime); /* Add database connection */ require_once($lib_dir . "account.php"); require_once($lib_dir . "category.php"); require_once($lib_dir . "misc.php"); require_once($lib_dir . "transaction.php"); if ($jsflag) { $jsfuncs = "\nfunction acclist(id, selected) {\n sellist(id"; $null = ""; for ($i=0; $i