示例#1
0
 public function index()
 {
     $this->fix();
     echo '<h1>Tree of Accounts</h1>';
     echo util::link('New Account', 'acc');
     echo '<table>';
     $this->recurse();
     echo '</table>';
     echo '<h1>Transaction List</h1>';
     echo '<p>' . util::link('Log out', 'log', 'out') . '</p>';
     echo '<p>' . util::link('New Transaction', 'trn') . '</p>';
     echo '<table>';
     foreach ($this->db->query('select * from trn order by dte') as $trn) {
         echo '<tr><td colspan="2">' . util::link($trn['name'], 'trn', 'load', array('id' => $trn['id'])) . '</a> ' . $trn['dte'] . '</td></tr>';
         foreach ($this->db->query('select ent.amount, acc.name from ent inner join acc on ent.acc_id = acc.id where trn_id=? order by ent.amount desc', $trn['id']) as $ent) {
             echo '<tr><td>' . $ent['name'] . '</td><td>' . $ent['amount'] . '</td></tr>';
         }
         echo '<tr><td colspan="2"><hr /></tr>';
     }
     echo '</table>';
 }
示例#2
0
 function index()
 {
     echo 'Welcome! ' . util::link('Login', 'log', 'in') . ' or ' . util::link('Go To Secure Area', 'secure');
 }
示例#3
0
 public function out()
 {
     unset($_SESSION['id']);
     echo 'You have been logged out. ' . util::link();
 }