94 lines
3.5 KiB
PHP
Executable File
94 lines
3.5 KiB
PHP
Executable File
<?php
|
|
$nomFicAppelant = basename(__FILE__);
|
|
// -----------------------------------------------------
|
|
// Init
|
|
// -----------------------------------------------------
|
|
|
|
if ($lg=='') $lg='FRA';
|
|
if (empty($today)) $today= date('d/m/Y ');
|
|
|
|
// -----------------------------------------------------
|
|
// Récup données génériques
|
|
// -----------------------------------------------------
|
|
require "fpdf184/fpdf.php";
|
|
require "./extensions/makeFact/123factPdf_contenu.php";
|
|
|
|
$includePathConf="../_conf";
|
|
// pourquoi ce databaseConnect ?
|
|
include ("../_include/dataBaseConnect.php");
|
|
|
|
// libellé pays liv
|
|
include ("../_include/req/30-initPaysList.php");
|
|
|
|
// les messages contact
|
|
include ("../_include/req/13-init.contactMsgList.php");
|
|
|
|
$refresh='Oui';
|
|
include ("../_include/req/07-init.cdeMsgList.php");
|
|
|
|
$refresh='Oui';
|
|
include ("../_include/req/04-init.catMsgList.php");
|
|
$refresh='N';
|
|
|
|
// -----------------------------------------------------
|
|
// Trouver la tva
|
|
// -----------------------------------------------------
|
|
if (empty($idAbo) && isset($_SESSION['idAbo'])) $idAbo=$_SESSION['idAbo'];
|
|
if (isset($_SESSION['idPresta'])) $idPresta=$_SESSION['idPresta'];
|
|
if (isset($_SESSION['idModule'])) {$idModule=$_SESSION['idModule'];}
|
|
|
|
// avant c'était profil (idmodule=2), maintenant c'est devenu domaine--> fait dans admin : a verifier
|
|
// if (empty($cliOpt)) {
|
|
// if (isset($_SESSION['cliOpt'])) $cliOpt=$_SESSION['cliOpt'];
|
|
// if (isset($_GET['cliOpt'])) {$cliOpt=$_GET['cliOpt']; $_SESSION['cliOpt']=$cliOpt;}
|
|
// }
|
|
|
|
// if (empty($idSms) && isset($_SESSION['idAbo']) && isset($_SESSION['idSms']) ) $idSms=$_SESSION['idSms'];
|
|
|
|
// if (isset($debug[2]) && $debug[2] == '1' ) monDebug (2,['cliOpt' => $cliOpt ],'');
|
|
|
|
if ($idModule==1) $idOption=$idAbo;
|
|
// if ($idModule==2) $idOption=$cliOpt;
|
|
if ($idModule==3) $idOption=$idSms;
|
|
if ($idModule>3 and $idModule<21) $idOption=$idPresta;
|
|
if ($idModule==21) $idOption=$idFormule;
|
|
|
|
|
|
$reqSelect="Select tva FROM `123modules` WHERE idModule=" .$idModule. " and idOption=" .$idOption. ";";
|
|
if (isset($debug[2]) && $debug[2] == '1' ) $debugMsg .= monDebug (2,['reqSelect' => $reqSelect ],'');
|
|
$resConn='';
|
|
try{
|
|
$resConn=$connexion->query($reqSelect);
|
|
if ($resConn) {
|
|
$tabResult=$resConn->fetch(PDO::FETCH_ASSOC);
|
|
$tva=$tabResult['tva'];
|
|
}
|
|
else {$tva=0;}
|
|
}
|
|
catch (PDOException $e) {
|
|
if (isset($debug[2]) && $debug[2] == '1' ) $debugMsg .= monDebug (2,['erreur pdo' => $e->getMessage() ],'');
|
|
}
|
|
|
|
// -----------------------------------------------------
|
|
// Instanciation de la classe
|
|
// -----------------------------------------------------
|
|
$pdf = new monpdf();
|
|
$pdf->AliasNbPages();
|
|
$pdf->AddPage();
|
|
// ($nomGestionnaire, $raisonSoc, $siret, $add, $villeAdm, $cp, $pays, $tel, $idCde, $dateCdeCrea) {
|
|
$pdf->hautDePage(
|
|
mb_convert_encoding(strip_tags($contactMsg[9]), 'ISO-8859-1', 'UTF-8'),
|
|
mb_convert_encoding($contactMsg[2]. '' .$contactMsg[11], 'ISO-8859-1', 'UTF-8'),
|
|
mb_convert_encoding($contactMsg[3]. ' '.($contactMsg[12]), 'ISO-8859-1', 'UTF-8'),
|
|
mb_convert_encoding($contactMsg[13], 'ISO-8859-1', 'UTF-8'),
|
|
urlencode(mb_convert_encoding($contactMsg[14], 'ISO-8859-1', 'UTF-8')),
|
|
mb_convert_encoding($contactMsg[15], 'ISO-8859-1', 'UTF-8'),
|
|
mb_convert_encoding($contactMsg[7]. '' .$contactMsg[16], 'ISO-8859-1', 'UTF-8'),
|
|
$numFacture,
|
|
mb_convert_encoding ($dateCdeCrea, 'ISO-8859-1', 'UTF-8') );
|
|
|
|
$pdf->tableArticles($designation, $tva, '1', $prix);
|
|
|
|
if (isset($debug[2]) && $debug[2] == '1' ) $debugMsg .= monDebug (2,['fpdfPath' => $fpdfPath ],'');
|
|
$pdf->Output($fpdfPath,'F');
|
|
?>
|