<?php

// -----------------------------------------------------------------------
// This file is part of Igloo
//
// Copyright (C) 2003 - 2006 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.
// -----------------------------------------------------------------------

?>




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

		<div class="box_mid">
			<div class="content">
				<?php
				$skillcloud="";
				if (isset($skills)) {
					foreach ($skills as $key => $s):
						$skillcloud .= "<a href='skl_view.php?search_text=".$s['skill_name']."'>".$s['skill_name']."</a>";
						if (count($skills) > $key+1) {
							$skillcloud .= ", ";
				}
						endforeach;
					
					echo $skillcloud;
					
				}
				elseif (isset($users)) {
				$display_items = trimArray($users);
				?>
				<table width="100%" border="0" cellspacing="0" cellpadding="4">
					<?php
					foreach($display_items as $key => $i):
					?>
					
					<tr>
						<td valign="top" width="32" rowspan="2">
							<a href="sn_profile.php?user_id=<?php echo $i['user_id'];?>"><img src="get_file.php?file=<?php echo $i['image']['file'];?>" border="0" class="picture" alt="<?php echo $i['image']['file_title'];?>" /></a><br />
						</td>
						<td valign="middle">
							<?php
							if (!empty($i['am_relation_to_them']['relation_show_true_self'])) {
							?>
								<b><a href="sn_profile.php?user_id=<?php echo $i['user_id'];?>"><?php echo $i['user_firstname']. " " . $i['user_surname'];?></a></b>,
								
								
								<?php echo $this->date->formatDate($i['user_create_datetime']);?>,
								<?php echo $i['user_hometown'];?>,
							<?php
							}
							else {
							?>
							
								<a href="sn_profile.php?user_id=<?php echo $i['user_id'];?>"><b><?php echo $i['profile_nic'];?></b></a>,
								
								
								<?php echo $this->date->formatDate($i['user_create_datetime']);?>,
								<?php echo $i['profile_hometown'];?>,
							<?php }?>
							
							<?php
							if ($i['online_status'] == 1) {
								echo "<b>" . $lang['arr_user_online_status'][1] . "</b><br />";
							}
							else {
									echo $lang['arr_user_online_status'][$i['online_status']] . "<br />";
							}
							?>
						</td>
						<td align="right" rowspan="2">
							<?php
							if (isset($i['profile_allow_msg']) && $i['profile_allow_msg'] == 1) {
							?>
							<a href="msg_edit.php?to_user_id=<?php echo $i['user_id'];?>"><img src="<?php echo $templatePath;?>img/unopenned_mail.png" title="<?php echo $lang['ttl_send_message'];?>" border="0" alt="" /></a>&nbsp;&nbsp;<br />
							<?php }?>
						</td>
					</tr>
					<?php 
					if (isset($i['skills'])) {
					?>
					<tr>
						<td>
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" alt="" /><br />
							<table border="0" cellspacing="0" cellpadding="2" width="100%">
								<?php
								foreach($i['skills'] as $skillkey => $s): ?>
								<tr>
									<td valign="top" colspan="2">
										<b><?php echo $s['skill_name'];?></b><br />
									</td>
								</tr>
								<tr>
									<td valign="top">
										<?php echo $s['skill_experience'];?><br />
									</td>
									<td valign="top" align="right">
										<?php 
										if (isset($lang['arr_skill']['rating'][$s['skill_rating']])) {
											echo $lang['arr_skill']['rating'][$s['skill_rating']];
										}
										?><br />
									</td>
								</tr>
								<tr>
									<td colspan="2">
										<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="6" alt="" /><br />
									</td>
								</tr>
								<?php 
								endforeach; 
								?>
							</table>
						</td>
					</tr>
					<?php }?>
					<tr>
						<td colspan="4">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="4" alt="" /><br />
						</td>
					</tr>
					<?php
					endforeach;
					?>
				</table>
				<?php
				echo createArrayList($users);
				?>
				<?php
				}
				else {
				?>
				<p>
					<?php echo $lang['err_no_people_skills'];?><br />
				</p>
				<?php }?>
			</div>
		</div>
	</div>
		
	<div class="box_bottom">
		<span class="box_bottom_right"></span>
		<span class="box_bottom_left"></span>
	</div>
</div>

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

		<div class="box_mid">
			<div class="content">
				<p>
					<b><?php echo $lang['txt_view'];?></b><br />
				</p>
				
				<?php
				if (isset($view) && $view == "network") {
				?>
				<?php echo $lang['href_view_network'];?><br />
				<?php
				}
				else {
				?>
				<a href="skl_view.php?view=network"><?php echo $lang['href_view_network'];?></a><br />
				<?php }?>
				
				<?php
				if (isset($view) && $view == "directory") {
				?>
				<?php echo $lang['href_view_directory'];?><br />
				<?php
				}
				else {
				?>
				<a href="skl_view.php?view=directory"><?php echo $lang['href_view_directory'];?></a><br />
				<?php }?>
				
				<p>
					<h3><?php echo $lang['hdr_search'];?></h3>
				</p>
				<p>
					<?php echo $lang['txt_search_intro'];?><br />
				</p>
				
				<p>
					<form action="skl_view.php" method="post" name="frm" id="id_frm">
					<input type="text" class="input" name="search_text" size="20" value="<?php if (isset($frmdata['search_text'])) { echo $frmdata['search_text'];}?>" /><br />
					<br />
					<br />
					<input type="radio" name="degree" value="1" checked="checked">
					<?php echo $lang['form_my_network'];?><br />
					<input type="radio" name="degree" value="all" <?php if(isset($frmdata['degree']) && $frmdata['degree'] == "all") { echo "checked=\"checked\"";}?>>
					<?php echo $lang['form_directory'];?><br />
					
					
					<input type="image" src="<?php echo $templatePath;?>img/go.png" value="search" class="go" /><br />
					</form>
				</p>
			</div>
		</div>
	</div>
		
	<div class="box_bottom">
		<span class="box_bottom_right"></span>
		<span class="box_bottom_left"></span>
	</div>
</div>
