<?php
/****************************************************************************************
SMI (Services Maintenance Interventions) est une gestion libre de maintenance et de SAV

Version 0.9.9

Copyright (C) 2006-2009  Sylvain FATOME
This program 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.

This program 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 this program
(in the directory docs); 
if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 
Boston, MA  02110-1301, USA.

Contact : galawa@free.fr

Web : http://smitst.homelinux.com
****************************************************************************************/


// Vérification des tentatives de hack
$pos=strpos($_SERVER['PHP_SELF'],"inc.php");
if ($pos===FALSE)
	$ok_inc=TRUE;
else
	$ok_inc=FALSE;
if ($ok_inc==FALSE) header("Location: ../index.php");

if (!isset($_SESSION["lng"])) $_SESSION["lng"]="fr";
include_once("../lng/".$_SESSION["lng"].".inc.php"); // Paramètres de language
include_once("../inc/config.inc.php");
include_once("../inc/func_time.inc.php");
include_once("../inc/func_date.inc.php");
include_once("../inc/func_log.inc.php");
include_once("../inc/func_geo.inc.php");
include_once("../inc/func_txt.inc.php");
Archivelog(@$_SESSION["code_log"]);

$txtcorps = trim(@$_SESSION["txt"]);	// Récupération corps texte

$pbm_pcli = FALSE;

if ($txtcorps == "")
	$pbm_pcli = TRUE;

if ($pbm_pcli == FALSE)
{
	include_once('../classes/fpdf/fpdf.php');
	include_once('../inc/fpdf_ext.inc.php');
	
	$pdf=new PDF();
	$pdf->FPDF('P','mm','A4');
	$pdf->SetDisplayMode('real');
	$pdf->AliasNbPages();
	$pdf->settheader("prev");
	$pdf->AddPage();

	$pdf->SetLineWidth(0.4);

	$pdf->SetFont('Arial','',10);

	$pdf->WriteHTML($txtcorps);

	$pdf->Output('Texte','I');

	unset($_SESSION["txt"]);
}

?>