noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
ajax_anc_key_compute.php
Go to the documentation of this file.
00001 <?php
00002 /*
00003  *   This file is part of NOALYSS.
00004  *
00005  *   NOALYSS is free software; you can redistribute it and/or modify
00006  *   it under the terms of the GNU General Public License as published by
00007  *   the Free Software Foundation; either version 2 of the License, or
00008  *   (at your option) any later version.
00009  *
00010  *   NOALYSS is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with NOALYSS; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 
00020 // Copyright 2014 Author Dany De Bontridder danydb@aevalys.eu
00021 // @brief Compute the amount. This file compute the amount and distribute it
00022 // following the given distribution key given in parameter.
00023 // Parameters are :
00024 //   - gDossier
00025 //   - t the element HTML to use as target
00026 //   - amount the amount to distribute
00027 //   - key the Distribution key to use
00028 // 
00029 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
00030 
00031 require_once 'class_anc_key.php';
00032 ob_start();
00033 /////
00034 $key=HtmlInput::default_value_get('key',0);
00035 $amount=HtmlInput::default_value_get('amount',0);
00036 $target=HtmlInput::default_value_get('t','');
00037 
00038 if (        isNumber($key)== 0
00039         ||  isNumber($amount) ==0
00040         || $target==''
00041     ) 
00042 {
00043     die ('Invalid parameter');
00044 }
00045 
00046 $compute_key=new Anc_Key($key);
00047 
00048 $compute_key->fill_table($target,$amount);
00049 
00050 ////
00051 $response = ob_get_clean();
00052 $html = escape_xml($response);
00053 header('Content-type: text/xml; charset=UTF-8');
00054 echo <<<EOF
00055 <?xml version="1.0" encoding="UTF-8"?>
00056 <data>
00057 <ctl></ctl>
00058 <code>$html</code>
00059 </data>
00060 EOF;
00061 ?>        
 All Data Structures Namespaces Files Functions Variables Enumerations