From 399f1bd09fea21018f82cdd9082a2cae952fb341 Mon Sep 17 00:00:00 2001 From: Phyks Date: Fri, 9 Aug 2013 23:35:20 +0200 Subject: [PATCH] Started index page ; connect/disconnect working ; started edit password page --- index.php | 16 +++++++++++- tpl/connexion.html | 8 +++--- tpl/edit_users.html | 8 ++++++ tpl/header.html | 25 ++++++++++++++++++- tpl/index.html | 60 ++++++++++++++++++++++----------------------- 5 files changed, 81 insertions(+), 36 deletions(-) create mode 100644 tpl/edit_users.html diff --git a/index.php b/index.php index 9dd6244..f4cccf9 100644 --- a/index.php +++ b/index.php @@ -8,9 +8,14 @@ $tpl = new raintpl(); $tpl->assign('instance_title', INSTANCE_TITLE); + $tpl->assign('connection', false); + $tpl->assign('notice', ''); session_start(); $current_user = (isset($_SESSION['current_user']) ? unserialize($_SESSION['current_user']) : false); + $tpl->assign('admin', ($current_user !== false) ? (int) $current_user['admin'] : 0); + + $usersManager = new User(); if($current_user === false && (empty($_GET['do']) OR $_GET['do'] != 'connect')) { //If not connected, go to connection page header('location: index.php?do=connect'); @@ -35,6 +40,7 @@ $error = "Unknown username/password."; } } + $tpl->assign('connection', true); $tpl->draw('connexion'); break; @@ -43,8 +49,16 @@ session_destroy(); header('location: index.php?do=connect'); exit(); + break; + + case 'password': + + $tpl->draw('edit_users'); + break; default: - + $tpl->assign('users', array(0=>array("name"=>"truc"))); + $tpl->assign('bill', array(0=>array())); + $tpl->draw('index'); break; } diff --git a/tpl/connexion.html b/tpl/connexion.html index 59914cb..bd1fd66 100644 --- a/tpl/connexion.html +++ b/tpl/connexion.html @@ -1,9 +1,9 @@ {include="header"} -

{$instance_title} - Connexion

+

{$instance_title} - Connexion

-
-

-

+ +

+

diff --git a/tpl/edit_users.html b/tpl/edit_users.html new file mode 100644 index 0000000..b868bdc --- /dev/null +++ b/tpl/edit_users.html @@ -0,0 +1,8 @@ +{include="header"} + +

Edit your password

+
+

+

+

+
diff --git a/tpl/header.html b/tpl/header.html index eb88037..3e1e882 100755 --- a/tpl/header.html +++ b/tpl/header.html @@ -3,7 +3,30 @@ {$instance_title} - + +{if condition="!$connection"} +

{$instance_title}

+ +{if condition="$notice != ''"} +

{$notice}

+{/if} + + +{/if} diff --git a/tpl/index.html b/tpl/index.html index 048dd28..1cc2d9c 100755 --- a/tpl/index.html +++ b/tpl/index.html @@ -1,45 +1,45 @@ {include="header"} -

{$instance_title}

- -{$notice} - -
-

Qui doit quoi ?

-

Lire ligne doit case€ à colonne. Les liens permettent de confirmer le paiement des dettes.

- +

Balance

+

Read line owes case€ to column. You can click on links to confirm the payback. +

- + + {loop="users"} + + {/loop} + {loop="users"} + + + + {/loop}
Doit\ÀOwes\To{$value.name}
{$value.name}
-

Dépenses détaillées du mois actuel

+

Detailed list of bills for last month

- - - - - - + + + + + + + {loop="bill"} + + + + + + + + + + {/loop}
DatePayé parParticipantsMontantMenuModifierSupprimerPaid byUsers inAmountWhat ?EditDelete
{$value.date}{$value.buyer}{$value.users_in}{$value.amount}{$value.what}EditDelete