KissCount

KissCount Commit Details

Date:2014-11-27 18:27:31 (5 years 7 months ago)
Author:Grégory Soutadé
Branch:dev, master, qt5
Commit:54945703b6d55e92e7c76144b9e23c96d57e5dac
Parents: e9e0e35c1267470954e162da26778a0919d1719c
Message:Update web view

Changes:
Mwww/User.php (2 diffs)
Mwww/database.php (1 diff)
Mwww/index.php (4 diffs)

File differences

www/User.php
2323
2424
2525
26
2627
2728
2829
......
4445
4546
4647
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
4764
4865
4966
public $id;
public $accounts;
public $categories;
public $tags;
public $preferences;
function GetCategory($id)
return LoadCategory($this, $id);
}
function GetTag($id)
{
if ($id == "" || $id == "0")
{
$tag["id"] = 0;
$tag["name"] = "";
return $tag;
}
foreach($this->tags as $i => $tag)
if ($tag["id"] == "$id") return $tag;
return LoadTag($this, $id);
}
function IsAccountBlocked($id)
{
foreach($this->accounts as $i => $account)
www/database.php
140140
141141
142142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
143159
144160
145161
return "";
}
function LoadTag(&$user, $id)
{
global $db;
$result = $db->query("SELECT * FROM tag WHERE id='$id'");
if ($row = $result->fetchArray())
{
array_push($user->tags, $row);
return $row;
}
return "";
}
function GetAccountAmount($id, $month, $year)
{
global $db;
www/index.php
245245
246246
247247
248
248
249249
250250
251251
......
253253
254254
255255
256
256257
257258
258259
......
294295
295296
296297
298
297299
298300
299301
......
351353
352354
353355
354
356
355357
356358
<br /><br />
<div id="operations">
<table>
<tr class="header" bgcolor="#99CCFF"><td/><td>Description</td><td>Date</td><td>Debit</td><td>Credit</td><td>Category</td><td>Account</td></tr>
<tr class="header" bgcolor="#99CCFF"><td/><td>Description</td><td>Date</td><td>Debit</td><td>Credit</td><td>Category</td><td>Account</td><td>Tag</td></tr>
<?php
$prev_week=-1;
$operations = LoadMonth($_SESSION["user"], $_SESSION["cur_month"], $_SESSION["cur_year"]);
foreach($operations as $i => $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"]));
else
echo "<td />";
echo "<td>" . $_SESSION["user"]->GetAccountName($operation["account"]) . "</td>";
echo "<td>" . $tag["name"] . "</td>";
echo "</tr>\n";
}
?>
</div>
</div>
<br /><br />
<center><a href="http://indefero.soutade.fr/p/kisscount">KissCount</a> &copy; 2010-2012 Grégory Soutadé</center>
<center><a href="http://indefero.soutade.fr/p/kisscount">KissCount</a> &copy; 2010-2014 Grégory Soutadé</center>
</body>
</html>

Archive Download the corresponding diff file