<section id="profile" class="content_wrapper innerPage clearfix">
             <div class="contactWraper container">
                <form action="" method="post" id="contact-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="contact_acc_type" <?php if($this->input->post('accounttype') && in_array('lady', $this->input->post('accounttype'))){ echo 'checked'; }?>> <span class="slider round"></span></label></li>
                        <li><?php echo getLang('Couples'); ?> <label class="switch"> <input type="checkbox" name="accounttype[]" value="couple" class="contact_acc_type" <?php if($this->input->post('accounttype') && in_array('couple', $this->input->post('accounttype'))){ echo 'checked'; }?>> <span class="slider round"></span></label></li>
                        <li><?php echo getLang('Gentlemans'); ?> <label class="switch"> <input type="checkbox" name="accounttype[]" value="gentleman" class="contact_acc_type" <?php if($this->input->post('accounttype') && in_array('gentleman', $this->input->post('accounttype'))){ echo 'checked'; }?>> <span class="slider round"></span></label></li>
                      </ul>
                    </div>
                    
                 </div>
               </form> 
               <div class="contactMessage">

                <?php if(!empty($to_friend)){ 
                    foreach ($to_friend as $t_friend) { 
                      if($t_friend['user_id_1']==$this->session->userdata('user_id')){ 
                        $msg_user_id = $t_friend['user_id_2']; 
                      } 
                      elseif($t_friend['user_id_2']==$this->session->userdata('user_id')) { 
                        $msg_user_id =  $t_friend['user_id_1']; 
                      } 
                      ?> 
                       <div class="messageBox">
                         <a onclick="return confirm('<?php echo getLang('Are_you_sure'); ?>');" href="<?php echo base_url().'profile/acceptRequest/2/'.$msg_user_id;?>"><i class="fa fa fa-window-close closeMessage"></i></a>
                         <a href="<?php echo  base_url().'profil/'.$t_friend['alias'];?>">
                            <div class="messageAvatar" >
									<img src="<?php if(!empty($t_friend) && $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'; }?>" alt="" srcset="<?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'; } ?> 1x, <?php if(!empty($t_friend['filename']) && file_exists(FCPATH.'assets/userfiles/'.$t_friend['path'].'/320/'.$t_friend['filename'].'.'.$t_friend['extension'])){ echo  base_url().'assets/userfiles/'.$t_friend['path'].'/320/'.$t_friend['filename'].'.'.$t_friend['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; } ?> 2x" >
								
								 </div>
                          </a>
                          <div class="messageContent">
                            <h4><?php echo $t_friend['username']; ?></h4>
                            <small><?php echo ucfirst($t_friend['accounttype']); ?>, <span><?php echo $t_friend['country_name']; ?></small>
                            <p class="action_private"><?php if($t_friend['privacy']==1){ echo '<i class="fa fa-eye"></i>'; } ?>   <?php if($t_friend['notcreated']>=time()-7*86400){ echo '<i class="fa fa-bell"></i>'; } ?></p>  
                          </div>
                          <a href="<?php echo base_url().'messages/'.base64_encode($msg_user_id);?>" class="btn_dark"><?php echo getLang('Send_Message'); ?></a>
                       </div>
                <?php  }
                      }
                    ?>  
                <?php if(!empty($from_friend)){ 
                    foreach ($from_friend as $f_friend) { 
                      if($f_friend['user_id_1']==$this->session->userdata('user_id')){ 
                        $msg_user_id = $f_friend['user_id_2']; 
                      } 
                      elseif($f_friend['user_id_2']==$this->session->userdata('user_id')) { 
                        $msg_user_id =  $f_friend['user_id_1']; 
                      } 
                      ?> 
                       <div class="messageBox">
                         <a onclick="return confirm('<?php echo getLang('Are_you_sure'); ?>');" href="<?php echo base_url().'profile/acceptRequest/2/'.$msg_user_id;?>"><i class="fa fa fa-window-close closeMessage"></i></a>
                         <a href="<?php echo  base_url().'profil/'.$f_friend['alias'];?>">
                           <div class="messageAvatar" >
									<img src="<?php if(!empty($f_friend) && $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'; }?>" alt="" srcset="<?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'; } ?> 1x, <?php if(!empty($f_friend['filename']) && file_exists(FCPATH.'assets/userfiles/'.$f_friend['path'].'/320/'.$f_friend['filename'].'.'.$f_friend['extension'])){ echo  base_url().'assets/userfiles/'.$f_friend['path'].'/320/'.$f_friend['filename'].'.'.$f_friend['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; } ?> 2x" >
								
								 </div>
                          </a>
                          <div class="messageContent">
                            <h4><?php echo $f_friend['username']; ?></h4>
                            <small><?php echo ucfirst($f_friend['accounttype']); ?>, <span><?php echo $f_friend['country_name']; ?></span></small>
                          </div>
                          <a href="<?php echo base_url().'messages/'.base64_encode($msg_user_id);?>" class="btn_dark"><?php echo getLang('Send_Message'); ?></a>
                       </div>
                <?php  }
                      }
                    ?> 
                <?php if(count($to_friend)==0 && count($from_friend)==0){ echo getLang('No_record_found'); }?>        
                <div class="contactpaginationouter"><?php echo $link; ?></div> 

               </div>
               <div class="contactRight">
                 <h3><span><?php echo getLang('New'); ?></span> <?php echo getLang('Friend_Request'); ?></h3>
                 <?php if(!empty($requsts)){ 
                    foreach ($requsts as $requst) {
						if($requst['username']!='')
						{
						?> 
                       <div class="frndrequest">
                         <a href="<?php if($requst['username']!=''){echo  base_url().'profil/'.$requst['alias'];} else { echo 'javascript:void(0)'; }?>">
                            <div class="mediumbgAvatar" >
									<img src="<?php if(!empty($requst) && $requst['filename']!='' && file_exists(FCPATH.'assets/userfiles/'.$requst['path'].'/80/'.$requst['filename'].'.'.$requst['extension'])){ echo base_url().'assets/userfiles/'.$requst['path'].'/80/'.$requst['filename'].'.'.$requst['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; }?>" alt="" srcset="<?php if(!empty($requst['filename']) && file_exists(FCPATH.'assets/userfiles/'.$requst['path'].'/80/'.$requst['filename'].'.'.$requst['extension'])){ echo  base_url().'assets/userfiles/'.$requst['path'].'/80/'.$requst['filename'].'.'.$requst['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; } ?> 1x, <?php if(!empty($requst['filename']) && file_exists(FCPATH.'assets/userfiles/'.$requst['path'].'/160/'.$requst['filename'].'.'.$requst['extension'])){ echo  base_url().'assets/userfiles/'.$requst['path'].'/160/'.$requst['filename'].'.'.$requst['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; } ?> 2x" >
								
								 </div>
                         </a>
                         <div class="frndrequestContent">
                            <h4><?php echo $requst['username']; ?></h4>
                            <small><?php echo ucfirst($requst['accounttype']); ?>, <span><?php echo $requst['country_name']; ?></small>
                            <a onclick="return confirm('<?php echo getLang('Are_you_sure'); ?>');" href="<?php echo base_url().'profile/acceptRequest/1/'.$requst['user_id'];?>" class="btn_dark"><?php echo getLang('Accept'); ?></a>
                            <a onclick="return confirm('<?php echo getLang('Are_you_sure'); ?>');" href="<?php echo base_url().'profile/acceptRequest/2/'.$requst['user_id'];?>" class="btn_dark"><?php echo getLang('Decline'); ?></a>
                          </div>
                       </div>
                  <?php  } }
                      }
                      else
                      {
                        echo getLang('No_record_found');
                      }
                    ?>      
                 <div class="visitorBox">
                   <h3><?php echo getLang('Visitors'); ?></h3>
            
                   <ul class="avatarList">
                    <?php if(!empty($visitors)){ 
                        foreach ($visitors as $visitor) { ?> 
                          <li>
                            <a href="<?php echo  base_url().'profil/'.$visitor['alias'];?>">
                               <div class="avatar" >
									<img src="<?php if(!empty($visitor) && $visitor['filename']!='' && file_exists(FCPATH.'assets/userfiles/'.$visitor['path'].'/80/'.$visitor['filename'].'.'.$visitor['extension'])){ echo base_url().'assets/userfiles/'.$visitor['path'].'/80/'.$visitor['filename'].'.'.$visitor['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; }?>" alt="" srcset="<?php if(!empty($visitor['filename']) && file_exists(FCPATH.'assets/userfiles/'.$visitor['path'].'/80/'.$visitor['filename'].'.'.$visitor['extension'])){ echo  base_url().'assets/userfiles/'.$visitor['path'].'/80/'.$visitor['filename'].'.'.$visitor['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; } ?> 1x, <?php if(!empty($visitor['filename']) && file_exists(FCPATH.'assets/userfiles/'.$visitor['path'].'/160/'.$visitor['filename'].'.'.$visitor['extension'])){ echo  base_url().'assets/userfiles/'.$visitor['path'].'/160/'.$visitor['filename'].'.'.$visitor['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; } ?> 2x" >
								
								 </div>
                            </a>
                          </li>
                    <?php  }
                      }
                      else
                      {
                        echo getLang('No_record_found');
                      }
                    ?>   
                    </ul>
                  </div>

                  <div class="visitorBox">
                   <h3><?php echo getLang('Visited'); ?></h3>
            
                   <ul class="avatarList">
                    <?php if(!empty($visited)){ 
                        foreach ($visited as $visit) { ?> 
                          <li>
                            <a href="<?php echo  base_url().'profil/'.$visit['alias'];?>">
                               <div class="avatar" >
									<img src="<?php if(!empty($visit) && $visit['filename']!='' && file_exists(FCPATH.'assets/userfiles/'.$visit['path'].'/80/'.$visit['filename'].'.'.$visit['extension'])){ echo base_url().'assets/userfiles/'.$visit['path'].'/80/'.$visit['filename'].'.'.$visit['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; }?>" alt="" srcset="<?php if(!empty($visit['filename']) && file_exists(FCPATH.'assets/userfiles/'.$visit['path'].'/80/'.$visit['filename'].'.'.$visit['extension'])){ echo  base_url().'assets/userfiles/'.$visit['path'].'/80/'.$visit['filename'].'.'.$visit['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; } ?> 1x, <?php if(!empty($visit['filename']) && file_exists(FCPATH.'assets/userfiles/'.$visit['path'].'/160/'.$visit['filename'].'.'.$visit['extension'])){ echo  base_url().'assets/userfiles/'.$visit['path'].'/160/'.$visit['filename'].'.'.$visit['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; } ?> 2x" >
								
								 </div>
                            </a>
                          </li>
                    <?php  }
                      }
                      else
                      {
                        echo getLang('No_record_found');
                      }
                    ?>   
                    </ul>
                  </div> 

                  <div class="visitorBox">
                   <h3><?php echo getLang('Recieved_Hotshots'); ?></h3>            
                     <ul class="avatarList">
                      <?php if(!empty($receive_hotshot)){ 
                          foreach ($receive_hotshot as $r_hotshot) { ?> 
                            <li>
                              <a href="<?php echo  base_url().'profil/'.$r_hotshot['alias'];?>">
                                <div class="avatar" >
									<img src="<?php if(!empty($r_hotshot) && $r_hotshot['filename']!='' && file_exists(FCPATH.'assets/userfiles/'.$r_hotshot['path'].'/80/'.$r_hotshot['filename'].'.'.$r_hotshot['extension'])){ echo base_url().'assets/userfiles/'.$r_hotshot['path'].'/80/'.$r_hotshot['filename'].'.'.$r_hotshot['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; }?>" alt="" srcset="<?php if(!empty($r_hotshot['filename']) && file_exists(FCPATH.'assets/userfiles/'.$r_hotshot['path'].'/80/'.$r_hotshot['filename'].'.'.$r_hotshot['extension'])){ echo  base_url().'assets/userfiles/'.$r_hotshot['path'].'/80/'.$r_hotshot['filename'].'.'.$r_hotshot['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; } ?> 1x, <?php if(!empty($r_hotshot['filename']) && file_exists(FCPATH.'assets/userfiles/'.$r_hotshot['path'].'/160/'.$r_hotshot['filename'].'.'.$r_hotshot['extension'])){ echo  base_url().'assets/userfiles/'.$r_hotshot['path'].'/160/'.$r_hotshot['filename'].'.'.$r_hotshot['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; } ?> 2x" >
								
								 </div>
                              </a>
                            </li>
                      <?php  }
                        }
                        else
                        {
                          echo getLang('No_record_found');
                        }
                      ?>   
                      </ul>
                    </div>
                      
                    <div class="visitorBox">
                      <h3><?php echo getLang('Given_Hotshots'); ?></h3> 
                      <ul class="avatarList">
                      <?php if(!empty($given_hotshot)){ 
                          foreach ($given_hotshot as $g_hotshot) { ?> 
                            <li>
                              <a href="<?php echo  base_url().'profil/'.$g_hotshot['alias'];?>">
								<div class="avatar" >
									<img src="<?php if(!empty($g_hotshot) && $g_hotshot['filename']!='' && file_exists(FCPATH.'assets/userfiles/'.$g_hotshot['path'].'/80/'.$g_hotshot['filename'].'.'.$g_hotshot['extension'])){ echo base_url().'assets/userfiles/'.$g_hotshot['path'].'/80/'.$g_hotshot['filename'].'.'.$g_hotshot['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; }?>" alt="" srcset="<?php if(!empty($g_hotshot['filename']) && file_exists(FCPATH.'assets/userfiles/'.$g_hotshot['path'].'/80/'.$g_hotshot['filename'].'.'.$g_hotshot['extension'])){ echo  base_url().'assets/userfiles/'.$g_hotshot['path'].'/80/'.$g_hotshot['filename'].'.'.$g_hotshot['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; } ?> 1x, <?php if(!empty($g_hotshot['filename']) && file_exists(FCPATH.'assets/userfiles/'.$g_hotshot['path'].'/160/'.$g_hotshot['filename'].'.'.$g_hotshot['extension'])){ echo  base_url().'assets/userfiles/'.$g_hotshot['path'].'/160/'.$g_hotshot['filename'].'.'.$g_hotshot['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; } ?> 2x" >
								
								 </div>
                              </a>
                            </li>
                      <?php  }
                        }
                        else
                        {
                          echo getLang('No_record_found');
                        }
                      ?>   
                      </ul>
                    </div> 


                    <div class="visitorBox">
                      
                      <h3><?php echo getLang('Private_Picture_Viewers'); ?>
                        <a href="<?php echo base_url().'private-picture-viewers' ?>">
                          <span class="manage_viewers"><?php echo getLang('Manage_all'); ?></span>
                        </a> 
                      </h3>

                      <ul class="avatarList">
                      <?php if(!empty($privacy_accepted_users)){ 
                          foreach ($privacy_accepted_users as $privacy_accepted_user) { 
                              if($privacy_accepted_user['alias']!=''){
                            ?> 
                            <li>
                              <a href="<?php echo  base_url().'profil/'.$privacy_accepted_user['alias'];?>">
                                <div class="avatar" >
                                  <img src="<?php if(!empty($privacy_accepted_user) && $privacy_accepted_user['filename']!='' && file_exists(FCPATH.'assets/userfiles/'.$privacy_accepted_user['path'].'/80/'.$privacy_accepted_user['filename'].'.'.$privacy_accepted_user['extension'])){ echo base_url().'assets/userfiles/'.$privacy_accepted_user['path'].'/80/'.$privacy_accepted_user['filename'].'.'.$privacy_accepted_user['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; }?>" alt="">
                                
                                 </div>
                              </a>
                            </li>
                      <?php  } }
                        }
                        else
                        {
                          echo getLang('No_record_found');
                        }
                      ?>   
                      </ul>
                  </div>

                  <div class="visitorBox">
                      
                      <h3><?php echo getLang('BLOCKED_USER_LIST'); ?>
                        <a href="<?php echo base_url().'blocked-user-list' ?>">
                          <span class="manage_viewers"><?php echo getLang('Manage_all'); ?></span>
                        </a> 
                      </h3>

                      <ul class="avatarList">
                      <?php if(!empty($blocked_user_list)){ 
                          foreach ($blocked_user_list as $blocked_user) { 
                              if($blocked_user['alias']!=''){
                            ?> 
                            <li>
                              <a href="<?php echo  base_url().'profil/'.$blocked_user['alias'];?>">
                                <div class="avatar" >
                                  <img src="<?php if(!empty($blocked_user) && $blocked_user['filename']!='' && file_exists(FCPATH.'assets/userfiles/'.$blocked_user['path'].'/80/'.$blocked_user['filename'].'.'.$blocked_user['extension'])){ echo base_url().'assets/userfiles/'.$blocked_user['path'].'/80/'.$blocked_user['filename'].'.'.$blocked_user['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; }?>" alt="">
                                
                                 </div>
                              </a>
                            </li>
                      <?php  } }
                        }
                        else
                        {
                          echo getLang('No_record_found');
                        }
                      ?>   
                      </ul>
                  </div>           

               </div>                  
             </div>
</section>