<?php
/**
* @version		3.0.0
* @package		JomLand TicketCenter
* @copyright	Copyright (C) 2010 JomLand.com. All rights reserved.
* @link 		www.jomland.com
* @license		GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/ 
// no direct access
defined('_JEXEC') or die('Restricted access');
?>
<?php if ($this->menuparams->get('show_page_title', 1)): ?>
<div class="componentheading<?php echo $this->escape($this->menuparams->get('pageclass_sfx')); ?>">
<h2><?php echo $this->escape($this->menuparams->get('page_title')); ?></h2>
</div>
<?php endif; ?>

<div class="contentpane<?php echo $this->escape($this->menuparams->get('pageclass_sfx')); ?>">
<div id="venue_state">
<h3><?php echo $this->state->state_name;?></h3>
<?php
 	
	if ($this->params->get('display_country')>0){
		if ($this->params->get('display_country')==2){
			$country_link = JROUTE::_('index.php?option=com_jlticketcenter&view=venues&country='.$this->state->country_id.'&Itemid='.$this->itemid);
			$country = JHTML::link($country_link, $this->state->country);
		}else{
			$country = $this->state->country;
		}
	} 
	echo $country;
?>
<br /><br />
<?php
if ($this->venues){ 
$prev_city=false;?>

<?php 	foreach ($this->venues as $venue){
		
		$venue_link = JROUTE::_('index.php?option=com_jlticketcenter&view=event&venue='.$venue->id.'&Itemid='.$this->itemid);
		$venue_name = JHTML::link($venue_link, $venue->venue_name);
		
		if ($prev_city!=$venue->city_id){
			if ($this->params->get('display_city')){
				$city_link = JROUTE::_('index.php?option=com_jlticketcenter&view=event&city='.$venue->city_id.'&Itemid='.$this->itemid);
				$city = JHTML::link($city_link, $venue->city_name);
			}else{
				$city = $venue->city_name;
			}
			
			if ($prev_city){ ?>
			</ul>
			<?php }
		?>
		<h4><?php echo $city;?></h4>
		<ul>
			
		<?php } ?>
		<li><?php echo $venue_name;?></li>
		
		<?php 
		$prev_city=$venue->city_id;
		};// end foreach
		?>
	</ul>
<?php 
}else{
	echo JText::_('Venues haven\'t found') .'<br>';
}?>
</div>
</div>
