noalyss  Version-9
ajax_manage_table_sql.php
<?php
/*
* This file is part of NOALYSS.
*
* PhpCompta is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* NOALYSS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhpCompta; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Copyright (2016) Author Dany De Bontridder <dany@alchimerys.be>
if (!defined('ALLOWED'))
die('Appel direct ne sont pas permis');
if ( ! defined ("AJAX_TEST")) {
echo "Can not be called directly but via AJAX";
return;
}
/**
* @file
* @brief Test the ajax call from test_manage_table_sql.php
*/
try {
$table=$http->request('table');
$action=$http->request('action');
$p_id=$http->request('p_id', "number");
$ctl_id=$http->request('ctl');
} catch(Exception $e) {
echo $e->getMessage();
}
require_once NOALYSS_INCLUDE."/lib/manage_table_sql.class.php";
require_once NOALYSS_INCLUDE."/database/acc_plan_sql.class.php";
if ($action=="input")
{
$obj->set_limit_fiche_qcode(5);
$obj->set_pk_value($p_id);
$obj->load();
$manage_table->add_json_param("TestAjaxFile",
NOALYSS_HOME."/../scenario/ajax_manage_table_sql.php");
$manage_table->set_object_name($ctl_id);
$manage_table->set_col_label('pcm_val', "Poste");
$manage_table->set_col_label('parent_accounting', "DĂ©pend");
$manage_table->set_col_label('pcm_lib', "Libellé");
$manage_table->set_col_label('pcm_type',
"Type de menu".Icon_Action::infobulle(33));
header('Content-type: text/xml; charset=UTF-8');
echo $manage_table->ajax_input()->saveXML();
return;
} elseif ($action=="save")
{
$obj->set_limit_fiche_qcode(5);
$obj->set_pk_value($p_id);
$obj->load();
$manage_table->set_object_name($ctl_id);
$manage_table->add_json_param("TestAjaxFile",
NOALYSS_HOME."/../scenario/ajax_manage_table_sql.php");
header('Content-type: text/xml; charset=UTF-8');
echo $manage_table->ajax_save()->saveXML();
return;
}
$e
$e
Definition: result_cat_card_summary.php:26
$table
$table
Definition: menu.inc.php:103
Icon_Action\infobulle
static infobulle($p_comment)
Display a info in a bubble, text is in message_javascript.
Definition: icon_action.class.php:97
HttpInput
manage the http input (get , post, request) and extract from an array
Definition: http_input.class.php:37
Manage_Table_SQL
Purpose is to propose a librairy to display a table content and allow to update and delete row ,...
Definition: manage_table_sql.class.php:65
$manage_table
$manage_table
Definition: ajax_accounting.php:47
$http
$http
Definition: action.common.inc.php:33
$ctl_id
$ctl_id
Definition: ajax_accounting.php:34
$action
$action
Definition: admin_repo.inc.php:32
$obj
$obj
Definition: ajax_accounting.php:43
$cn
$cn
Definition: ajax_anc_accounting.php:30
Acc_Plan_SQL
this class is above tmp_pcmn_sql and is a view of tmp_pcmn
Definition: acc_plan_sql.class.php:32
$p_id
$p_id
Definition: ajax_accounting.php:33