Location: PHPKode > projects > PhpRechnung > phpRechnung/config/edit_pdf.php
<?php
/*
	edit_pdf.php

	phpRechnung - is easy-to-use Web-based multilingual accounting software.
	Copyright (C) 2001 - 2007 Edy Corak < phprechnung at ecorak dot net >

	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; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

require_once("../include/phprechnung.inc.php");
require_once("../include/smarty.inc.php");
CheckUser();
CheckAdminGroup1();
CheckSession();

if(isset($_REQUEST['settingID']))
{
	$settingID = $_REQUEST['settingID'];
	$smarty->assign("settingID","$settingID");
}
if(isset($_REQUEST['page']))
{
	$page = $_REQUEST['page'];
	$smarty->assign("page","$page");
}
if(isset($_POST['CompanyLogoWidth']))
{
	$CompanyLogoWidth = $_POST['CompanyLogoWidth'];
}
if(isset($_POST['CompanyLogoHeight']))
{
	$CompanyLogoHeight = $_POST['CompanyLogoHeight'];
}
if(isset($_POST['PDFFont']))
{
	$PDFFont = $_POST['PDFFont'];
}
if(isset($_POST['PDFText1']))
{
	$PDFText1 = $_POST['PDFText1'];
}
if(isset($_POST['PDFText2']))
{
	$PDFText2 = $_POST['PDFText2'];
}
if(isset($_POST['PDFText3']))
{
	$PDFText3 = $_POST['PDFText3'];
}
if(isset($_POST['PDFDirectory']))
{
	$PDFDirectory = $_POST['PDFDirectory'];
}
if(isset($_POST['PDFAttachmentText']))
{
	$PDFAttachmentText = $_POST['PDFAttachmentText'];
}
if(isset($_REQUEST['Order']))
{
	$Order = $_REQUEST['Order'];
	$smarty->assign("Order","$Order");
}
if(isset($_REQUEST['Sort']))
{
	$Sort = $_REQUEST['Sort'];
	$smarty->assign("Sort","$Sort");
}
if(isset($_REQUEST['Mark']))
{
	$Mark = $_REQUEST['Mark'];
	$smarty->assign("Mark","$Mark");
}

$smarty->assign("Title","$a[settings] - $a[edit] - $a[pdf_settings]");
$smarty->assign("Basic_Settings","$a[basic_settings]");
$smarty->assign("Company_Settings","$a[company_settings]");
$smarty->assign("PDF_Settings","$a[pdf_settings]");
$smarty->assign("Company_Logo","$a[company_logo]");
$smarty->assign("Company_Logo_Width","$a[company_logo_width]");
$smarty->assign("Company_Logo_Height","$a[company_logo_height]");
$smarty->assign("PDF_Font","$a[pdf_font]");
$smarty->assign("PDF_Text1","$a[pdf_text1]");
$smarty->assign("PDF_Text2","$a[pdf_text2]");
$smarty->assign("PDF_Text3","$a[pdf_text3]");
$smarty->assign("PDF_Directory","$a[pdf_dir]");
$smarty->assign("PDF_Attachment_Text","$a[pdf_attachment_text]");


// Database connection
//
DBConnect();

// Get entrys from setting table
//
$query = $db->GetAll("SELECT COMPANY_LOGO, PDF_COMPANY_LOGO_WIDTH, PDF_COMPANY_LOGO_HEIGHT, PDF_FONT, PDF_DIR, PDF_FONT_SIZE1,
		PDF_FONT_SIZE2, PDF_TYPE_HEIGHT, PDF_ATTACHMENT_TEXT, SETTINGID FROM {$TBLName}setting WHERE SETTINGID=$settingID");

// If an error has occurred, display the error message
//
if (!$query)
	print($db->ErrorMsg());
else
	foreach($query as $f)
	{
		$smarty->assign("CompanyLogo","$f[COMPANY_LOGO]");
		if (empty($CompanyLogoWidth))
		{
			$smarty->assign("CompanyLogoWidth",$f['PDF_COMPANY_LOGO_WIDTH']);
		}
		else
		{
			$smarty->assign("CompanyLogoWidth","$CompanyLogoWidth");
		}
		if (empty($CompanyLogoHeight))
		{
			$smarty->assign("CompanyLogoHeight",$f['PDF_COMPANY_LOGO_HEIGHT']);
		}
		else
		{
			$smarty->assign("CompanyLogoHeight","$CompanyLogoHeight");
		}
		if (empty($PDFFont))
		{
			$smarty->assign("PDFFont",$f['PDF_FONT']);
		}
		else
		{
			$smarty->assign("PDFFont","$PDFFont");
		}
		if (empty($PDFText1))
		{
			$smarty->assign("PDFText1",$f['PDF_FONT_SIZE1']);
		}
		else
		{
			$smarty->assign("PDFText1","$PDFText1");
		}
		if (empty($PDFText2))
		{
			$smarty->assign("PDFText2",$f['PDF_FONT_SIZE2']);
		}
		else
		{
			$smarty->assign("PDFText2","$PDFText2");
		}
		if (empty($PDFText3))
		{
			$smarty->assign("PDFText3",$f['PDF_TYPE_HEIGHT']);
		}
		else
		{
			$smarty->assign("PDFText3","$PDFText3");
		}
		if (empty($PDFDirectory))
		{
			$smarty->assign("PDFDirectory",$f['PDF_DIR']);
		}
		else
		{
			$smarty->assign("PDFDirectory","$PDFDirectory");
		}
		if (empty($PDFAttachmentText))
		{
			$smarty->assign("PDFAttachmentText",$f['PDF_ATTACHMENT_TEXT']);
		}
		else
		{
			$smarty->assign("PDFAttachmentText","$PDFAttachmentText");
		}
	}

$smarty->display('config/edit_pdf.tpl');
?>
Return current item: PhpRechnung