Plugins  LAST
 All Data Structures Files Functions Variables Pages
index.php
Go to the documentation of this file.
1 <?php
2 /*
3  * This file is part of NOALYSS.
4  *
5  * NOALYSS is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * NOALYSS is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with NOALYSS; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USAtv
18 */
19 /* $Revision$ */
20 
21 // Copyright (c) 2002 Author Dany De Bontridder dany@alchimerys.be
23 $version_plugin=SVNINFO;
24 Extension::check_version(6910);
25 /*!\file
26  * \brief main entry
27  */
28 require_once('amortis_constant.php');
29 require_once NOALYSS_INCLUDE.'/lib/class_database.php';
30 require_once NOALYSS_INCLUDE.'/class/class_dossier.php';
31 /*
32  * load javascript
33  */
34 ob_start();
35 require_once('amortize_javascript.js');
36 $j=ob_get_contents();
37 ob_end_clean();
38 echo create_script($j);
39 
40 $url='?'.dossier::get().'&plugin_code='.$_REQUEST['plugin_code'].'&ac='.$_REQUEST['ac'];
41 
42 $cn=Dossier::connect();;
43 
44 if ( $cn->exist_schema('amortissement') ==false )
45  {
46  require_once('include/class_install_plugin.php');
47  $plugin=new Install_Plugin($cn);
48  $plugin->install();
49  }
50 if ( $cn->get_value('select max(val) from amortissement.version') < $amortissement_version )
51 {
52  require_once('include/class_install_plugin.php');
53  $iplugn = new Install_Plugin($cn);
54  $current=$cn->get_value('select max(val) from amortissement.version') ;
55  for ( $e = $current;$e <= $amortissement_version ; $e++)
56  {
57  $iplugn->upgrade($e);
58  }
59 }
60 $menu=array(
61  array($url.'&sa=card','Biens amortissables','Liste des biens amortissables',1),
62  array($url.'&sa=report','Rapport','rapport et tableaux sur les biens amortissables',2),
63  array($url.'&sa=util','Utilitaire','Génération écriture comptable',3)
64  );
65 
66 
67 $sa=(isset($_REQUEST['sa']))?$_REQUEST['sa']:'card';
68 $_REQUEST['sa']=$sa;
69 $def=0;
70 
71 switch($sa)
72  {
73  case 'card':
74  $def=1;
75  break;
76  case 'report':
77  $def=2;
78  break;
79  case 'util':
80  $def=3;
81  break;
82  }
83 echo '<div style="float:right"><a class="mtitle" style="font-size:140%" href="http://wiki.noalyss.eu/doku.php?id=amortissement" target="_blank">Aide</a>'.
84 '<span style="font-size:0.8em;color:red;display:inline">vers:SVNINFO</span>'.
85 '</div>';
86 echo '<div class="topmenu">';
87 echo ShowItem($menu,'H','mtitle ','mtitle ',$def,'class="mtitle"');
88 echo '</div>';
89 
90 /* List + add and modify card */
91 if ($def==1)
92  {
93  require_once('include/am_card.php');
94  exit();
95  }
96 /* report */
97 if ( $def==2)
98  {
99  require_once('include/am_print.php');
100  exit();
101  }
102 /* Utility : write in accountancy */
103 if ( $def==3)
104  {
105  require_once('include/am_util.php');
106  exit();
107  }
global $version_plugin
Definition: index.php:22
$_REQUEST['sa']
Definition: index.php:68
$cn
Definition: index.php:42
$sa
Definition: index.php:67
$def
Definition: index.php:69
$j
Definition: index.php:36
$amortissement_version
$url
Definition: index.php:40
if($cn->exist_schema('amortissement')==false) if($cn->get_value('select max(val) from amortissement.version')< $amortissement_version) $menu
Definition: index.php:60