noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
export_ledger_pdf.php
Go to the documentation of this file.
00001 <?php
00002 
00003 /*
00004  *   This file is part of NOALYSS.
00005  *
00006  *   NOALYSS is free software; you can redistribute it and/or modify
00007  *   it under the terms of the GNU General Public License as published by
00008  *   the Free Software Foundation; either version 2 of the License, or
00009  *   (at your option) any later version.
00010  *
00011  *   NOALYSS is distributed in the hope that it will be useful,
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *   GNU General Public License for more details.
00015  *
00016  *   You should have received a copy of the GNU General Public License
00017  *   along with NOALYSS; if not, write to the Free Software
00018  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 
00021 
00022 // Copyright Author Dany De Bontridder danydb@aevalys.eu
00023 /* ! \file
00024  * \brief Send a ledger in a pdf format
00025  *
00026  */
00027 if (!defined('ALLOWED'))
00028     die('Appel direct ne sont pas permis');
00029 require_once('class_dossier.php');
00030 $gDossier = dossier::id();
00031 require_once('class_pdf.php');
00032 include_once('class_user.php');
00033 include_once("ac_common.php");
00034 require_once('class_database.php');
00035 include_once("class_impress.php");
00036 include_once("class_acc_ledger.php");
00037 require_once('class_own.php');
00038 require_once('class_periode.php');
00039 require_once 'class_print_ledger.php';
00040 
00041 
00042         $cn = new Database($gDossier);
00043 $periode = new Periode($cn);
00044 
00045 $l_type = "JRN";
00046 $own = new Own($cn);
00047 
00048 $Jrn = new Acc_Ledger($cn, $_GET['jrn_id']);
00049 
00050 $Jrn->get_name();
00051 $g_user->Check();
00052 $g_user->check_dossier($gDossier);
00053 
00054 // Security
00055 if ($_GET['jrn_id'] != 0 && $g_user->check_jrn($_GET['jrn_id']) == 'X') {
00056     /* Cannot Access */
00057     NoAccess();
00058 }
00059 
00060 $ret = "";
00061 
00062 $jrn_type = $Jrn->get_type();
00063 
00064 $pdf = Print_Ledger::factory($cn, $_REQUEST['p_simple'], "PDF", $Jrn);
00065 
00066 $pdf->setDossierInfo($Jrn->name);
00067 $pdf->AliasNbPages();
00068 $pdf->AddPage();
00069 $pdf->SetAuthor('NOALYSS');
00070 $pdf->setTitle("Journal", true);
00071 
00072 $pdf->export();
00073 
00074 $fDate = date('dmy-Hi');
00075 $pdf->Output('journal-' . $fDate . '.pdf', 'D');
00076 exit(0);
00077 
00078 
00079 ?>
 All Data Structures Namespaces Files Functions Variables Enumerations