<?php
/**
 * @version		3.0.0
 * @package		JomLand TicketCenter
 * @copyright	Copyright (C) 2010 JomLand.com. All rights reserved.
 * @license		GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */

// No direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.application.component.view' );
jimport('joomla.html.pane');


class JLTicketCenterViewPaymentLog extends JViewLegacy
{
	function display($tpl = null)
	{
		$mainframe = JFactory::getApplication();

		$task =  JRequest::getVar('task');

		if ($task=='add' ||$task=='edit' ){
			$this->edit($tpl);
			return;
		}

		JToolBarHelper::title(JText::_( 'Payments Log - JomLand TicketCenter' ), 'generic.png' );

		$pparams = new JLTicketCenterHelperSetup;

		$context			= 'com_jlticketcenter.paymentmethods.list.';

		$filter_order		= $mainframe->getUserStateFromRequest($context.'filter_order',		'filter_order',		'cc.title',	'cmd' );
		$filter_order_Dir	= $mainframe->getUserStateFromRequest($context.'filter_order_Dir',	'filter_order_Dir',	'',			'word' );
		$filter_country		= $mainframe->getUserStateFromRequest($context.'filter_country',	'filter_country',	'',			'string');
		$filter_state		= $mainframe->getUserStateFromRequest($context.'filter_state',		'filter_state',		'',			'word');
		$search				= $mainframe->getUserStateFromRequest($context.'search',			'search',			'',			'string');
		if (strpos($search, '"') !== false) {
			$search = str_replace(array('=', '<'), '', $search);
		}
		$search = JString::strtolower($search);

		$filter['state']	= $filter_state;
		$filter['search']	= $search;


		JRequest::setVar( 'filter', $filter);

		// Get data from the model
		$items		= $this->get('Data');
		$pagination = $this->get('Pagination');

		$lists['state']	= JHTML::_('grid.state',  $filter_state );
		$lists['search']	= $search;


		/* Call the state object */
		$state = $this->get('state');
		$lists['order_Dir'] = $state->get('filter_order_Dir');
		$lists['order'] 	= $state->get('filter_order' );


		// push data into the template
		$this->assignRef('items',$items);
		$this->assignRef('pagination', $pagination);
		$this->assignRef('lists', $lists);
		$this->assignRef('params', $pparams);


		parent::display($tpl);

		JLTicketCenterController::renderinfo();
	}

}//EOC