Location: PHPKode > projects > PhpRechnung > phpRechnung/cashbook/cancel.php
<?php
/*
	cancel.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/company_settings.inc.php");
require_once("../include/smarty.inc.php");
CheckUser();
CheckAdminGroup1();
CheckSession();

if(isset($_REQUEST['cashbookID']))
{
	$cashbookID = $_REQUEST['cashbookID'];
	$smarty->assign("cashbookID","$cashbookID");
}
if(isset($_REQUEST['invoiceID']))
{
	$invoiceID = $_REQUEST['invoiceID'];
	$smarty->assign("invoiceID","$invoiceID");
}
if(isset($_REQUEST['paymentID']))
{
	$paymentID = $_REQUEST['paymentID'];
	$smarty->assign("paymentID","$paymentID");
}
if(isset($_REQUEST['page']))
{
	$page = $_REQUEST['page'];
	$smarty->assign("page","$page");
}
if(isset($_REQUEST['infoID']))
{
	$infoID = $_REQUEST['infoID'];
	$smarty->assign("infoID","$infoID");
}
if(isset($_REQUEST['CashbookNo_1']))
{
	$CashbookNo_1 = $_REQUEST['CashbookNo_1'];
	$smarty->assign("CashbookNo_1","$CashbookNo_1");
}
if(isset($_REQUEST['DateFrom_1']))
{
	$DateFrom_1 = $_REQUEST['DateFrom_1'];
	$smarty->assign("DateFrom_1","$DateFrom_1");
}
if(isset($_REQUEST['DateTill_1']))
{
	$DateTill_1 = $_REQUEST['DateTill_1'];
	$smarty->assign("DateTill_1","$DateTill_1");
}
if(isset($_REQUEST['Takings_1']))
{
	$Takings_1 = $_REQUEST['Takings_1'];
	$smarty->assign("Takings_1","$Takings_1");
}
if(isset($_REQUEST['Expenditures_1']))
{
	$Expenditures_1 = $_REQUEST['Expenditures_1'];
	$smarty->assign("Expenditures_1","$Expenditures_1");
}
if(isset($_REQUEST['Description_1']))
{
	$Description_1 = $_REQUEST['Description_1'];
	$smarty->assign("Description_1","$Description_1");
}
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['Canceled']))
{
	$Canceled = $_REQUEST['Canceled'];
	$smarty->assign("Canceled","$Canceled");
}

$smarty->assign("Title","$a[cashbook] - $a[info]");
$smarty->assign("CashbookNo","$a[cashbook_number]");
$smarty->assign("CashInHand","$a[cash_in_hand]");
$smarty->assign("Takings","$a[takings]");
$smarty->assign("Expenditures","$a[expenditures]");
$smarty->assign("Description","$a[cashbook_description]");

// Database connection
//
DBConnect();

// Get data from company_settings.inc.php
//
$smarty->assign("Cashbook_Currency",$CompanyCurrency);

// Get entrys from cashbook table
//
$query = $db->GetAll("SELECT CASHBOOKID, INVOICEID, PAYMENTID, DATE_FORMAT(CASHBOOK_DATE,'%d.%m.%Y') AS CASHBOOK_DATE, TAKINGS, EXPENDITURES, DESCRIPTION, CASH_IN_HAND, CASH_IN_HAND_STARTING_WITH FROM {$TBLName}cashbook WHERE CASHBOOKID=$cashbookID");

// If an error has occurred, display the error message
//
if (!$query)
	print($db->ErrorMsg());
else
	foreach($query as $f)
	{
		$smarty->assign("CASHBOOKID",$f['CASHBOOKID']);
		$smarty->assign("INVOICEID",$f['INVOICEID']);
		$smarty->assign("PAYMENTID",$f['PAYMENTID']);
		$smarty->assign("CASHBOOK_DATE",$f['CASHBOOK_DATE']);
		$smarty->assign("TAKINGS",$f['TAKINGS']);
		$smarty->assign("EXPENDITURES",$f['EXPENDITURES']);
		$smarty->assign("DESCRIPTION",$f['DESCRIPTION']);
		$smarty->assign("CASH_IN_HAND",$f['CASH_IN_HAND']);
		$smarty->assign("CASH_IN_HAND_STARTING_WITH",$f['CASH_IN_HAND_STARTING_WITH']);
	}

$smarty->display('cashbook/cancel.tpl');

?>
Return current item: PhpRechnung