Main Page | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

listing_client.php

Go to the documentation of this file.
00001 <?
00002 /*
00003  *   This file is part of PhpCompta.
00004  *
00005  *   PhpCompta 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  *   PhpCompta 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 PhpCompta; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 /* $Revision: 1.4 $ */
00020 // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
00021 require_once("ac_common.php");
00022 require_once("postgres.php");
00026 //-----------------------------------------------------
00027 // Check User
00028 include ('class_user.php');
00029 /* Admin. Dossier */
00030 $cn=DbConnect($_SESSION['g_dossier']);
00031 
00032 $User=new cl_user($cn);
00033 $User->Check();
00034 
00035 // TODO a specific level of security for the "bilan" ???
00036 // Change must be done here
00037 if ($User->CheckAction($cn,IMP) == 0 ){
00038     /* Cannot Access */
00039     NoAccess();
00040   }
00041 
00042 header('Content-type: application/bin');
00043 header('Content-Disposition: attachment;filename="declaration.bin"',FALSE);
00044 
00045 //-----------------------------------------------------
00046 // Submit for a magnetic declaration
00047 // Belgium only
00048 //-----------------------------------------------------
00049 if ( isset($_POST['bt_disk'])) {
00050   require_once("class_customer.php");
00051   $customer=new Customer($cn);
00052   $a_Res=$customer->VatListing($_POST['year']);
00053 
00054   require_once("decla.BE.inc.php");
00055   $a=MakeListingVat($cn,$a_Res,$_POST['year']);
00056   echo "$a";
00057   return;
00058  }
00059 ?>