<?php
  /**************************************************************************\
  * phpGroupWare app (Bookkeeping)                                           *
  * http://www.phpgroupware.org                                              *
  * Written by Rick Bakker <r.bakker@linvision.com>                          *
  * --------------------------------------------                             *
  *  This program is free software; you can redistribute it and/or modify it *
  *  under the terms of the GNU General Public License as published by the   *
  *  Free Software Foundation; either version 2 of the License, or (at your  *
  *  option) any later version.                                              *
  \**************************************************************************/

  $entries='<a href="'.$phpgw->link('/bookkeeping/index.php').'">'.lang('entries').'</a>';
  $categories='&nbsp;&nbsp;&nbsp;<a href="'.$phpgw->link('/bookkeeping/categories.php').'">'.lang('categories').'</a>';
  $statistics='&nbsp;&nbsp;&nbsp;<a href="'.$phpgw->link('/bookkeeping/statistics.php').'">'.lang('statistics').'</a>';
  $reports='&nbsp;&nbsp;&nbsp;<a href="'.$phpgw->link('/bookkeeping/reports.php').'">'.lang('reports').'</a>';
  $logging='&nbsp;&nbsp;&nbsp;<a href="'.$phpgw->link('/bookkeeping/logging.php').'">'.lang('logging').'</a>';

  $admin='no';
  $sql='select * from phpgw_bk_general';
  $phpgw->db->query($sql);
  $numrows=$phpgw->db->num_rows();
  for($i=0;$i<$numrows;$i++){
    $phpgw->db->next_record();
    $name=$phpgw->db->f('name');
    if($name=='admins'){
      $value=$phpgw->db->f('value');
      for($token=strtok($value,':');$token!='';$token=strtok(':'))
      {
        if($token==$phpgw_info["user"]["account_id"])
        {
          $admin='yes';
        }
      }
    }
  }
  if($admin=='yes'){
    $header=$entries.$categories.$statistics.$reports.$logging;
  }
  else
  {
    $header=$entries.$statistics.$reports;
  }

?>
