<?php
if ($tpl['arr']['owner_show'] == 'T' && isset($tpl['contact_arr']))
{
	ob_start();
	$person_titles = __('personal_titles', true);
	if(!empty($tpl['contact_arr']['contact_title']) || !empty($tpl['contact_arr']['name']))
	{
		?><div class="col-md-4 col-sm-4 col-xs-6"><label><?php echo __('front_label_name'); ?></label>: <span><?php echo (!empty($tpl['contact_arr']['contact_title']) ? $person_titles[$tpl['contact_arr']['contact_title']] . ' ' : null ) . $tpl['contact_arr']['name']; ?></span></div><?php
	}
	if (!empty($tpl['contact_arr']['contact_phone']))
	{
		?><div class="col-md-4 col-sm-4 col-xs-6"><label><?php echo __('front_label_phone'); ?></label>: <span><?php echo $tpl['contact_arr']['contact_phone']; ?></span></div><?php
	}
	if (!empty($tpl['contact_arr']['contact_mobile']))
	{
		?><div class="col-md-4 col-sm-4 col-xs-6"><label><?php echo __('front_label_mobile'); ?></label>: <span><?php echo $tpl['contact_arr']['contact_mobile']; ?></span></div><?php
	}
	if (!empty($tpl['contact_arr']['email']))
	{
		$email = $tpl['contact_arr']['email'];
		$plain_email = strip_tags($email);
		$ascii_email = pjUtil::toAscii($plain_email);
		$text_email = str_replace($plain_email, $ascii_email, $email);
		$contact_email = !pjValidation::pjActionEmail($plain_email) ? $email : '<a href="mailto:'.$ascii_email.'">'.$text_email.'</a>';
		?><div class="col-md-4 col-sm-4 col-xs-6"><label><?php echo __('front_label_email'); ?></label>: <span><?php echo $contact_email; ?></span></div><?php
	}
	if (!empty($tpl['contact_arr']['contact_fax']))
	{
		?><div class="col-md-4 col-sm-4 col-xs-6"><label><?php echo __('front_label_fax'); ?></label>: <span><?php echo $tpl['contact_arr']['contact_fax']; ?></span></div><?php
	}
	if (!empty($tpl['contact_arr']['contact_url']))
	{
		?><div class="col-md-4 col-sm-4 col-xs-6"><label><?php echo __('front_label_website'); ?></label>: <span><?php echo preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', '<a href="$1" target="_blank">$1</a>', $tpl['contact_arr']['contact_url']); ?></span></div><?php
	}
	$ob_contact = ob_get_contents();
	ob_end_clean();
		
	if (!empty($ob_contact))
	{
		?>
		<div class="panel panel-default pjVpProductSection">
			<div class="panel-heading pjVpProductSectionHead">
				<h3 class="panel-title pjVpProductSectionTitle"><?php __('front_label_owner'); ?></h3><!-- /.panel-title pjVpProductSectionTitle -->
			</div><!-- /.panel-heading pjVpProductSectionHead -->
						
			<div class="panel-body pjVpProductSectionBody">
				<div class="row">
					<?php echo $ob_contact; ?>
				</div>
			</div><!-- /.panel-body pjVpProductSectionBody -->
		</div><!-- /.panel panel-default pjVpProductSection -->
		<?php
	}
}
?>