noalyss Version-9
ajax_anc_key_clean.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/**
20 * @file
21 * @brief show the available distribution keys for analytic activities. Expected
22 * parameter are
23 * - t for the table id
24 * - amount is the amount to distributed
25 *
26 */
27// Copyright (2014) Author Dany De Bontridder danydb@aevalys.eu
28if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
29
31
32try
33{
34 $amount=$http->get("amount", "number");
35 $table_id=$http->get("t");
36 $ledger=$http->get('led',"number");
37 $jrnx_id=$http->get("jrnx_id","string","");
38 $sequence=$http->get("p_seq","number");
39}
40catch (Exception $exc)
41{
42 error_log($exc->getTraceAsString());
43 return;
44}
45
46
47global $g_user;
48
49if ($g_user->get_ledger_access($ledger)=='W')
50{
51 ob_start();
52 $anc_op = new Anc_Operation($cn);
53 $anc_op->j_id = $jrnx_id;
54 $anc_op->in_div= $t ;
55
56 /* compute total price */
57 bcscale(2);
58// echo $anc_op->display_table(1, $amount, $t);
59 echo $anc_op->display_form_plan(NULL,1,1,$sequence,$amount,$table_id,FALSE);
60
61 $response = ob_get_clean();
62} else {
63 $response = _("Interdit");
64}
66header('Content-type: text/xml; charset=UTF-8');
67echo <<<EOF
68<?xml version="1.0" encoding="UTF-8"?>
69<data>
70<ctl></ctl>
71<code>$html</code>
72</data>
73EOF;
74?>
catch(Exception $exc) global $g_user
this class is used to show the form for entering an operation only FOR analytic operation to save it,...
manage the http input (get , post, request) and extract from an array
escape_xml($p_xml)
When data are transfered thanks ajax in a xml document, the xml can not contains some character,...