Update web view

Database.php :
	* Change account order
	* Forgot $db variable in LoadCategory
User.php :
	* Add default category for index 0
index.php :
	* Initialize $categories and $accounts arrays
	* Typo error for hidden accounts
	* Forgive credit on blocked account
	* Forgot to divide amounts by 100
	* Forgot to initialize tr_class variable in some case
This commit is contained in:
2012-05-22 20:29:08 +02:00
parent 102daf9a96
commit a5531465f6
4 changed files with 44 additions and 24 deletions

View File

@@ -88,7 +88,7 @@ function LoadUser($name)
$user->id = $row["id"];
$result = $db->query("SELECT * FROM account WHERE user='$user->id' ORDER BY default_account DESC, virtual, blocked, name ASC");
$result = $db->query("SELECT * FROM account WHERE user='$user->id' ORDER BY default_account DESC, hidden, blocked, virtual, name ASC");
$user->accounts = array();
@@ -96,7 +96,7 @@ function LoadUser($name)
array_push($user->accounts, $row);
// Shared accounts
$result = $db->query("SELECT * FROM account WHERE id IN (SELECT account FROM shared_account WHERE user='$user->id') ORDER BY name, blocked, virtual ASC");
$result = $db->query("SELECT * FROM account WHERE id IN (SELECT account FROM shared_account WHERE user='$user->id') ORDER BY default_account DESC, hidden, blocked, virtual, name ASC");
while ($row = $result->fetchArray())
array_push($user->accounts, $row);
@@ -125,6 +125,8 @@ function LoadUser($name)
function LoadCategory(&$user, $id)
{
global $db;
$result = $db->query("SELECT * FROM category WHERE id='$id'");
if ($row = $result->fetchArray())