Plugins  LAST
 All Data Structures Files Functions Variables Pages
index.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of NOALYSS.
5  *
6  * NOALYSS is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * NOALYSS is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with NOALYSS; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */
20 /* $Revision$ */
21 
22 // Copyright (c) 2002 Author Dany De Bontridder dany@alchimerys.be
23 
24 /**
25  * \file
26  * \brief main file for tools
27  *
28  */
29 
31 $version_plugin = SVNINFO;
32 Extension::check_version(6910);
33 require_once NOALYSS_INCLUDE.'/database/class_noalyss_sql.php';
34 require_once 'rapav_constant.php';
35 require_once NOALYSS_INCLUDE.'/lib/class_impress.php';
36 if ($cn->exist_schema('rapport_advanced') == false )
37 {
38  require_once('include/class_rapav_install.php');
39  $iplugn = new Rapav_Install($cn);
40  $iplugn->install();
41  echo_warning(_("L'extension est installée, pourriez-vous en vérifier le paramètrage ?"));
42 }
43 if ( $cn->get_value('select max(version_id) from rapport_advanced.version') < $rapav_version )
44 {
45  require_once('include/class_rapav_install.php');
46  $iplugn = new Rapav_Install($cn);
47  $iplugn->upgrade($rapav_version);
48 }
49 /*
50  * load javascript
51  */
52 ob_start();
53 require_once('rapav_javascript.js');
54 $j = ob_get_contents();
55 ob_end_clean();
56 echo create_script($j);
57 
58 $url = '?' . dossier::get() . "&plugin_code=" . $_REQUEST['plugin_code'] . "&ac=" . $_REQUEST['ac'];
59 $array = array(
60  array($url . '&sa=fo', _('Formulaire'), _('Création, modification, Paramètre'), 1),
61  array($url . '&sa=de', _('Génération'), _('Génération Déclaration / listing'), 2),
62  array($url . '&sa=hi', _('Historique'), _('Historique des déclarations faites'), 3)
63 );
64 
65 $sa = (isset($_REQUEST['sa'])) ? $_REQUEST['sa'] : "fo";
66 $def = 0;
67 switch ($sa)
68 {
69  case 'fo':
70  $def = 1;
71  break;
72  case 'de':
73  $def = 2;
74  break;
75  case 'hi':
76  $def = 3;
77  break;
78 }
79 
80 $cn = Dossier::connect();
81 // show menu
82 echo '<div style="float:right"><a class="mtitle" style="font-size:140%" href="http://wiki.noalyss.eu/doku.php?id=rapav:home" target="_blank">Aide</a>' .
83  '<span style="font-size:0.8em;color:red;display:inline">vers:SVNINFO</span>' .
84  '</div>';
85 
86 echo ShowItem($array, 'H', 'mtitle ', 'mtitle ', $def, ' style="width:80%;margin-left:10%;border-collapse: separate;border-spacing: 5px;"');
87 echo '<div class="content" style="width:80%;margin-left:10%">';
88 // include the right file
89 
90 // include the right file
91 if ($def == 1)
92 {
93  require_once('include/formulaire.inc.php');
94  exit();
95 }
96 
97 /* Déclaration */
98 if ($def == 2)
99 {
100  require_once('include/declaration.inc.php');
101  exit();
102 }
103 /* Historique */
104 if ($def == 3)
105 {
106  require_once 'include/historique.inc.php';
107  exit();
108 }
109 ?>
global $version_plugin
Definition: index.php:22
$_REQUEST['sa']
Definition: index.php:68
$cn
Definition: index.php:42
$sa
Definition: index.php:67
global $rapav_version
$def
Definition: index.php:69
$j
Definition: index.php:36
$array
Definition: index.php:42
$url
Definition: index.php:40