noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
ajax_get_receipt.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 Author Dany De Bontridder danydb@aevalys.eu
00021 
00022 /*!\file
00023  * \brief respond ajax request, the get contains
00024  *  the value :
00025  * - l for ledger
00026  * - gDossier
00027  * Must return at least tva, htva and tvac
00028 
00029  */
00030 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
00031 
00032 require_once ('constant.php');
00033 require_once ('class_database.php');
00034 require_once('class_dossier.php');
00035 require_once('class_acc_ledger.php');
00036 require_once ('class_user.php');
00037 
00038 // Check if the needed field does exist
00039 extract ($_GET);
00040 foreach (array('l','gDossier') as $a)
00041 {
00042     if ( ! isset (${$a}) )
00043     {
00044         echo "error $a is not set ";
00045         exit();
00046     }
00047 
00048 }
00049 if ( is_numeric($l) == false  )
00050 {
00051     exit();
00052 }
00053 
00054 
00055 $Ledger=new Acc_Ledger($cn,$l);
00056 $prop=$Ledger->get_propertie();
00057 $pj_seq=$Ledger->guess_pj();
00058 $string='{"pj":"'.$pj_seq.'"}';
00059 
00060 header("Content-type: text/json; charset: utf8",true);
00061 echo $string;
00062 
00063 
00064 ?>
00065 
 All Data Structures Namespaces Files Functions Variables Enumerations