<section class="content_wrapper home">   
   <video class="video-home" autoplay="" loop="" muted="">
      <source src="videos/event-video.mp4" type="video/mp4">
      <?php echo getLang('Your_browser_does_not_support_HTML5_video'); ?>.
   </video>
   
   <div class="ipad_background <?php if($this->session->userdata('user_id')){ echo 'login_case'; }?>">
    <div class="midContainer clearfix">
   <?php if(!$this->session->userdata('user_id')){ ?>
         <div class="transparent_box">
            <h1 style="display:none;">&nbsp;</h1>
            <p class="box_heading"><?php echo getLang('The_Worlds_Most_Exclusive'); ?><br> <?php echo getLang('Eyes_Wide_Shut_Parties_&_Community'); ?></p>
            <div class="latestuser_container">
               <div id="latestUsers" class="owl-carousel">
                  
                  <?php if(!empty($latestUsers)){ 
                           foreach ($latestUsers as $users) {
                           $zodiac_other = '';   
                           if($users['accounttype']=='lady')   
                           {
                              $zodiac = zodiac($users['dob_lady']);
                              if($zodiac=='')
                              {
                                 $zodiac = zodiac($users['dob_gentleman']);
                              }
                              $zodiac_other = '';  
                           }
                           elseif($users['accounttype']=='gentleman')   
                           {
                              $zodiac = zodiac($users['dob_gentleman']);
                              $zodiac_other = '';  
                           }
                           else  
                           {
                              $zodiac = zodiac($users['dob_lady']);
                              $zodiac_other = zodiac($users['dob_gentleman']);
                           }
                  ?>
                     <div class="item">
                        <a href="javascript:void(0)">
                           
                           <div class="recentAvatar">
   						<image src="<?php if(!empty($users['filename']) && file_exists(FCPATH.'assets/userfiles/'.$users['path'].'/80/'.$users['filename'].'.'.$users['extension'])){ echo  base_url().'assets/userfiles/'.$users['path'].'/80/'.$users['filename'].'.'.$users['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; } ?>" srcset="<?php if(!empty($users['filename']) && file_exists(FCPATH.'assets/userfiles/'.$users['path'].'/80/'.$users['filename'].'.'.$users['extension'])){ echo  base_url().'assets/userfiles/'.$users['path'].'/80/'.$users['filename'].'.'.$users['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; } ?> 1x, <?php if(!empty($users['filename']) && file_exists(FCPATH.'assets/userfiles/'.$users['path'].'/160/'.$users['filename'].'.'.$users['extension'])){ echo  base_url().'assets/userfiles/'.$users['path'].'/160/'.$users['filename'].'.'.$users['extension']; } else { echo base_url().'assets/images/default-avatar.jpg'; } ?> 2x"/>
   						</div>
   						
                           <div class="hover_content">
                              <span class="<?php echo $users['accounttype']; ?>"></span>
                              <span class="latest_username"><?php echo $users['username']; ?></span>
                              <br>
                              <span class="zodiac"><?php echo $zodiac; ?><?php if($zodiac_other!=''){ echo ' & '.$zodiac_other; }?></span>
                           </div>
                        </a>
                     </div>
                  <?php } } ?>   
                  
               </div>
            </div>
            <button type="button" class="btn_gold modal_popup" data-id="register"><?php echo getLang('Register'); ?></button>
            <div class="devider_gold"></div>
            <span class="home_testimonial">"<?php echo getLang('One_of_the_things_you_must_do_before_you_die'); ?>.." <br> - <?php echo getLang('DT_Magazine__Spain'); ?> - </span>
         </div>

           
          <?php if(!empty($adverts)){?>
           <div class="counter_slider">
              <div class="counterBox">
                 <div id="latestPartyevents" class="owl-carousel">
                    <?php foreach ($adverts as $key => $items) {
                      ?>
                     <div class="item">  
                        <h4><?php echo $items['title']; ?></h4>
                        <span class="subhead"><?php echo $items['sub_title']; ?></span>
                        <div class="count_container clearfix">
                        <?php if($items['image']!=''){?>
                        <a class="" target="_blank" href="<?php echo $items['link']; ?>">
                          <div class="latestpartyImage">
                             <img src="<?php echo $items['image']; ?>" alt="">
                          </div>
                        </a>
                        <?php } ?>  
                          <div class="countdowns">
                             <span class="info"><?php echo word_limiter($items['intro_text'], 22); ?></span><br>
                             <?php if($items['type']==1 && strtotime($items['date']) > time()){ ?>
                               <div id="example<?php echo $key+1; ?>" class="counter" data-countdown="<?php echo date('Y/m/d',strtotime($items['date'])); ?>">
                                </div>
                                <?php } ?>
                          </div>

                          
                        </div>
                     </div>
                    <?php } ?>
                  </div>
                </div>
              </div>
              <?php } ?>

    <?php } ?>          
              <!--video thumb mobile-->
              <div class="videothumbs_ipad clearfix"> 
                 <!--<h6><?php //echo getLang('Video_Trailer'); ?></h6>-->
                   <div class="videoslider">
                   <div id="videoslider" class="owl-carousel">
                   
                      <div class="item">
                        <h5>Where Dreams and Fantasies can come true</h5>
                        <iframe id="iFrame1" src="https://player.vimeo.com/video/131144914" frameborder="0" width="100%" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe>
                        <!-- <a href="https://player.vimeo.com/video/131144914" target="_blank"><img src="<?php echo base_url('assets/images/vidprevimage01.png')?>" alt=""></a> -->
                      </div>

                      <div class="item">
                        <h5>The Team of Castleevents</h5>
                        <iframe src="https://player.vimeo.com/video/131144426" frameborder="0" width="100%" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe>
                        <!-- <a href="https://player.vimeo.com/video/131144426" target="_blank"><img src="<?php echo base_url('assets/images/vidprevimage02.png')?>" alt=""></a> -->
                      </div>

                      <div class="item">
                        <h5>Insights a real Castleevents party</h5>
                        <iframe src="https://player.vimeo.com/video/130970363" frameborder="0" width="100%" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe>
                        <!-- <a href="https://player.vimeo.com/video/130970363" target="_blank"><img src="<?php echo base_url('assets/images/vidprevimage03.png')?>" alt=""></a> -->
                      </div>


                   </div>
                 </div>            
             </div>
              <!--video thumb mobile-->
            
        </div>
    </div>
    <?php if(!$this->session->userdata('user_id')){ ?>  
    <!--Party Mobile -->
    <div class="partyMobileOuter">
      <?php if(!empty($upcomingEvents)){ 
               foreach ($upcomingEvents as $upcoming) {
               $file=getFiles($upcoming['file_id']);
                if(file_exists(FCPATH."assets/userfiles/".$file['path'].'/250/'.$file['filename'].'.'.$file['extension']))
               {
                  $filename = "userfiles/".$file['path'].'/500/'.$file['filename'].'.'.$file['extension'];
               }
               else
               {
                  $filename = "userfiles/".$file['path'].'/500/'.$file['filename'].'.'.$file['extension'];
               }
                                   
      ?>
      <?php 
      $postponed = 0;
       $url = base_url().'parties/'.$upcoming['alias'];
       $btn = getLang('Book_Now');
       $btnClass = 'fafaf';
       if(isset($upcoming['is_postponed'])){ 
          if($upcoming['is_postponed'] == 1){
             $postponed = 1;
             $url = 'javascript:void(0)';
             $btn = getLang('postponed');
             $btnClass = 'reviewBtn';
          }
       }
       ?>
      <a href="<?php echo $url; ?>">
        <div style="" class="partyMobile clearfix">
          <img src="<?php echo base_url().'assets/'.$filename; ?>" alt="" srcset="<?php if(file_exists(FCPATH."assets/userfiles/".$file['path'].'/500/'.$file['filename'].'.'.$file['extension'])){
                   echo  base_url().'assets/userfiles/'.$file['path'].'/500/'.$file['filename'].'.'.$file['extension']; }  ?> 1x, <?php if(file_exists(FCPATH."assets/userfiles/".$file['path'].'/750/'.$file['filename'].'.'.$file['extension'])){
                   echo  base_url().'assets/userfiles/'.$file['path'].'/750/'.$file['filename'].'.'.$file['extension']; }  ?> 2x" alt="">
           <div class="mobpartycontent">
              <h4><?php echo $upcoming['title']; ?></h4>
              <span class="date"><?php echo date('d, M Y',$upcoming['time_from']); ?></span>
              <span class="location"><?php echo eventDetails($upcoming['id']); ?></span>
              <div class="btnarea">
              	<?php if($upcoming['discount']){ ?>
                 	<span class="discount"><?php echo $upcoming['discount']; ?>% Discount</span>
               	<?php } ?> 
                 <?php if($upcoming['is_sold']==0){ ?>
                    <button class="<?php echo $btnClass; ?>" ><?php echo $btn; ?></button>
                 <?php } else{ ?>
                    <button class="fafaf" ><?php echo getLang('Sold_Out'); ?></button>
                 <?php } ?>
              </div>
           </div>
        </div>
      </a>   
      <?php } } ?> 
      <?php if(!empty($lastEvents)){ 
         for($i=0;$i<(count($lastEvents)-count($upcomingEvents));$i++) {
         $files=getFiles($lastEvents[$i]['file_id']);
         if(file_exists(FCPATH."assets/userfiles/".$files['path'].'/250/'.$files['filename'].'.'.$files['extension']))
         {
            $filenames = "userfiles/".$files['path'].'/250/'.$files['filename'].'.'.$files['extension'];
         }
         else
         {
            $filenames = "userfiles/".$files['path'].'/250/'.$files['filename'].'.'.$files['extension'];
         }
        ?>
        <?php 
        $postponed = 0;
        $url = base_url().'reviews/'.$lastEvents[$i]['alias'];
        $btn = getLang('Review');
        if(isset($lastEvents[$i]['is_postponed'])){ 
           if($lastEvents[$i]['is_postponed'] == 1){
              $postponed = 1;
              $url = 'javascript:void(0)';
              $btn = getLang('postponed');
           }
        }
        ?>
        <a href="<?php echo $url; ?>">
          <div style="" class="partyMobile clearfix">
            <img src="<?php echo base_url().'assets/'.$filenames; ?>" alt="" srcset="<?php if(file_exists(FCPATH."assets/userfiles/".$files['path'].'/500/'.$files['filename'].'.'.$files['extension'])){
                   echo  base_url().'assets/userfiles/'.$files['path'].'/500/'.$files['filename'].'.'.$files['extension']; }  ?> 1x, <?php if(file_exists(FCPATH."assets/userfiles/".$files['path'].'/750/'.$files['filename'].'.'.$files['extension'])){
                   echo  base_url().'assets/userfiles/'.$files['path'].'/750/'.$files['filename'].'.'.$files['extension']; }  ?> 2x" alt="">
           <div class="mobpartycontent">
              <h4><?php echo $lastEvents[$i]['title']; ?></h4>
              <span class="date"><?php echo date('d, M Y',$lastEvents[$i]['time_from']); ?></span>
              <span class="location"><?php echo eventDetails($lastEvents[$i]['id']); ?></span>
              <div class="btnarea">
                <?php if($lastEvents[$i]['discount']){ ?>
                  <span class="discount"><?php echo $lastEvents[$i]['discount']; ?>% Discount</span>
                <?php } ?> 
                 <button class="reviewBtn" ><?php echo $btn; ?></button> 
              </div>
           </div>
        </div>
      </a> 
      <?php } } ?> 
    </div>
    <!--Party Mobile -->

    <!--Advert Mobile -->
    <?php if(!empty($adverts)){?>
    <div class="advertMobileOuter">
      <?php foreach ($adverts as $key => $items) { ?>
      <a class="" target="_blank" href="<?php echo $items['link']; ?>">
        <div class="advertMobile">
          <h4><?php echo $items['title']; ?></h4>
          <?php if($items['image']!=''){?>
            <img src="<?php echo str_replace('160', '500', $items['image']); ?>" alt="">
          <?php } ?>
          <p><span><?php echo $items['sub_title']; ?></span><?php echo $items['intro_text']; ?></p>
        </div>
      </a>  
      <?php } ?>  
    </div>
    <?php } ?>
    <!--Advert Mobile -->


   <?php } ?>
   

</section>
<footer>       
   <?php if(!empty($mediaLogos)){ 
   
         $i=1;
         foreach ($mediaLogos as $key=>$preview) {
          if($preview['logo_path']!=''){
            if($preview['blog_id']!=11){
       $explode_path = explode('.',$preview['path']);
             $image_name = $explode_path[0].'_thumb.'.$explode_path[1];
   ?>
     <span id="<?php echo $i; ?>" class="foter_hoverimg"> <h6><?php echo $preview['blog_title']; ?></h6><img src="<?php echo base_url().'assets/userfiles/blog_articles/350_thumb/'.$image_name; ?>" alt="" srcset="<?php echo base_url().'assets/userfiles/blog_articles/350_thumb/'.$image_name;  ?> 1x"></span>
     
   <?php } } $i++; } } ?>
   <h6><?php echo getLang('Know_From'); ?></h6>
   <div id="footerLogos" class="owl-carousel">
   <?php if(!empty($mediaLogos)){ 
         $i=1;
         foreach ($mediaLogos as $logos) {
          if($logos['logo_path']!=''){ 
           if($logos['blog_id']!=11){
   ?>
     <div class="item"><a class="fthover" href="<?php echo base_url().'news-details/'.$logos['blog_slug']; ?>" id="<?php echo $i; ?>" href="javascript:void(0)"><img src="<?php echo base_url().'assets/userfiles/img/media/'.$logos['logo_path']; ?>" alt=""></a> <h6><?php echo $logos['blog_title']; ?></h6></div>
   <?php } } $i++; } } ?>
   </div>

   <ul class="footerLinks">
      <li><a href="<?php echo base_url().'terms'; ?>"><?php echo getLang('Imprint_Terms'); ?></a></li>
      <li><a href="<?php echo base_url().'privacypolicy'; ?>"><?php echo getLang('Privat_Policy'); ?></a></li>
      <li><a href="<?php echo base_url().'job'; ?>"><?php echo getLang('Jobs'); ?></a></li>
      <li><a href="<?php echo base_url().'sitemaps'; ?>"><?php echo getLang('Sitemap'); ?></a></li>
   </ul>
</footer>           
