<?php 
/*
##################################################################
#                       PHP 4&5 MySQL 4&5                        #
##################################################################
#           Copyright (c) 2004-2008 Armia Systems Inc            #
##################################################################
#               This file is part of Cybermatch site             #
##################################################################
#    Developed By: simi (simi@armia.com)                         #

##################################################################
#               Developed On:   03-04-2008                       #
##################################################################
#  				Modified By:        	                         #
##################################################################
#               Modified On:                                     #
##################################################################
# This script may not be distributed, sold, given away for free  #
# to third party, or used as a part of any internet ervices such #
# as webdesign etc.                                              #
##################################################################
*/

require_once ("config.inc.php");
require_once ("includes/mysql.inc.php");
require_once ("includes/arrays.inc.php");
require_once ("includes/trackstatus.inc.php");

require_once ("classes/userside.class.php");
require_once ("classes/misc.class.php");

$message	= "";
$array		= array();

if (!$objDB) {
	$message	= "Unable to Locate Database Server.";
} else {
	$objU		= new userside($objDB);
	$objM		= new misc($objDB);
	$array		= $objM->get_my_friend_list($_SESSION['user_id']);

}
?>
<table width="100%"  border="0" cellspacing="0" cellpadding="8" class="maintext">
								<?php if (!empty($array)) {
								foreach ($array as $key => $value) { ?>
                                  <tr>
                                    <td align="left" scope="col">
									<?php if($value['vOnline'] == "Online") { ?>
									<img src="images/chatonline.gif" width="12" height="12">
									<?php } elseif ($value['vOnline'] == "Busy") { ?>
									<img src="images/chatbusy.gif" width="12" height="12">
									<?php } else { ?>
									<img src="images/chatoffline.gif" width="12" height="12">
									<?php } ?>&nbsp;&nbsp;<a href="#" onClick="javascript:launchchatboxsession(<?php echo $value['nUser_Id_Friend']?>);" class="maintextCopy">
									<span title="header=[<img  style='vertical-align:middle' src='images/info.gif' width='20px' height='20px' border='0'>&nbsp;&nbsp;<?php echo $value['vLogin_Friend']?> (<?php echo $value['vOnline']?>)] body=[<?php echo $value['vName_Friend']?>, <?php echo $value['vAge']?> year old <?php echo $value['vGender']?>]"><strong><?php echo $value['vLogin_Friend']?>
									</strong></span></a>
									</td>
                                  </tr>
								  <?php } ?>
								  <?php if(count($array) < 7) { 
								  for ($index=1; $index<=(7-count($array)); $index++) { ?>
                                  <tr>
                                    <td class="maintext">&nbsp;</td>
                                  </tr>
								  <?php } }?>
                                  <tr>
                                    <td class="maintext">&nbsp;</td>
                                  </tr>
								  
								 <?php } else {?>
  <tr>
	<td class="maintext"><b>No Friends in your chatbox!</b></td>
  </tr>
								  <?php } ?>
                                </table>