<section id="profile" class="content_wrapper innerPage clearfix">
               <div class="contactWraper container">
                <form action="" method="post" id="member-search-frm"> 
                  <div class="contactHeader clearfix">
                  <h1 class="inline noborder heading"><?php echo getLang('Contacts'); ?></h1>
                  <div class="filterContact">
                    <ul>
                      <li><?php echo getLang('Ladies'); ?> <label class="switch"> <input type="checkbox" name="accounttype[]" value="lady" class="acc_type" > <span class="slider round"></span></label></li>
                      <li><?php echo getLang('Couples'); ?> <label class="switch"> <input type="checkbox" name="accounttype[]" value="couple" class="acc_type" > <span class="slider round"></span></label></li>
                      <li><?php echo getLang('Gentlemans'); ?> <label class="switch"> <input type="checkbox" name="accounttype[]" value="gentleman" class="acc_type" > <span class="slider round"></span></label></li>
                    </ul>
                  </div>
                  <div class="searchOuter">
                    <input type="text" name="serach" value="<?php if($this->input->post('serach')){ echo $this->input->post('serach'); }?>" placeholder="<?php echo getLang('Search_Member'); ?>">
                    <input type="submit" class="btn_dark_normal memberSearchButt" value="<?php echo getLang('Search'); ?>">
                  </div>
                 </div>
                </form> 
				<div class="memberLeftpanel">
                  <div class="contactBox">
                    <h3><?php echo getLang('Your_Contacts'); ?></h3>
                    <a href="<?php echo base_url().'contacts'; ?>" class="showall"><?php echo getLang('Show_All'); ?></a>
                    <ul>
                      <?php if(!empty($to_friend)){ 
                          foreach ($to_friend as $t_friend) { $location = uerLocation($t_friend['user_id']); ?>
                            <li>
                              <a target="_blank" href="<?php echo  base_url().'profil/'.$t_friend['alias'];?>" class="avatar_small new_avatar_small">
                                 <div class="contactAvatar" >
									<img class="tooltipImg" title="<div class='tooltipBox'>
                <div class='avatar-tooltip'>
                 <img src='<?php if(!empty($t_friend) && $t_friend['filename']!='' && file_exists(FCPATH.'assets/userfiles/'.$t_friend['path'].'/80/'.$t_friend['filename'].'.'.$t_friend['extension'])){ echo base_url().'assets/userfiles/'.$t_friend['path'].'/80/'.$t_friend['filename'].'.'.$t_friend['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; }?>' alt=''>
                </div>
                <div class='tooltip-container'>                                              
                                               <h5><?php echo $t_friend['username']; ?>
                                                <small><?php echo $location; ?></small>
                                                <?php if($t_friend['accounttype']=='couple'){?>
                                                <img src='images/couple.png' alt=''>
                                                <?php } ?>
                                                <?php if($t_friend['accounttype']=='lady'){?>
                                                <img src='images/lady.png' alt=''>
                                                <?php } ?>
                                                <?php if($t_friend['accounttype']=='gentleman'){?>
                                                <img src='images/gentleman.png' alt=''>
                                                <?php } ?>
                                               </h5>                  
                  <p><em><?php echo word_limiter($t_friend['about'],10); ?></em></p>
                </div>
                <?php if($this->session->userdata('user_id')){ ?>
                  <a href='<?php echo base_url('profil/'.$t_friend['alias']); ?>'><button type='button' class='tooltip-btn tooltipregister'><?php echo getLang('View_profile'); ?></button></a>
                <?php }else{ ?>
                  <button type='button' class='tooltip-btn tooltipregister'><?php echo getLang('View_profile_after_login'); ?></button>
                <?php } ?>
              </div>" src="<?php if(!empty($t_friend) && $t_friend['filename']!='' && file_exists(FCPATH.'assets/userfiles/'.$t_friend['path'].'/80/'.$t_friend['filename'].'.'.$t_friend['extension'])){ echo base_url().'assets/userfiles/'.$t_friend['path'].'/80/'.$t_friend['filename'].'.'.$t_friend['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; }?>" alt="" srcset="<?php if(!empty($t_friend['filename']) && file_exists(FCPATH.'assets/userfiles/'.$t_friend['path'].'/80/'.$t_friend['filename'].'.'.$t_friend['extension'])){ echo  base_url().'assets/userfiles/'.$t_friend['path'].'/80/'.$t_friend['filename'].'.'.$t_friend['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; } ?> 1x, <?php if(!empty($t_friend['filename']) && file_exists(FCPATH.'assets/userfiles/'.$t_friend['path'].'/160/'.$t_friend['filename'].'.'.$t_friend['extension'])){ echo  base_url().'assets/userfiles/'.$t_friend['path'].'/160/'.$t_friend['filename'].'.'.$t_friend['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; } ?> 2x" >
								
								 </div>
                              </a>
							  
                            </li>
                      <?php  }
                        }
                      ?>
                      <?php if(!empty($from_friend)){ 
                          foreach ($from_friend as $f_friend) { $location = uerLocation($f_friend['user_id']); ?>
                            <li>
                              <a target="_blank" href="<?php echo  base_url().'profil/'.$f_friend['alias'];?>" class="avatar_small">
                                 <div class="contactAvatar" >
									<img class="tooltipImg" title="<div class='tooltipBox'>
                <div class='avatar-tooltip'>
                 <img src='<?php if(!empty($f_friend) && $f_friend['filename']!='' && file_exists(FCPATH.'assets/userfiles/'.$f_friend['path'].'/80/'.$f_friend['filename'].'.'.$f_friend['extension'])){ echo base_url().'assets/userfiles/'.$f_friend['path'].'/80/'.$f_friend['filename'].'.'.$f_friend['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; }?>' alt=''>
                </div>
                <div class='tooltip-container'>                                              
                                               <h5><?php echo $f_friend['username']; ?>
                                                <small><?php echo $location; ?></small>
                                                <?php if($f_friend['accounttype']=='couple'){?>
                                                <img src='images/couple.png' alt=''>
                                                <?php } ?>
                                                <?php if($f_friend['accounttype']=='lady'){?>
                                                <img src='images/lady.png' alt=''>
                                                <?php } ?>
                                                <?php if($f_friend['accounttype']=='gentleman'){?>
                                                <img src='images/gentleman.png' alt=''>
                                                <?php } ?>
                                               </h5>                  
                  <p><em><?php echo word_limiter($f_friend['about'],10); ?></em></p>
                </div>
                <?php if($this->session->userdata('user_id')){ ?>
                  <a href='<?php echo base_url('profil/'.$f_friend['alias']); ?>'><button type='button' class='tooltip-btn tooltipregister'><?php echo getLang('View_profile'); ?></button></a>
                <?php }else{ ?>
                  <button type='button' class='tooltip-btn tooltipregister'><?php echo getLang('View_profile_after_login'); ?></button>
                <?php } ?>
              </div>" src="<?php if(!empty($f_friend) && $f_friend['filename']!='' && file_exists(FCPATH.'assets/userfiles/'.$f_friend['path'].'/80/'.$f_friend['filename'].'.'.$t_friend['extension'])){ echo base_url().'assets/userfiles/'.$f_friend['path'].'/80/'.$f_friend['filename'].'.'.$f_friend['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; }?>" alt="" srcset="<?php if(!empty($f_friend['filename']) && file_exists(FCPATH.'assets/userfiles/'.$f_friend['path'].'/80/'.$f_friend['filename'].'.'.$f_friend['extension'])){ echo  base_url().'assets/userfiles/'.$f_friend['path'].'/80/'.$f_friend['filename'].'.'.$f_friend['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; } ?> 1x, <?php if(!empty($f_friend['filename']) && file_exists(FCPATH.'assets/userfiles/'.$f_friend['path'].'/160/'.$f_friend['filename'].'.'.$f_friend['extension'])){ echo  base_url().'assets/userfiles/'.$f_friend['path'].'/160/'.$f_friend['filename'].'.'.$f_friend['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; } ?> 2x" >
								
								 </div>
                              </a>
                            </li>
                      <?php  }
                        }
                      ?>
                    </ul>
                  </div>
                  <div id="newsletter-carousel" class="owl-carousel newsletterUserBox clearfix">
                        <?php foreach ($newsletterUsers as $key => $items) {
                          if($items['username']!='')
                          {
                          ?>
                         <div class="item">  
                            <a target="_blank" href="<?php echo  base_url().'profil/'.$items['alias'];?>">
							<div>
                              <h3><?php echo $items['username']; ?></h3>
                              <h5><?php echo $items['accounttype'].', '.$items['country_name']; ?></h5>
                            </div>
                            <div class="itemAvatars">  
                                <div style="width:150px; height:150px; overflow: hidden; display: inline-block; vertical-align: top; -webkit-border-radius:100%; -moz-border-radius:100%; -ms-border-radius:100%; -khtml-border-radius:100%; border-radius:100%;">
                                     <img src="<?php if(!empty($items) && $items['filename']!='' && file_exists(FCPATH.'assets/userfiles/'.$items['path'].'/160/'.$items['filename'].'.'.$items['extension'])){ echo base_url().'assets/userfiles/'.$items['path'].'/160/'.$items['filename'].'.'.$items['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; }?>"  aria-hidden="true" width="100%" height="150px" alt="alt_text" border="0"  style="display:block;">
                                </div>
                            </div>
                            <div class="aboutFooter">
                              <h3 ><?php echo ucfirst($items['accounttype']); ?> of the week</h3>
                              <p><?php echo preg_replace('/\s+?(\S+)?$/', '', substr($items['about'], 0, 150)); ?>..</p>
                            </div>
							</a>
                         </div>
                        <?php } } ?>
                      </div>
                  </div>
                  <div class="profilewraper showMemresult">
                  <?php if(!empty($latestMembers)){ 
                          foreach ($latestMembers as $key=>$member) { ?>
                           <div class="profileBox">
                            <?php if($key < 90){ ?>
                              <img src="<?php echo  base_url().'assets/images/online.svg'; ?>" title="Online" class="closeProfile">
                            <?php } ?>
                            <a target="_blank" href="<?php echo  base_url().'profil/'.$member['alias'];?>">
                           <div class="contactAvatar" >
									<img src="<?php if(!empty($member) && $member['filename']!='' && file_exists(FCPATH.'assets/userfiles/'.$member['path'].'/80/'.$member['filename'].'.'.$member['extension'])){ echo base_url().'assets/userfiles/'.$member['path'].'/80/'.$member['filename'].'.'.$member['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; }?>" alt="" srcset="<?php if(!empty($member['filename']) && file_exists(FCPATH.'assets/userfiles/'.$member['path'].'/80/'.$member['filename'].'.'.$member['extension'])){ echo  base_url().'assets/userfiles/'.$member['path'].'/80/'.$member['filename'].'.'.$member['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; } ?> 1x, <?php if(!empty($member['filename']) && file_exists(FCPATH.'assets/userfiles/'.$member['path'].'/160/'.$member['filename'].'.'.$member['extension'])){ echo  base_url().'assets/userfiles/'.$member['path'].'/160/'.$member['filename'].'.'.$member['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; } ?> 2x" >
								
								 </div>
                            </a>
                            <h4><?php echo $member['username']; ?></h4>
                            <p class="noMargin"><?php echo ucfirst($member['accounttype']); ?> <span><?php echo ','.$member['country_name']; ?></span></p>
                            <p class="text_gold"><strong><?php echo getLang('Registered_since'); ?> </strong><br> <?php echo date('d.m.Y',$member['created']); ?></p>
                            <p id="message_error" style="color:red"></p>
                            <?php if($member['user_id']!=$this->session->userdata('user_id')){ ?>
                              <?php 
                                $connectCanDo = 1;
                                $acctype = $userDetials['accounttype'];
                                $FriendUnfriend = FriendUnfriend($this->session->userdata('user_id'),$member['user_id']);
                                if($loggedInUserMembershipDetails['id']==4)
                                {
                                  $connectCanDo = 0;
                                }
                                elseif ($loggedInUserMembershipDetails['id']==5) 
                                {
                                  if($acctype=='lady')
                                  {
                                    $connectCanDo = 0;
                                  }
                                  if($acctype=='gentleman')
                                  {
                                    if($FriendUnfriend==1)
                                    {
                                      $connectCanDo = 0;
                                    }
                                  }
                                  if($acctype=='couple')
                                  {
                                    if($FriendUnfriend==1)
                                    {
                                      $connectCanDo = 0;
                                    }
                                  }
                                }
                                elseif ($userDetials['free_member']==1) {
                                  if($FriendUnfriend==1)
                                  {
                                    $connectCanDo = 0;
                                  }
                                }
                              ?>  
                              <?php if($connectCanDo==1){ ?>
                                <a href="javascript:void(0)" data-id="<?php echo $member['user_id']; ?>" data-type="1" data-status="<?php echo $connectCanDo; ?>" class="profileBtn addblockUsersFromMembers"><?php echo getLang('Contact'); ?></a>
                              <?php }else{ ?>
                                <a href="<?php echo base_url().'messages/'.base64_encode($member['user_id']); ?>" class="profileBtn"><?php echo getLang('Contact'); ?></a>
                              <?php } ?>
                            <?php } ?>
                          </div>
                  <?php   }
                        }
                        else
                        {
                          echo '<div class="norecord">'.getLang('No_record_found').'</div>';
                        }
                    ?>
                    <div class="paginationouter"><?php echo $link; ?></div>
                  </div>

            <div class="memberRightpanel">
                  <div class="picoftheDay">
                    <h3 class="text_gold allcaps"><?php echo getLang('picture_of_the_day'); ?></h3>

                    <div class="picofthedayslider">
                      <div id="picofthedayslider" class="owl-carousel">
                        <?php if(!empty($todays_pics)){ 
                          foreach ($todays_pics as $pics) { ?>
                             <div class="item">
                              <?php if($pics['pics_user']){ ?>
                              <div class="pictureDayAvatarSection">
                                <div class="pictureDayAvatarSection_wrapper">
                                  <a target="_blank" href="<?php echo base_url().'profil/'.$pics['pics_user']['alias']; ?>">
                                  <img src="<?php if(!empty($pics['pics_user']) && $pics['pics_user']['filename']!='' && file_exists(FCPATH.'assets/userfiles/'.$pics['pics_user']['path'].'/80/'.$pics['pics_user']['filename'].'.'.$pics['pics_user']['extension'])){ echo base_url().'assets/userfiles/'.$pics['pics_user']['path'].'/80/'.$pics['pics_user']['filename'].'.'.$pics['pics_user']['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; }?>">
                                   </a>
                                </div>
                                  <h6><?php echo strtoupper($pics['pics_user']['username']); ?></h6>
                                  <p><?php echo strtolower($pics['pics_user']['accounttype']); ?>, <?php echo strtolower($pics['pics_user']['country_name']); ?></p>
                              </div>
                            <?php } ?>
               <?php if($pics['is_private']==1){?>
                
                 <div class="picofthedayimg" style="background:url(<?php if(!empty($pics['filename']) && file_exists(FCPATH.'assets/userfiles/'.$pics['path'].'/'.$pics['filename'].'_blur.'.$pics['extension'])){ echo base_url().'assets/userfiles/'.$pics['path'].'/'.$pics['filename'].'_blur.'.$pics['extension']; } else { echo 'images/default-avatar.jpg'; }?>) no-repeat center center / cover;"></div>
               <?php } else { ?>
                               
                 <div class="picofthedayimg" style="background:url(<?php if(!empty($pics['filename']) && file_exists(FCPATH.'assets/userfiles/'.$pics['path'].'/'.$pics['filename'].'.'.$pics['extension'])){ echo base_url().'assets/userfiles/'.$pics['path'].'/'.$pics['filename'].'.'.$pics['extension']; } else { echo 'images/default-avatar.jpg'; }?>) no-repeat center center / cover;"></div>
               <?php } ?>
                             </div>
                        <?php   }
                              }
                        ?> 
                        </div>
                    </div>
                  </div>

        <!-- HOT n NOT -->
          <div class="clearfix"></div>
            <?php if($this->session->userdata('user_id')==25267 || $this->session->userdata('user_id')==19624){ ?>  
              <div class="hotandnot">
                <h3 class="text_gold allcaps"><?php echo getLang('Hot_contest'); ?></h3>
                    <div class="hotornotmembers">
                    <?php if(count($totalLikedData)>10 && $loggedInUserMembershipDetails['id']==5 && count($userImages)<3)
                          {
                            echo '<div class="imgbox"><p>'.getLang('Please_upload_minimum').' 3 '.getLang('Pictures').' '.getLang('Or').' <a class="upgardeButt" style="text-decoration: underline;" href="'.base_url().'profile/before_settings">'.getLang('upgrade').'</a></p></div>';
                          }
                          elseif(count($totalLikedData)>500 && $loggedInUserMembershipDetails['id']==5 && count($userImages)<4)
                          {
                            echo '<div class="imgbox"><p>'.getLang('Please_upload_minimum').' 4 '.getLang('Pictures').' '.getLang('Or').' <a class="upgardeButt" style="text-decoration: underline;" href="'.base_url().'profile/before_settings">'.getLang('upgrade').'</a></p></div>';
                          }
                          elseif(count($totalLikedData)>1000 && $loggedInUserMembershipDetails['id']==5 && count($userImages)<5)
                          {
                            echo '<div class="imgbox"><p>'.getLang('Please_upload_minimum').' 5 '.getLang('Pictures').' '.getLang('Or').' <a class="upgardeButt" style="text-decoration: underline;" href="'.base_url().'profile/before_settings">'.getLang('upgrade').'</a></p></div>';
                          }
                          else
                          { ?>
                           <?php if (count($hotnot)>0) { ?>
                            <div class="imgbox">
                              <img src="<?php if(!empty($hotnot) && $hotnot['filename']!='' && file_exists(FCPATH.'assets/userfiles/'.$hotnot['path'].'/'.$hotnot['filename'].'.'.$hotnot['extension'])){ echo base_url().'assets/userfiles/'.$hotnot['path'].'/'.$hotnot['filename'].'.'.$hotnot['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; }?>" alt="">
                            </div>
                            <div class="hotnotFooter">
                              <button class="btn_grey hotmember" data-file="<?php echo $hotnot['file_id']; ?>" data-id="<?php echo $hotnot['user_id']; ?>" data-status="1"><?php echo getLang('Hot'); ?> <img src="<?php echo base_url() . 'assets/images/hotspot-icon.png'; ?>" alt=""></button>
                              <button class="btn_grey notmember" data-file="<?php echo $hotnot['user_id']; ?>" data-id="<?php echo $hotnot['user_id']; ?>" data-status="2"><?php echo getLang('Not'); ?></button>
                            </div>
                           <?php } ?> 
                          <?php } ?> 
                    </div>
              </div>
            <?php } ?>  
          <!-- / HOT n NOT --> 

              </div>     

      </div>
</section>
<script src="js/jquery.min.js"></script>
<script type="text/javascript">
    $(function(){
    $('body').on('click','.hotmember',function(){
      var id = $(this).data('id');
      var status = $(this).data('status');
      var file_id = $(this).data('file');
      $.ajax({
      url: '<?php echo base_url();?>checkin/updatehotornot',
      type: 'POST',
      data: 'id='+id+'&status='+status+'&file_id='+file_id,
      success: function(res)
      {
        $('.hotornotmembers').html('');
        $('.hotornotmembers').hide().html(res).fadeIn();
      } 
      })
    })
    $('body').on('click','.notmember',function(){
      var id = $(this).data('id');
      var status = $(this).data('status');
      var file_id = $(this).data('file');
      $.ajax({
      url: '<?php echo base_url();?>checkin/updatehotornot',
      type: 'POST',
      data: 'id='+id+'&status='+status+'&file_id='+file_id,
      success: function(res)
      {
        $('.hotornotmembers').html('');
        $('.hotornotmembers').hide().html(res).fadeIn();
      } 
      })
    }) 
    })
  
</script>