<?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.
// -----------------------------------------------------------------------

?>

<style type="text/css">
<!--
@import url(<?php echo $template_path;?>css/aroundme_form.css);
-->
</style>

<style type="text/css">

#content .col_left {
		float:left;
		position:relative;
		left:0px;
		width:200px;
	}
	
	#content .col_main {
		float:left;
		position:relative;
		left:12px;
		width:316px;
	}
	
	#content .col_right {
		float:left;
		position:relative;
		left:24px;
		width:200px;
	}
</style>


<div class="col_left">
	<div class="box">
		<div class="box_top">
			<?php echo $identity['identity_nic'];?><br />
		</div>

		<div class="box_mid">
			<div class="content">
				<p>
					<a href="index.php?amn=core_profile&identity_id=<?php echo $identity['identity_id'];?>"><b><?php echo $identity['identity_nic'];?></b></a><br />	
				</p>
	
				<?php
				if(isset($identity['image'])) {
				?>
				<p align="center">
					<a href="index.php?amn=core_profile&identity_id=<?php echo $identity['identity_id'];?>"><img src="get_file.php?file=<?php echo $identity['image']['file_md5_name_view']; ?>" border="0" class="picture" alt="" /></a><br />
				</p>
				<?php }?>
			
	
				<p>
					<?php echo $identity['location_name'];?><br />
					<?php echo $this->date->formatDate($identity['user_create_datetime'],1);?><br />
					<?php echo $lang['user_online_status'][$identity['online_status']];?><br />
				</p>
		
				<?php
				if (isset($identity['display_type']) && $identity['display_type'] == "full") {
				if (!empty($identity['identity_signature'])) {
				?>
				<p>
					<i>"<?php echo $identity['identity_signature'];?>"</i><br />
				</p>
				<?php }}?>
				
				
				<?php
				if (isset($identity['invitee'])) {
				?>
				<p>
					<b><?php echo $lang['txt_invited_by'];?></b><br />
				</p>
				
				<table cellspacing="2" cellpadding="0" border="0" width="100%">
					<tr>
						<td valign="top">
							<a href="index.php?amn=core_profile&amp;identity_id=<?php echo $identity['invitee']['identity_id_relation'];?>"><?php echo $identity['invitee']['identity_nic'];?></a><br />
						</td>
						<td valign="top" align="right">
							<?php
							if (isset($identity['invitee']['common_ties'])) {
							?>
							<span class="icon_frame">
							<span class="icon_title"><a href="index.php?amn=core_tie_matrix&amp;identity_id=<?php echo $identity['invitee']['common_ties']['identity_id']; ?>&amp;identity_id_relation=<?php echo $identity['invitee']['common_ties']['identity_id_relation'];?>"><?php echo $lang['txt_matrix']; ?></a></span>
							<span class="icon_value"><?php echo $identity['invitee']['common_ties']['count_strong'];?></span>
							<span class="icon_value"><?php echo $identity['invitee']['common_ties']['count_weak'];?></span>
							</span>
							&nbsp; 
							<?php }?>
						</td>
					</tr>
				</table>
				<?php }?>
				
				<p>
					<b><?php echo $lang['txt_latest_respected'];?></b><br />
				</p>
				
				<?php
				if (isset($identity['ties'])) {
				?>
				<table cellspacing="2" cellpadding="0" border="0" width="100%">
					<?php
					foreach ($identity['ties'] as $key => $i):
					?>
					<tr>
						<td width="32" valign="top">
							<a href="index.php?amn=core_profile&amp;module_id=<?php echo $i['module_id'];?>&amp;item_id=<?php echo $i['item_id'];?>&amp;identity_id=<?php echo $i['identity_id_relation'];?>"><img src="get_file.php?file=<?php echo $i['identity']['image']['file_md5_name_view'];?>" border="0" alt="<?php echo $i['identity']['image']['file_title'];?>" /></a><br />
						</td>
						<td valign="top">
							<a href="index.php?amn=core_profile&amp;module_id=<?php echo $i['module_id'];?>&amp;item_id=<?php echo $i['item_id'];?>&amp;identity_id=<?php echo $i['identity_id_relation'];?>"><?php echo $i['identity']['identity_nic'];?></a><br />
							<a href="<?php echo $i['item']['item_url']; ?>"><?php echo $i['item']['item_title']; ?></a>
						</td>
						<td valign="top" align="right">
							<?php
							if (isset($i['common_ties'])) {
							?>
							<span class="icon_frame">
							<span class="icon_title"><a href="index.php?amn=core_tie_matrix&amp;identity_id=<?php echo $i['identity_id']; ?>&amp;identity_id_relation=<?php echo $i['identity_id_relation'];?>"><?php echo $lang['txt_matrix'];?></a></span>
							<span class="icon_value"><?php echo $i['common_ties']['count_strong'];?></span>
							<span class="icon_value"><?php echo $i['common_ties']['count_weak'];?></span>
							</span>
							&nbsp; 
							<?php }?>
						</td>
					</tr>
					<?php
					endforeach;
					?>
				</table>
				<?php }?>
			</div>
		</div>
	</div>
</div>
	

<div class="col_main">
	<div class="box">
		<div class="box_top">
			<?php echo $lang['hdr_matrix'];?><br />
		</div>

		<div class="box_mid">
			<div class="content">
				<p style="float:right;">
					<img src="<?php echo $template_path;?>img/help.png" style="cursor:help;"  title="<?php echo $lang['txt_help'];?>" hspace="2" alt="" border="0" onClick="javascript:launchPopupWindow('components/core/help.php?help=core_ties#s_tie');" /><br />
				</p>
				
				<p>
					<?php echo $lang['txt_ties_intro'];?><br />			
				</p>
				
				<p>
					<b><?php echo $lang['txt_direct_connection'];?></b><br />
					<?php echo $lang['txt_direct_connection_intro'];?><br />		
				</p>
				
				<p align="center">
					<a href="index.php?amn=core_profile&identity_id=<?php echo $ties_common['from_identity']['identity_id'];?>"><?php echo $ties_common['from_identity']['identity_nic'];?></a>
					&nbsp;
					<a href="index.php?amn=core_tie_matrix&amp;identity_id=<?php echo $_REQUEST['identity_id']; ?>&amp;identity_id_relation=<?php echo $_REQUEST['identity_id_relation']; ?>" class="icon_frame" style="text-decoration:none;">
					<span class="icon_title"><?php echo $ties_common['count_strong']; ?></span>
					<span class="icon_value"><?php echo $ties_common['count_weak']; ?></span>
					</a>
					&nbsp;
					<a href="index.php?amn=core_profile&identity_id=<?php echo $ties_common['to_identity']['identity_id'];?>"><?php echo $ties_common['to_identity']['identity_nic']; ?></a>
					<br />
				</p>
				
				<?php 
				if (isset($ties['strong']) && !empty($ties['strong'])) { 
				?>
										
				<hr />
				
				<p>
					<b><?php echo $lang['txt_strongest_connections'];?></b><br />
					<?php echo $lang['txt_strongest_connections_intro'];?><br />		
				</p>
				
				<?php 
				if (!empty($ties['strong'])) { 
				?>
				<?php 
				foreach($ties['strong'] as $t):
				if (!isset($current_identity_id) || $current_identity_id != $t['from_identity']['identity_id']) {
				?>
				<p align="center">
					<?php echo $t['from_identity']['identity_nic']; ?>
					<?php } ?>
						
					<a href="index.php?amn=core_tie_matrix&amp;identity_id=<?php echo $t['from']; ?>&amp;identity_id_relation=<?php echo $t['to']; ?>" class="icon_frame" style="text-decoration:none;">
					<span class="icon_title"><?php echo $t['count_strong']?></span>
					<span class="icon_value"><?php echo $t['count_weak']?></span>
					</a>
					&nbsp;
					<a href="index.php?amn=core_profile&identity_id=<?php echo $ties_common['to_identity']['identity_id'];?>"><?php echo $t['to_identity']['identity_nic']; ?></a>&nbsp;
						
					<?php if ($t['to'] == $_REQUEST['identity_id_relation']) { ?>
				</p>
				<?php
				}
				$current_identity_id = $t['to'];
				endforeach; 
				?>
				<?php } ?>
				<?php } ?>		
				
				
				<?php 
				if (!empty($ties['strong_weak'])) { 
				?>
				
				<hr />
				
				<p>
					<b><?php echo $lang['txt_strong_to_weak'];?></b><br />
					<?php echo $lang['txt_strong_to_weak_intro'];?><br />
				</p>
				
				
				<?php 
				foreach($ties['strong_weak'] as $t):
				if (!isset($current_identity_id) || $current_identity_id != $t['from_identity']['identity_id']) {
				?>
				<p align="center">
					<?php echo $t['from_identity']['identity_nic']; ?>
					<?php } ?>
						
					<a href="index.php?amn=core_tie_matrix&amp;identity_id=<?php echo $t['from']; ?>&amp;identity_id_relation=<?php echo $t['to']; ?>" class="icon_frame" style="text-decoration:none;">
					<span class="icon_title"><?php echo $t['count_strong']?></span>
					<span class="icon_value"><?php echo $t['count_weak']?></span>
					</a>
					&nbsp;
					<a href="index.php?amn=core_profile&identity_id=<?php echo $ties_common['to_identity']['identity_id'];?>"><?php echo $t['to_identity']['identity_nic']; ?></a>&nbsp;
						
					<?php if ($t['to'] == $_REQUEST['identity_id_relation']) { ?>
				</p>
				<?php
				}
				$current_identity_id = $t['to'];
				endforeach; 
				?>
				<?php } ?>
				
				
				<?php 
				if (!empty($ties['weak_strong'])) { 
				?>
				
				<hr />
				
				<p>
					<b><?php echo $lang['txt_weak_to_strong'];?></b><br />
					<?php echo $lang['txt_weak_to_strong_intro'];?><br />
				</p>
				
				
				<?php 
				foreach($ties['weak_strong'] as $t):
				if (!isset($current_identity_id) || $current_identity_id != $t['from_identity']['identity_id']) {
				?>
				<p align="center">
					<?php echo $t['from_identity']['identity_nic']; ?>
					<?php } ?>
						
					<a href="index.php?amn=core_tie_matrix&amp;identity_id=<?php echo $t['from']; ?>&amp;identity_id_relation=<?php echo $t['to']; ?>" class="icon_frame" style="text-decoration:none;">
					<span class="icon_title"><?php echo $t['count_strong']?></span>
					<span class="icon_value"><?php echo $t['count_weak']?></span>
					</a>
					&nbsp;
					<a href="index.php?amn=core_profile&identity_id=<?php echo $ties_common['to_identity']['identity_id'];?>"><?php echo $t['to_identity']['identity_nic']; ?></a>&nbsp;
						
					<?php if ($t['to'] == $_REQUEST['identity_id_relation']) { ?>
				</p>
				<?php
				}
				$current_identity_id = $t['to'];
				endforeach; 
				?>
				<?php } ?>
				
				
				<?php 
				if (!empty($ties['weak_outbound'])) { 
				?>
				
				<hr />
				
				<p>
					<b><?php echo $lang['txt_weak_outbound'];?></b><br />
					<?php echo $lang['txt_weak_outbound_intro'];?><br />
				</p>
				
				
				<?php 
				foreach($ties['weak_outbound'] as $t):
				if (!isset($current_identity_id) || $current_identity_id != $t['from_identity']['identity_id']) {
				?>
				<p align="center">
					<?php echo $t['from_identity']['identity_nic']; ?>
					<?php } ?>
						
					<a href="index.php?amn=core_tie_matrix&amp;identity_id=<?php echo $t['from']; ?>&amp;identity_id_relation=<?php echo $t['to']; ?>" class="icon_frame" style="text-decoration:none;">
					<span class="icon_title"><?php echo $t['count_strong']?></span>
					<span class="icon_value"><?php echo $t['count_weak']?></span>
					</a>
					&nbsp;
					<a href="index.php?amn=core_profile&identity_id=<?php echo $ties_common['to_identity']['identity_id'];?>"><?php echo $t['to_identity']['identity_nic']; ?></a>&nbsp;
						
					<?php if ($t['to'] == $_REQUEST['identity_id_relation']) { ?>
				</p>
				<?php
				}
				$current_identity_id = $t['to'];
				endforeach; 
				?>
				<?php } ?>
				
				
				<?php 
				if (!empty($ties['weak_inbound'])) { 
				?>
				
				<hr />
				
				<p>
					<b><?php echo $lang['txt_weak_inbound'];?></b><br />
					<?php echo $lang['txt_weak_inbound_intro'];?><br />
				</p>
				
				
				<?php 
				foreach($ties['weak_inbound'] as $t):
				if (!isset($current_identity_id) || $current_identity_id != $t['from_identity']['identity_id']) {
				?>
				<p align="center">
					<?php echo $t['from_identity']['identity_nic']; ?>
					<?php } ?>
						
					<a href="index.php?amn=core_tie_matrix&amp;identity_id=<?php echo $t['from']; ?>&amp;identity_id_relation=<?php echo $t['to']; ?>" class="icon_frame" style="text-decoration:none;">
					<span class="icon_title"><?php echo $t['count_strong']?></span>
					<span class="icon_value"><?php echo $t['count_weak']?></span>
					</a>
					&nbsp;
					<a href="index.php?amn=core_profile&identity_id=<?php echo $ties_common['to_identity']['identity_id'];?>"><?php echo $t['to_identity']['identity_nic']; ?></a>&nbsp;
						
					<?php if ($t['to'] == $_REQUEST['identity_id_relation']) { ?>
				</p>
				<?php
				}
				$current_identity_id = $t['to'];
				endforeach; 
				?>
				<?php } ?>
				
				
				<?php 
				if (!empty($ties_common['strong']) || !empty($ties_common['weak'])) { 
				?>
				
				<hr />
				
				<p>
					<b><?php echo $lang['txt_shared_participation'];?></b><br />
				</p>

				<ul>
					<?php foreach($ties_common['strong'] as $t): ?>
					<li><a href="<?php echo $t['item_url'];?>"><?php echo $t['item_title'];?></a></li>			
					<?php endforeach; ?>
				</ul>
				<?php } ?>
				
				<?php 
				if (isset($ties_common['weak']) && !empty($ties_common['weak'])) { 
				?>
				<ul>
					<?php foreach($ties_common['weak'] as $t): ?>
					<li><a href="<?php echo $t['item_url'];?>"><?php echo $t['item_title'];?></a></li>	
					<?php endforeach; ?>
				</ul>
				<?php } ?>
			</div>
		</div>
	</div>
</div>

<div class="col_right">
	<div class="box">
		<div class="box_top">
			<?php echo $identity_relation['identity_nic'];?><br />
		</div>

		<div class="box_mid">
			<div class="content">
				<p>
					<a href="index.php?amn=core_profile&identity_id=<?php echo $identity_relation['identity_id'];?>"><b><?php echo $identity_relation['identity_nic'];?></b></a><br />	
				</p>
	
				<?php
				if(isset($identity_relation['image'])) {
				?>
				<p align="center">
					<a href="index.php?amn=core_profile&identity_id=<?php echo $identity_relation['identity_id'];?>"><img src="get_file.php?file=<?php echo $identity_relation['image']['file_md5_name_view']; ?>" border="0" class="picture" alt="" /></a><br />
				</p>
				<?php }?>
			
	
				<p>
					<?php echo $identity_relation['location_name'];?><br />
					<?php echo $this->date->formatDate($identity_relation['user_create_datetime'],1);?><br />
					<?php echo $lang['user_online_status'][$identity_relation['online_status']];?><br />
				</p>
	
				<?php
				if (isset($identity_relation['display_type']) && $identity_relation['display_type'] == "full") {
				if (!empty($identity_relation['identity_signature'])) {
				?>
				<p>
					<i>"<?php echo $identity_relation['identity_signature'];?>"</i><br />
				</p>
				<?php }}?>
				
				
				<?php
				if (isset($identity_relation['invitee'])) {
				?>
				<p>
					<b><?php echo $lang['txt_invited_by'];?></b><br />
				</p>
				
				<table cellspacing="2" cellpadding="0" border="0" width="100%">
					<tr>
						<td valign="top">
							<a href="index.php?amn=core_profile&amp;identity_id=<?php echo $identity_relation['invitee']['identity_id_relation'];?>"><?php echo $identity_relation['invitee']['identity_nic'];?></a><br />
						</td>
						<td valign="top" align="right">
							<?php
							if (isset($identity_relation['invitee']['common_ties'])) {
							?>
							<span class="icon_frame">
							<span class="icon_title"><a href="index.php?amn=core_tie_matrix&amp;identity_id=<?php echo $identity_relation['invitee']['common_ties']['identity_id']; ?>&amp;identity_id_relation=<?php echo $identity_relation['invitee']['common_ties']['identity_id_relation'];?>"><?php echo $lang['txt_matrix']; ?></a></span>
							<span class="icon_value"><?php echo $identity_relation['invitee']['common_ties']['count_strong'];?></span>
							<span class="icon_value"><?php echo $identity_relation['invitee']['common_ties']['count_weak'];?></span>
							</span>
							&nbsp; 
							<?php }?>
						</td>
					</tr>
				</table>
				<?php }?>
					
				
				<p>
					<b><?php echo $lang['txt_latest_respected'];?></b><br />
				</p>
				
				<?php
				if (isset($identity_relation['ties'])) {
				?>
				<table cellspacing="2" cellpadding="0" border="0" width="100%">
					<?php
					foreach ($identity_relation['ties'] as $key => $i):
					?>
					<tr>
						<td width="32" valign="top">
							<a href="index.php?amn=core_profile&amp;module_id=<?php echo $i['module_id'];?>&amp;item_id=<?php echo $i['item_id'];?>&amp;identity_id=<?php echo $i['identity_id_relation'];?>"><img src="get_file.php?file=<?php echo $i['identity']['image']['file_md5_name_view'];?>" border="0" alt="<?php echo $i['identity']['image']['file_title'];?>" /></a><br />
						</td>
						<td valign="top">
							<a href="index.php?amn=core_profile&amp;module_id=<?php echo $i['module_id'];?>&amp;item_id=<?php echo $i['item_id'];?>&amp;identity_id=<?php echo $i['identity_id_relation'];?>"><?php echo $i['identity']['identity_nic'];?></a><br />
							<a href="<?php echo $i['item']['item_url']; ?>"><?php echo $i['item']['item_title']; ?></a>
						</td>
						<td valign="top" align="right">
							<?php
							if (isset($i['common_ties'])) {
							?>
							<span class="icon_frame">
							<span class="icon_title"><a href="index.php?amn=core_tie_matrix&amp;identity_id=<?php echo $i['identity_id']; ?>&amp;identity_id_relation=<?php echo $i['identity_id_relation'];?>">matrix</a></span>
							<span class="icon_value"><?php echo $i['common_ties']['count_strong'];?></span>
							<span class="icon_value"><?php echo $i['common_ties']['count_weak'];?></span>
							</span>
							&nbsp; 
							<?php }?>
						</td>
					</tr>
					<?php
					endforeach;
					?>
				</table>
				<?php }?>
			</div>
		</div>
	</div>
</div>