Plugins  LAST
 All Data Structures Files Functions Variables Pages
formulaire.inc.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 liste des déclarations + modification, création...
27  *
28  */
29 require_once 'class_rapav_formulaire.php';
30 require_once 'class_formulaire_param.php';
31 if ( isset($_POST['form_def_sub']))
32 {
33  if (isset($_POST['delete']))
34  {
35  $cn->exec_sql('delete from rapport_advanced.formulaire where f_id=$1',array($_POST['f_id']));
36  }
37  else
38  {
39  try
40  {
41  RAPAV_formulaire::save_definition($_POST);
42  echo '<p class="notice">'._(' dernière sauvegarde ').date('d-m-Y H:i').'</p>';
43  }
44  catch (Exception $exc)
45  {
46  echo '<p class="notice">'._(' Impossible de sauver').$exc->getMessage().'</p>';
47 
48  //throw $exc;
49  }
50  echo '<div id="form_mod_div">';
51  require_once 'formulaire_definition_show.inc.php';
52  echo '<hr>';
53  echo HtmlInput::button_action("Paramètre", sprintf("rapav_form_param('%s','%s','%s','%s')",$_REQUEST['plugin_code'],$_REQUEST['ac'],$_REQUEST['gDossier'],$_REQUEST['f_id'] ));
54  echo '</div>';
55  return;
56  }
57 }
58 if (isset ($_POST['add_form']))
59 {
60  $form= new RAPAV_Formulaire();
61  $form->f_title=trim($_POST['titre']);
62  $form->f_description=trim($_POST['description']);
63  $form->insert();
64 }
65 if ( isset ($_POST['restore_form'])) {
66  // Sauver fichier
67  if ( $_FILES['form']['name']==""||$_FILES["form"]["error"] != 0)
68  {
69  echo "Fichier non chargé";
70  }
71  Formulaire_Param::from_csv($_FILES['form']['tmp_name']);
72 
73 }
74 RAPAV_formulaire::listing();
75 
76 ?>
$_REQUEST['sb']
Definition: am_print.php:39
global $cn
static from_csv($filename)