@Ward, sorry ik was dit in een los script aan het testen, buiten het grote script om, en was dus vergeten om error melding daarin te plaatsen. Dat automatischme is er nog niet.
@Ben Rob bedoeldt het goed maar je hebt wel gelijk men moet niet teveel dingen er bij halen.
De routine ziet er nu zo uit, kan misschien wel anders opgebouwdt worden.
<?php
//First check for a report-name
$report = ( isset ( $_GET["report"] ) ) ? trim ( $_GET["report"] ) : 'EMPTY';
$report = ( $report == '' ) ? 'default' : $report;
// Then create the template name for further use
$template = "/template.TCPDF.".$report.".php";
echo $template."<br />";
//Check if template file exitst
if(!(file_exists(dirname(__FILE__)."/".$template))) {
echo "The template file does not exist<br />";
}
echo "Template file : ".dirname(__FILE__)."/".$template."<br />";
echo realpath(dirname(__FILE__))."<br />";
echo dirname(__FILE__)."<br />";
?>
[size=xsmall]
Toevoeging op 16/07/2017 11:21:51:[/size]
Nu heb ik bovenstaand script als een include in mijn hoofd script geplaatst en krijg dan de melding dat de variable op regel niet aanwezig is.
<?php
include ("gearboxTCPDF.php");
// Extend the TCPDF class to create custom Header and Footer
class MYPDF extends TCPDF {
//Page header
function Header() {
// Logo
// Set color
$this->SetTextColor(0, 0, 0);
// Set font
$this->SetFont('helvetica', 'B', 34);
// Title
$this->Cell(0, 0, $report, 0, false, 'C', 0, 'L', 0, false, 'M', 'M');
$image_file = 'images/Header_Brief.png';
$this->Image($image_file, 0, 6, 210, '', 'PNG', '', 'T', false, 300, '', false, false, 0, false, false, false);
}
?>
[size=xsmall]
Toevoeging op 16/07/2017 11:24:55:[/size]
Harry H Arends op 16/07/2017 10:30:48
@Ward, sorry ik was dit in een los script aan het testen, buiten het grote script om, en was dus vergeten om error melding daarin te plaatsen. Dat automatischme is er nog niet.
@Ben Rob bedoeldt het goed maar je hebt wel gelijk men moet niet teveel dingen er bij halen.
De routine ziet er nu zo uit, kan misschien wel anders opgebouwdt worden.
<?php
//First check for a report-name
$report = ( isset ( $_GET["report"] ) ) ? trim ( $_GET["report"] ) : 'EMPTY';
$report = ( $report == '' ) ? 'default' : $report;
// Then create the template name for further use
$template = "/template.TCPDF.".$report.".php";
echo $template."<br />";
//Check if template file exitst
if(!(file_exists(dirname(__FILE__)."/".$template))) {
echo "The template file does not exist<br />";
}
echo "Template file : ".dirname(__FILE__)."/".$template."<br />";
echo realpath(dirname(__FILE__))."<br />";
echo dirname(__FILE__)."<br />";
?>
[size=xsmall]Toevoeging op 16/07/2017 11:21:51:[/size]
Nu heb ik bovenstaand script als een include in mijn hoofd script geplaatst en krijg dan de melding dat de variable op regel 14 niet aanwezig is. Hier stond eerst gewoon $_GET['report'] en dat werkte wel.
<?php
include ("gearboxTCPDF.php");
// Extend the TCPDF class to create custom Header and Footer
class MYPDF extends TCPDF {
//Page header
function Header() {
// Logo
// Set color
$this->SetTextColor(0, 0, 0);
// Set font
$this->SetFont('helvetica', 'B', 34);
// Title
$this->Cell(0, 0, $report, 0, false, 'C', 0, 'L', 0, false, 'M', 'M');
$image_file = 'images/Header_Brief.png';
$this->Image($image_file, 0, 6, 210, '', 'PNG', '', 'T', false, 300, '', false, false, 0, false, false, false);
}
?>
Moet ik iets speciaal doen om variabelen uit een include door te sturen??