noalyss
Version-9
include
ajax
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
22
if
(!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
*/
36
require_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
42
$payment_method_sql
=
new
Payment_method_SQL
(
$cn
,
$id
);
43
$payment_method_mtable
=
new
Payment_Method_MTable
(
$payment_method_sql
);
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
50
if
(
$action
==
"input"
)
51
{
52
$payment_method_mtable
->send_header();
53
echo
$payment_method_mtable
->ajax_input()->saveXML();
54
return
;
55
}
56
// Save it
57
elseif
(
$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
65
elseif
(
$action
==
"delete"
)
66
{
67
$payment_method_mtable
->send_header();
68
echo
$payment_method_mtable
->ajax_delete()->saveXML();
69
return
;
70
}
$http
$http
Definition:
action.common.inc.php:33
$cn
$cn
Definition:
ajax_anc_accounting.php:30
$xml
switch($op2) $xml
Definition:
ajax_card.php:806
$payment_method_mtable
$payment_method_mtable
Definition:
ajax_payment_method.php:43
$ctl
$ctl
Definition:
ajax_payment_method.php:40
$payment_method_sql
$payment_method_sql
Definition:
ajax_payment_method.php:42
$action
$action
Definition:
ajax_payment_method.php:39
$id
$id
Definition:
ajax_payment_method.php:38
Payment_Method_MTable
Manage the Payment method.
Definition:
payment_method_mtable.class.php:36
Payment_method_SQL
abstract of the table public.payment_method
Definition:
payment_method_sql.class.php:31
elseif
if( $delta< 0) elseif( $delta==0)
Definition:
letter_prop.php:166