<?php
require_once ("config.inc.php");
require_once ("includes/mysql.inc.php");
require_once ("includes/arrays.inc.php");
require_once ("classes/userside.class.php");
require_once ("includes/Pager/Pager.php");
require_once ("classes/misc.class.php");
require_once ("classes/timespamp.php");
$ds = new FuzzyTime();

$message	= "";
$script		= "";
$pages		= "";
$data		= array();
$array		= array();
$page		= isset($_REQUEST['page'])	?	trim($_REQUEST['page'])	:	"1";
$name		= isset($_POST['vUN'])	?	stripslashes(trim($_POST['vUN']))	:	"";

if (!$objDB) {
	$message	= "Unable to Locate Database Server.";
} else {
	$objC		= new check();
	$objU		= new userside($objDB);
        $objSR		= new settings($objDB);
	$objM		= new misc($objDB);
        $settingDetail	= $objSR->select();
        //echo "usearch",$settingDetail['enable_user_search'];exit;
        //echo"<pre>";print_r($_SESSION);exit;
         $array	= $objU->select($_SESSION['user_id']);
         
         $array['search'] = $_REQUEST['search'];
         $data1           = $objU->chatsearch($array,true);
         
         
        
         
}

?>
<?php if($data1['data']){
    
     foreach ($data1['data'] as $key=>$val){
         
         $name = ($val['vFirstName'])?$val['vFirstName'].' '.$val['vLastName']:$val['vLogin']
         
    ?>


<li id="<?php echo $val['nUser_Id']?>" class="chatsearch_txt">
	<img src="<?php echo $objU->get_image_url(PROFILE_IMAGE_URL, $val['nPhoto_Id'], $val['vGender']);?>" width="35" height="35"/>
	<span><?php echo $name?></span>
	<a href="javascript:void(0);" onclick="addtochat('<?php echo $val['nUser_Id']?>')">Add to Chat</a><li>


<?php } }else{
    
    echo "No Profiles found";
}?>
