<?php

defined( '_JEXEC' ) or die( 'resticted aceess' );

AddonParser::addAddon( 'sp_contact', 'sp_contact_addon' );

function sp_contact_addon( $atts ) {
	$class = $title1 = $content = $phone = $email = $address = $title2 = $time_mon = $time_tue = $time_wed = $time_thu = $time_fri = $time_sat = $time_sun = '';
	extract( spAddonAtts( array(
		"title1"              => '',
		"content"        => '',
		"phone"         => '',
		"email"		     => '',
		"address"              => '',
		"title2"              => '',
		"time_mon"              => '',
		"time_tue"              => '',
		"time_wed"              => '',
		"time_thu"              => '',
		"time_fri"              => '',
		"time_sat"              => '',
		"time_sun"              => '',
		"class"              => '',
	), $atts ) );
	ob_start();
	?>
	<div class="info_contact <?php echo $class;?>">
		<div class="box contact">
			<h2 class="box_title"><?php echo $title1;?></h2>
			<span class="line"></span>
			<div class="content"><?php echo $content;?></div>
			<ul class="box_1">
				<li>
					<i class="fa fa-phone"></i> <a href=""><span class="contact_info"><?php echo $phone;?></span></a>
				</li>
				<li>
					<i class="fa fa-envelope"></i> <a href="mailto:<?php echo $email;?>"><span class="contact_info"><?php echo $email;?></span></a>
				</li>
				<li>
					<i class="fa fa-map-marker"></i><span class="contact_info"><?php echo $address;?></span>
				</li>
			</ul>
		</div>
		<div class="box opening">
			<h2 class="box_title"><?php echo $title2;?></h2>
			<span class="line"></span>
			<ul class="box_2">
				<li class="focus ">
					<span><?php echo JText::_('MONDAY');?></span>
					<span></span>
					<span> <?php echo $time_mon;?></span>
				</li>
				<li class="">
					<span><?php echo JText::_('TUESDAY');?></span>
					<span></span>
					<span class="fright"> <?php echo $time_tue;?></span>
				</li>
				<li>
					<span><?php echo JText::_('WEDNESDAY');?></span>
					<span></span>
					<span class="fright"> <?php echo $time_wed;?></span>
				</li>
				<li>
					<span><?php echo JText::_('THURSDAY');?></span>
					<span></span>
					<span class="fright"> <?php echo $time_thu;?></span>
				</li>
				<li>
					<span><?php echo JText::_('FRIDAY');?></span>
					<span></span>
					<span class="fright"> <?php echo $time_fri;?></span>
				</li>
				<li>
					<span><?php echo JText::_('SATURDAY');?></span>
					<span></span>
					<span class="fright"> <?php echo $time_sat;?></span>
				</li>
				<li>
					<span><?php echo JText::_('SUNDAY');?></span>
					<span></span>
					<span class="fright"> <?php echo $time_sun;?></span>
				</li>
			</ul>
		</div>
	</div>
	<?php
	$html = ob_get_clean();
	return $html;
}