noalyss Version-9
ajax_payment_method.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * PhpCompta 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 * PhpCompta 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 PhpCompta; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20// Copyright (2018) Author Dany De Bontridder <dany@alchimerys.be>
21
22if (!defined('ALLOWED'))
23 die('Appel direct ne sont pas permis');
24
25/**
26 * @file
27 * @brief Manage the payement method, existing variable (from ajax_misc.php)
28 * - $http
29 * - $gDossier
30 * - $cn
31 *
32 * @see Payment_Method_SQL
33 * @see Payment_Method_MTable
34 *
35 */
36require_once NOALYSS_INCLUDE."/database/payment_method_sql.class.php";
37
38$id=$http->request("p_id", "number", -1);
39$action=$http->request("action");
40$ctl=$http->request("ctl");
41
44
45$payment_method_mtable->add_json_param("op", "payment_method");
46$payment_method_mtable->set_callback("ajax_misc.php");
47$payment_method_mtable->set_object_name($ctl);
48
49// Display a form for modifying or adding an element
50if ($action=="input")
51{
52 $payment_method_mtable->send_header();
53 echo $payment_method_mtable->ajax_input()->saveXML();
54 return;
55}
56// Save it
57elseif ($action=="save")
58{
59 $xml=$payment_method_mtable->ajax_save();
60 $payment_method_mtable->send_header();
61 echo $xml->saveXML();
62 return;
63}
64// delete the row
65elseif ($action=="delete")
66{
67 $payment_method_mtable->send_header();
68 echo $payment_method_mtable->ajax_delete()->saveXML();
69 return;
70}
switch($op2) $xml
Definition: ajax_card.php:806
$payment_method_mtable
$payment_method_sql
Manage the Payment method.
abstract of the table public.payment_method
if( $delta< 0) elseif( $delta==0)