<?php
/**
* @version	$Id: payment_type_currencies_tag_processor.php 12739 2009-10-20 19:38:22Z alex $
* @package	In-Commerce
* @copyright	Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license	Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/

	defined('FULL_PATH') or die('restricted access!');

	class PaymentTypeCurrenciesTagProcessor extends kDBTagProcessor {

		function CurrencySelected($params)
		{
			$object =& $this->Application->recallObject($this->Prefix);
			$payment_type_object =& $this->Application->recallObject('pt');
			$currency_object =& $this->Application->recallObject('curr.active');

			$pt_id = $payment_type_object->GetDBField('PaymentTypeId');
			$curr_id = $currency_object->GetDBField('CurrencyId');
			$sql = 'SELECT * FROM '.$object->TableName.'
					WHERE PaymentTypeId='.$pt_id.' AND
					CurrencyId='.$curr_id;
			$res = $this->Conn->GetOne($sql);
			return $res ? 1 : 0;
		}

	}