<!--// $Id$ //-->
{box title="Information about you"}
<table width="100%" CELLPADDING="3" class="light">
{if $fields_changed}
	<tr>
		<td width="100%" colspan="3">
			<span class="text-center bold" style="color: red;">{trans("WARNING! Some fields have been changed and changes must become accepted by admin")}</span>
		</td>
	</tr>
{/if}
	<tr class="dark">
		<td width="1%">
			{img src="person.gif" alt=""}
		</td>
		<td width="99%" colspan="2">
			<strong>{$userinfo.customername}
			{if isset($fields_changed.lastname) || isset($fields_changed.name)}
			({if isset($fields_changed.lastname) && $fields_changed.lastname.fieldvalue != $userinfo.lastname}<span class="lms-ui-customer-property-changed">{$fields_changed.lastname.fieldvalue}</span>{else}{$userinfo.lastname}{/if}
			{if isset($fields_changed.name) && $fields_changed.name.fieldvalue != $userinfo.name}<span class="lms-ui-customer-property-changed">{$fields_changed.name.fieldvalue}</span>{else}{$userinfo.name}{/if})
			{/if}
			({$userinfo.id|string_format:"%04d"})</strong>
		</td>
	</tr>
{if $userinfo.emails}
	<tr>
		<td width="1%">
			{img src="mail.gif" alt=""}
		</td>
		<td width="99%" colspan="2">
			{foreach $userinfo.emails as $email}
				{$emailid='email'|cat:$email.id}
				{$email.email}
				{if isset($fields_changed[$emailid])} <span class="lms-ui-customer-property-changed">({$fields_changed[$emailid].fieldvalue})</span>{/if}
				{if !$email@last}<BR />{/if}
			{/foreach}
		</td>
	</tr>
{/if}
	<tr>
		<td width="1%">
			{img src="address.gif" alt=""}
		</td>
		<td width="99%" colspan="2">
			{$userinfo.address}
			{if isset($fields_changed.street) || isset($fields_changed.building) || isset($fields_changed.apartment)}
				({if isset($fields_changed.street)}<span class="lms-ui-customer-property-changed">{$fields_changed.street.fieldvalue}</span>{else}{$userinfo.street}{/if}
				{if isset($fields_changed.building)}<span class="lms-ui-customer-property-changed">{$fields_changed.building.fieldvalue}</span>{else}{$userinfo.building}{/if}{if isset($fields_changed.apartment)}<span class="lms-ui-customer-property-changed">/{$fields_changed.apartment.fieldvalue}</span>{else}/{$userinfo.apartment}{/if})
			{/if}
			<br/>
			{$userinfo.zip} {$userinfo.city}
			{if isset($fields_changed.zip) || isset($fields_changed.city)}
			({if isset($fields_changed.zip)}<span class="lms-ui-customer-property-changed">{$fields_changed.zip.fieldvalue}</span>{else}{$userinfo.zip}{/if}
			{if isset($fields_changed.city)}<span class="lms-ui-customer-property-changed">{$fields_changed.city.fieldvalue}</span>{else}{$userinfo.city}{/if})
			{/if}
		</td>
	</tr>
{if $userinfo.contacts}
	<tr>
		<td width="1%">
			{img src="phone.gif" alt=""}
		</td>
		<td width="99%" colspan="2">
			{foreach $userinfo.contacts as $item}
				{$phoneid='phone'|cat:$item.id}
				{$item.phone}{if isset($fields_changed[$phoneid])} <span class="lms-ui-customer-property-changed">({$fields_changed[$phoneid].fieldvalue})</span>{/if}{if !$item@last}<BR />{/if}
			{/foreach}
		</td>
	</tr>
{/if}
{foreach $userinfo.ims as $item}
	<tr>
		<td width="1%">
			{if $item.type & $smarty.const.CONTACT_IM_GG}
			{img src="gg.gif" alt=""}
			{elseif $item.type & $smarty.const.CONTACT_IM_YAHOO}
			{img src="yahoo.gif" alt=""}
			{elseif $item.type & $smarty.const.CONTACT_IM_SKYPE}
			{img src="skype.gif" alt=""}
			{/if}
		</td>
		<td width="99%" colspan="2">
			{$imid='im'|cat:$item.id}
			{$item.uid}{if isset($fields_changed[$imid])} <span class="lms-ui-customer-property-changed">({$fields_changed[$imid].fieldvalue})</span>{/if}
		</td>
	</tr>
{/foreach}
{if $userinfo.ten != ""}
	<tr>
		<td width="1%" align="center">
			<strong>{trans("TEN")}</strong>
		</td>
		<td width="99%" colspan="2">
			{$userinfo.ten}{if isset($fields_changed.ten)} <span class="lms-ui-customer-property-changed">({$fields_changed.ten.fieldvalue})</span>{/if}
		</td>
	</tr>
{/if}
	{if $userinfo.ssn != "" && (isset($fields_changed.ssn) || ConfigHelper::checkConfig('userpanel.show_customer_sensitive_data'))}
		<tr>
			<td align="center">
				<strong>{trans("SSN")}</strong>
			</td>
			<td colspan="2">
				{if ConfigHelper::checkConfig('userpanel.show_customer_sensitive_data')}
					{$userinfo.ssn}
				{/if}
				{if isset($fields_changed.ssn)}
					<span class="lms-ui-customer-property-changed">({$fields_changed.ssn.fieldvalue})</span>
				{/if}
			</td>
		</tr>
	{/if}
	<tr>
		<td width="1%">
			{img src="cash.gif" alt=""}
		</td>
		<td width="1%">
			<strong>{trans("Balance:")}</strong>
		</td>
		<td width="98%">
			{if $userinfo.balance < 0}<span class="bold" style="color: red;">{$userinfo.balance|money_format}</span>{else}{$userinfo.balance|money_format}{/if}
		</td>
	</tr>
{if $userinfo.bankaccount || $userinfo.accounts}
	<tr>
		<td width="1%">
			{img src="cash.gif" alt=""}
		</td>
		<td width="1%">
			<strong>{trans("Bank accounts:")}</strong>
		</td>
		<td width="98%">
			{if $userinfo.bankaccount}
			{format_bankaccount($userinfo.bankaccount)|replace:" ":"&nbsp;"}
			{/if}
			{if $userinfo.accounts}<BR />{/if}
			{foreach $userinfo.accounts as $account}
			{format_bankaccount($account.account)|replace:" ":"&nbsp;"}{if !$account@last}<BR />{/if}
			{/foreach}
		</td>
	</tr>
{/if}
	{if $rights.info.edit_addr ||
	    $rights.info.edit_addr_ack ||
	    $rights.info.edit_contact ||
	    $rights.info.edit_contact_ack
	}
	<tr>
		<td width="100%" colspan="3" align="right">
			{if ConfigHelper::checkConfig('userpanel.pin_changes') || isset($passwd_change_required)}
				<a href="?m=info&f=updatepinform" accesskey="P">{trans("Update PIN")} {img src="pin.gif" alt="PIN"}</a>
			{/if}
			<a href="?m=info&amp;f=updateuserform" accesskey="A">{trans("Actualize data")} {img src="edit.gif" alt="Edit"}</a>
		</td>
	</tr>
	{/if}
</table>
{/box}
