Format cleanup, small display fix in taxes/tax_type.php
[fa-stable.git] / frontaccounting.php
1 <?php
2         include_once('applications/application.php');
3         include_once('applications/customers.php');
4         include_once('applications/suppliers.php');
5         include_once('applications/inventory.php');
6         include_once('applications/manufacturing.php');
7         include_once('applications/dimensions.php');
8         include_once('applications/generalledger.php');
9         include_once('applications/setup.php');
10         include_once('themes/default/renderer.php');
11         $path_to_root=".";
12         include_once($path_to_root . "/includes/session.inc");
13
14         class front_accounting 
15                 {
16                 var $user;
17                 var $settings;
18                 var $applications;
19                 var $selected_application;
20                 // GUI
21                 var $menu;
22                 var $renderer;
23                 function front_accounting() 
24                                 {
25                                                         $this->renderer = new renderer();
26                                 }
27                 function add_application($app) 
28                                 {
29                                                         $this->applications[$app->id] = &$app;
30                                 }
31                 function get_application($id) 
32                                 {
33                                  if (isset($this->applications[$id]))
34                                         return $this->applications[$id];
35                                  return null;
36                                 }
37                 function get_selected_application() 
38                                 {
39                                                         if (isset($this->selected_application))
40                                  return $this->applications[$this->selected_application];
41                         foreach ($this->applications as $application)
42                                 return $application;
43                         return null;
44                                         }
45                 function display() 
46                                 {
47                                                         $this->init();
48                         $this->renderer->wa_header();
49                         $this->renderer->menu_header($this->menu);
50                         $this->renderer->display_applications($this);
51                         $this->renderer->menu_footer($this->menu);
52                         $this->renderer->wa_footer();
53                                 }
54                 function init() 
55                                 {
56                         $this->menu = new menu(_("Main  Menu"));
57                         $this->menu->add_item(_("Main  Menu"), "index.php");
58                         $this->menu->add_item(_("Logout"), "/account/access/logout.php");
59                         $this->applications = array();
60                         $this->add_application(new customers_app());
61                         $this->add_application(new suppliers_app());
62                         $this->add_application(new inventory_app());
63                         $this->add_application(new manufacturing_app());
64                         $this->add_application(new dimensions_app());
65                         $this->add_application(new general_ledger_app());
66                         $this->add_application(new setup_app());
67                         }       
68 }
69 ?>