Plugins  LAST
 All Data Structures Files Functions Variables Pages
ajax.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 USA
18 */
19 /* $Revision$ */
20 
21 // Copyright (c) 2002 Author Dany De Bontridder dany@alchimerys.be
22 
23 /*!\file
24  * \brief ajax handling for AMORTIZING
25  *@parameter $t is the target
26  *@parameter $op is the request action
27  *@return xml <ctl> the destination object <code> the HTML to display <extra> various usage
28  */
29 extract ($_REQUEST);
30 
31 $ctl=$t;
32 $html='opération non trouvée';
33 $extra='';
34 $close=HtmlInput::anchor_close($t);
35 $html=$close.$html;
36 switch($op)
37  {
38  /*
39  * Show a form to add new material
40  */
41  case 'add_mat':
42  ob_start();
43  echo $close;
44  require_once('include/material_add.inc.php');
45  $html=ob_get_contents();
46  ob_end_clean();
47  break;
48  /*
49  * save the new material
50  */
51  case 'save_new_material':
52  ob_start();
53  echo $close;
54  require_once('include/material_new.inc.php');
55  $html=ob_get_contents();
56  ob_end_clean();
57  break;
58  case 'display_modify':
59  ob_start();
60  require_once('include/material_modify.inc.php');
61  $html=ob_get_contents();
62  ob_end_clean();
63  break;
64 
65  case 'save_modify':
66  ob_start();
67  echo '<span id="result" style="float:left;background:red;color:white">Sauvé</span>';
68 
69  require_once('include/material_save.inc.php');
70  $f=$cn->get_value("select f_id from fiche join fiche_detail using (f_id) where ad_id=23 and ad_value=$1",array($_POST['p_card']));
71  require_once('include/material_modify.inc.php');
72  $html=ob_get_contents();
73  ob_end_clean();
74  break;
75  case 'rm':
76  ob_start();
77  require_once('include/material_delete.inc.php');
78  $html=ob_get_contents();
79  ob_end_clean();
80  break;
81 
82  }
83 $xml=escape_xml($html);
84 if (headers_sent()) {
85  echo $html;
86 } else
87 {
88  header('Content-type: text/xml; charset=UTF-8');
89  echo '<?xml version="1.0" encoding="UTF-8"?>';
90  echo '<data>';
91  echo '<ctl>'.$ctl.'</ctl>';
92  echo '<code>'.$xml.'</code>';
93  echo '<extra>'.$extra.'</extra>';
94  echo '</data>';
95 }
$f
Definition: show_field.php:4
switch($op) $xml
Definition: ajax.php:83
$html
Definition: ajax.php:32
global $cn
Definition: ajax.php:27
$ctl
Definition: ajax.php:31
$extra
Definition: ajax.php:33
$_REQUEST['sb']
Definition: am_print.php:39
if($oPeriode->is_closed()==1) $op
$close
Definition: ajax.php:34