<?php
// -----------------------------------------------------------------------
// This file is part of AROUNDMe
//
// Copyright (C) 2003 - 2007 Barnraiser
// http://www.barnraiser.org/
// info@barnraiser.org
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with program; see the file COPYING. If not, write to the Free
// Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
// 02110-1301, USA.
// -----------------------------------------------------------------------


// we receive $id_card as the identity card array 
?>

<?php
if (isset($id_card_layout) && $id_card_layout == "portrait") {
?>

	
	<p>
		<?php
		if (!empty($id_card['identity_allow_msg']) || !empty($id_card['identity_allow_export'])) {
		?>
			<?php
			if (!empty($id_card['blocking'])) {
			?>
			<a href="index.php?amn=core_profile&amp;identity_id=<?php echo $id_card['identity_id'];?>" title="WARNING You are blocking this person"><img src="<?php echo $template_path_core;?>img/warning.png" id="warning" alt="" border="0" /></a>
				
			
			<?php }?>
			
			<?php
			if (!empty($id_card['identity_allow_msg'])) {
			?>
			<a href="index.php?amn=core_msg_edit&amp;to_identity_id=<?php echo $id_card['identity_id'];?>" title="send message"><img src="<?php echo $template_path_core;?>img/unopenned_mail.png" alt="" border="0" /></a>
			 
			<?php }?>
			
			<?php
			if (!empty($id_card['identity_allow_export'])) {
			?>
			<a href="#" title="export as vcard"><img src="<?php echo $template_path_core;?>img/export.png" alt="" border="0" /></a>
			 
			<?php }?>
		<?php }?>
		
		<a href="index.php?amn=core_profile&identity_id=<?php echo $id_card['identity_id'];?>"><b><?php echo $id_card['identity_nic'];?></b></a><br />	
	</p>
	
	<?php
	if(isset($id_card['image'])) {
	?>
	<p align="center">
		<a href="index.php?amn=core_profile&identity_id=<?php echo $id_card['identity_id'];?>"><img src="get_file.php?file=<?php echo $id_card['image']['file_md5_name_view']; ?>" border="0" class="picture" alt="" /></a><br />
	</p>
	<?php }?>
			
	
	<p>
		<?php echo $id_card['location_name'];?><br />
		<?php echo $this->date->formatDate($id_card['user_create_datetime'],1);?><br />
		<?php echo $lang['user_online_status'][$id_card['online_status']];?><br />
		<?php
		if (isset($id_card['invitee'])) {
		?>
		<?php echo $lang['txt_invitee'];?>: 
		<a href="index.php?amn=core_profile&identity_id=<?php echo $id_card['invitee']['identity_id'];?>"><?php echo $id_card['invitee']['identity_nic'];?></a><br />
		<?php }?>
		
		<?php
		if (!empty($id_card['tags'])) {
		?>
			<p>
				<?php echo $lang['txt_tagged'];?>: 
				<?php
				$prnt = "";
				foreach($id_card['tags'] as $key => $i):
					$prnt .= $i['tag_body'] . ", ";
				endforeach;
				$prnt = substr($prnt, 0, -2);
				echo $prnt;
				?>
				<br />
			</p>
		<?php }?>
		
		<?php
		if (isset($id_card['display_type']) && $id_card['display_type'] == "full") {
		if (!empty($id_card['identity_signature'])) {
		?>
		<p>
			<i>"<?php echo $id_card['identity_signature'];?>"</i><br />
		</p>
		<?php }}?>
		
		
		<?php
		if (isset($common_ties) || isset($id_card['testimonial_count'])) {
		?>
		<p align="right">
			<?php
			if (isset($common_ties)) {
			?>
			<a href="index.php?amn=core_tie_matrix&amp;identity_id=<?php echo $id_card['identity_id']; ?>&amp;identity_id_relation=<?php echo $id_card['identity']['identity_id'];?>"><span class="icon_frame">
			<span class="icon_title">ties:</span>
			<span class="icon_value"><?php if (isset($common_ties)) echo $common_ties['count_strong'];?></span>
			<span class="icon_value"><?php if (isset($common_ties)) echo $common_ties['count_weak'];?></span>
			</span>
			</a>
			&nbsp; 
			<?php }?>
			
			<?php
			if (isset($id_card['testimonial_count'])) {
			?>
			<span class="icon_frame">
				<span class="icon_title">&nbsp;vouched&nbsp;</span>
				<span class="icon_value">&nbsp;<a href="index.php?amn=core_profile&amp;identity_id=<?php echo $id_card['identity_id'];?>"><?php echo $id_card['testimonial_count'];?></a>&nbsp;</span>
			</span>
			<?php }?>
		</p>
		<?php }?>
	</p>
	
	<?php
	if (!empty($id_card['custom_fields'])) {
	?>
	<p>
		<?php
		$prnt = "";
		foreach ($id_card['custom_fields'] as $idckey => $idc):
		if (!empty($idc['custom_item_body'])) {
			$prnt .= $lang['identity']['custom'][$idc['custom_item_id']] . ":";
			$prnt .= $idc['custom_item_body'];
			$prnt .= ",&nbsp; ";
		}
		endforeach;
		$prnt = substr($prnt, 0, -8);
		echo $prnt;
		?>
		<br />
	</p>
	<?php }?>

<?php
}
else {
?>
	
    
	<p>	
		<?php
		if (!empty($id_card['blocking'])) {
		?>
		<a href="index.php?amn=core_profile&amp;identity_id=<?php echo $id_card['identity_id'];?>" title="WARNING You are blocking this person"><img src="<?php echo $template_path;?>img/warning.png" alt="" border="0" /></a>
		<?php }?>
		
		<?php
		if (!empty($id_card['identity_allow_msg'])) {
		?>
		<a href="index.php?amn=core_msg_edit&amp;to_identity_id=<?php echo $id_card['identity_id'];?>" title="send message"><img src="<?php echo $template_path;?>img/unopenned_mail.png" alt="" border="0" /></a>
		<?php }?>
		
		<?php
		if (!empty($id_card['identity_allow_export'])) {
		?>
		<a href="#" title="export as vcard"><img src="<?php echo $template_path_core;?>img/export.png" alt="" border="0" /></a>
		<?php }?>
		
		<a href="index.php?amn=core_profile&identity_id=<?php echo $id_card['identity_id'];?>"><b><?php echo $id_card['identity_nic'];?></b></a><br />	
	</p>
	
	
	<table cellspacing="2" cellpadding="2" border="0" width="100%">
		<tr>
			<?php
			if(isset($id_card['image'])) {
			?>
			<td rowspan="2" valign="top" width="1">
				<a href="index.php?amn=core_profile&identity_id=<?php echo $id_card['identity_id'];?>"><img src="get_file.php?file=<?php echo $id_card['image']['file_md5_name_view']; ?>" border="0" class="picture" alt="" /></a><br />
			</td>
			<td width="10">
				<br />
			</td>
			<?php }?>
			<td valign="top">
				<?php echo $id_card['location_name'];?><br />
				<?php echo $this->date->formatDate($id_card['user_create_datetime'],1);?><br />
				<?php echo $lang['user_online_status'][$id_card['online_status']];?><br />
				<?php
				if (isset($id_card['invitee'])) {
				?>
				<?php echo $lang['txt_invitee'];?>: 
				<a href="index.php?amn=core_profile&identity_id=<?php echo $id_card['invitee']['identity_id'];?>"><?php echo $id_card['invitee']['identity_nic'];?></a><br />
				<?php }?>
				
				<?php
				if (!empty($id_card['tags'])) {
				?>
					<p>
						<?php echo $lang['txt_tagged'];?>: 
						<?php
						$prnt = "";
						foreach($id_card['tags'] as $key => $i):
							$prnt .= $i['tag_body'] . ", ";
						endforeach;
						$prnt = substr($prnt, 0, -2);
						echo $prnt;
						?>
						<br />
					</p>
				<?php }?>
				
				<?php
				if (isset($id_card['display_type']) && $id_card['display_type'] == "full") {
				if (!empty($id_card['identity_signature'])) {
				?>
				<p>
					<i>"<?php echo $id_card['identity_signature'];?>"</i><br />
				</p>
				<?php }}?>
				
				
				<?php
				if (isset($common_ties) || isset($id_card['testimonial_count'])) {
				?>
				<p align="right">
					<?php
					if (isset($common_ties)) {
					?>
					<a href="index.php?amn=core_tie_matrix&amp;identity_id=<?php echo $common_ties['identity_id']; ?>&amp;identity_id_relation=<?php echo $common_ties['identity_id_relation'];?>"><span class="icon_frame">
					<span class="icon_title">ties:</span>
					<span class="icon_value"><?php if (isset($common_ties)) echo $common_ties['count_strong'];?></span>
					<span class="icon_value"><?php if (isset($common_ties)) echo $common_ties['count_weak'];?></span>
					</span>
					</a>
					&nbsp; 
					<?php }?>
					
					<?php
					if (isset($id_card['testimonial_count'])) {
					?>
					<span class="icon_frame">
						<span class="icon_title">&nbsp;vouched&nbsp;</span>
						<span class="icon_value">&nbsp;<a href="index.php?amn=core_profile&amp;identity_id=<?php echo $id_card['identity_id'];?>"><?php echo $id_card['testimonial_count'];?></a>&nbsp;</span>
					</span>
					<?php }?>
				</p>
				<?php }?>
				
			</td>
		</tr>
	</table>
	
	<?php
	if (!empty($id_card['custom_fields'])) {
	?>
	<p>
		<?php
		$prnt = "";
		foreach ($id_card['custom_fields'] as $idckey => $idc):
		if (!empty($idc['custom_item_body'])) {
			$prnt .= $lang['identity']['custom'][$idc['custom_item_id']] . ":";
			$prnt .= $idc['custom_item_body'];
			$prnt .= ",&nbsp; ";
		}
		endforeach;
		$prnt = substr($prnt, 0, -8);
		echo $prnt;
		?>
		<br />
	</p>
	<?php }?>
<?php }?>