<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $title;?></title>
<?php $this->load->view('common/meta_tags'); ?>
<?php $this->load->view('common/before_head_close'); ?>
</head>
<body>
<?php $this->load->view('common/after_body_open'); ?>
<!--Site Wraper Start-->
<div class="siteWraper">
  <?php $this->load->view('common/header'); ?>
  <?php if($this->session->userdata('is_user_login')):?>
  	<?php $this->load->view('common/logged_in_bar'); ?>        
  <?php endif;?>  
    <!--Recent Profiles Start-->
	<div class="inner">
        <!--Recent Profiles Start-->
        <div class="leftCol left">
           	<div class="profileWrap">
            	<h1>Search Result</h1> <span class="onlinelast"><?php echo($search_row)?count($search_row):'0';?> Profiles Found</span>
				<div class="searchResult">
            	<ul class="recomendList">
                <?php
				$this->load->model('friend_model');
				
				if($search_row) {
					foreach($search_row as $searchDetail) {
						
						if($this->session->userdata('username') == $searchDetail->username) {
							continue;
						}
				?>
                	<li>
                    	<div class="imgbox"><a href="<?php echo base_url(); ?>profile/<?php echo $searchDetail->username; ?>"><img src="<?php echo ($searchDetail->photo)?base_url().'glancePublic/uploads/member_images/thumb_'.$searchDetail->photo:base_url().'glancePublic/images/no-image.jpg';?>" alt="<?php echo $searchDetail->name?>" /></a></div>
                        <div class="infoProfile">
                        	<h2><a href="<?php echo base_url(); ?>profile/<?php echo $searchDetail->username; ?>" title="<?php echo $searchDetail->name?>"><?php echo $searchDetail->name?></a></h2>
                            <p><b>Gender:</b> <?php echo $searchDetail->gender;?></p>
                            <p><b>Age:</b> <?php echo $searchDetail->mAge;?> yrs</p>
                            <p><?php echo $searchDetail->city;?></p>
                            <?php
							$isFriend = 0;
							if($this->session->userdata('username')) {
								$isFriend = $this->friend_model->isfriends($this->session->userdata('member_id'),$searchDetail->id);
							}
							if(!$isFriend) {
                            ?>
                            <a href="<?php echo base_url(); ?>friends/send_friend_request/<?php echo my_encrypt($searchDetail->id); ?>" class="chatbtn" title="Send Friend Request">Add Friend</a> 
                            <?php
							}
							if($this->session->userdata('username')) {
							?>
                            <a href="javascript:;" onclick="setRecieverSession('<?php echo $searchDetail->username;?>')" class="chatbtn" title="Send Message"> Message</a>
                            <?php
							}
							?>
                          <div class="clear"></div>
                        </div>
                        <div class="clear"></div>
                    </li>
                <?php
					}
				}
				?>    
                </ul>
            </div>
            	
           	  <div class="clear"></div>
            
            </div>
        	
        </div>
        
        <!--Right Col Start-->
       <?php $this->load->view('common/profile_right_side');?>
    <div class="clear"></div>
    </div>
    <!--Recent Profiles Endt-->
  <?php $this->load->view('common/footer'); ?>
</div>
<!--/Site Wraper End-->
<?php $this->load->view('common/after_body_open'); ?>
</body>
</html>
