<?php defined('BASEPATH') OR exit('No direct script access allowed'); 

$addressTmpl = array();
if (!empty($address1))
{
	$addressTmpl[] = $address1;
}

if (!empty($address2))
{
	$addressTmpl[0] .= ", " . $address2;
}

// if (!empty($addressTmpl))
// {
	$_city = '';
	if(!empty($city))
	{
		$_city .= $city;
		if(!empty($zip))
		{
			$_city .= ' - '. $zip;
		}
	} else if(!empty($zip))
	{
		$_city .= ''. $zip;
	}

	$state = $_city ? $_city . ', ' : '';
	if (!empty($stateName))
	{
		$state .= $stateName;
	}
	else if (!empty($pos))
	{
		$state .= $pos;
	}
	$addressTmpl[] = $state . '.';

	$addressTmpl = implode(",<br>", $addressTmpl);
	if(!empty($mobile))
	{ 
		$addressTmpl .= '<br>'.mylang("Phone") .': ' . $mobile;
		$addressTmpl .= empty($phone) ? "" : (", " . $phone);
	}
	else if(!empty($phone))
	{
		$addressTmpl .= '<br>'.mylang("Phone") .': ' . $phone;
	}

/*
} else {
	$addressTmpl = "";
}
*/
?><span id="lh" class="address pretxt"><?php
	echo empty($compNamePrefix) ? "" : $compNamePrefix;
	// echo '<b>' . strtoupper($name) . '</b>';
	echo is_english($name) ? '<b>'.$name . '</b>' : strtoupper($name);
?><br><?php
	echo $addressTmpl;
	echo (!empty($gstin)) ? '<br>'.mylang("GSTIN").' : ' . $gstin : '';
	echo (!empty($pan)) ? '<br>PAN : ' . $pan : '';
	echo (!empty($addInfo)) ? '<br>' . $addInfo : '';
	echo (!empty($isRegisteredMSME)) ? '<br>'.mylang("MSME") .' '. $msmet  .' : ' . $msmen : '';
?></span>
