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

	phpRechnung - is easy-to-use Web-based multilingual accounting software.
	Copyright (C) 2001 - 2008 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($_POST['settingID']))
{
	$settingID = $_POST['settingID'];
}
if(isset($_POST['page']))
{
	$page = $_POST['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 = strip_tags($_POST['PDFAttachmentText']);
}
if(isset($_POST['Order']))
{
	$Order = $_POST['Order'];
}
if(isset($_POST['Sort']))
{
	$Sort = $_POST['Sort'];
}

// Database connection
//
DBConnect();

function UserInput($mark)
{
	global $smarty, $settingID, $page, $CompanyLogoWidth, $CompanyLogoHeight, $PDFFont, $PDFText1,
	$PDFText2, $PDFTypeHeight, $PDFDirectory, $PDFAttachmentText, $Order, $Sort;
	$smarty->assign("settingID","$settingID");
	$smarty->assign("page","$page");
	$smarty->assign("CompanyLogoWidth","$CompanyLogoWidth");
	$smarty->assign("CompanyLogoHeight","$CompanyLogoHeight");
	$smarty->assign("PDFFont","$PDFFont");
	$smarty->assign("PDFText1","$PDFText1");
	$smarty->assign("PDFText2","$PDFText2");
	$smarty->assign("PDFText3","$PDFText3");
	$smarty->assign("PDFDirectory","$PDFDirectory");
	$smarty->assign("PDFAttachmentText","$PDFAttachmentText");
	$smarty->assign("Order","$Order");
	$smarty->assign("Sort","$Sort");
	$smarty->assign("Mark","$mark");
}

if (empty($CompanyLogoWidth))
{
	$smarty->assign("FieldError","$a[company_logo_width] - $a[field_error]");
	UserInput("CompanyLogoWidth");
}
else if (empty($CompanyLogoHeight))
{
	$smarty->assign("FieldError","$a[company_logo_height] - $a[field_error]");
	UserInput("CompanyLogoHeight");
}
else if (empty($PDFFont))
{
	$smarty->assign("FieldError","$a[pdf_font] - $a[field_error]");
	UserInput("PDFFont");
}
else if (empty($PDFText1))
{
	$smarty->assign("FieldError","$a[pdf_text1] - $a[field_error]");
	UserInput("PDFText1");
}
else if (empty($PDFText2))
{
	$smarty->assign("FieldError","$a[pdf_text2] - $a[field_error]");
	UserInput("PDFText2");
}
else if (empty($PDFText3))
{
	$smarty->assign("FieldError","$a[pdf_text3] - $a[field_error]");
	UserInput("PDFText3");
}
else if (empty($PDFDirectory))
{
	$smarty->assign("FieldError","$a[pdf_dir] - $a[field_error]");
	UserInput("PDFDirectory");
}
else if (empty($PDFAttachmentText))
{
	$smarty->assign("FieldError","$a[pdf_attachment_text] - $a[field_error]");
	UserInput("PDFAttachmentText");
}
else
{
	$query = $db->Execute("UPDATE {$TBLName}setting SET PDF_COMPANY_LOGO_WIDTH='$CompanyLogoWidth', PDF_COMPANY_LOGO_HEIGHT='$CompanyLogoHeight', PDF_FONT='$PDFFont', PDF_FONT_SIZE1='$PDFText1', PDF_FONT_SIZE2='$PDFText2', PDF_TYPE_HEIGHT='$PDFText3', PDF_DIR='$PDFDirectory', PDF_ATTACHMENT_TEXT='$PDFAttachmentText', MODIFIEDBY='$_SESSION[Username]' WHERE SETTINGID=$settingID");
	
	Header("Location: $web/config/list.php?page=$page&Order=$Order&Sort=$Sort&$sessname=$sessid#$settingID");
}

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