<section id="profile" class="content_wrapper innerPage clearfix">

            <div class="contactWraper container">
              <h1 class=" noborder evnttitle"><?php echo getLang('All_Eyes_Wide_Shut_Parties'); ?></h1>
              <h2 class=" noborder evnttitle"><?php echo getLang('Future_Parties'); ?></h2>
              <?php 
                if(!empty($allParties)){ 
                  foreach ($allParties as $value) { 
              ?>
                      <div class="eventBox">
                        <div class="eventimg" style="background:url(<?php if(!empty($value['filename']) && file_exists(FCPATH.'assets/userfiles/'.$value['path'].'/'.$value['filename'].'.'.$value['extension'])){ echo base_url().'assets/userfiles/'.$value['path'].'/'.$value['filename'].'.'.$value['extension']; } else { echo base_url().'assets/images/casinoroyale_onsite.jpg'; }?>) no-repeat center center / cover ;">
						                <?php 
                            $postponed = 0;
                            $url = base_url().'parties/'.$value['alias'];
                            $btn = getLang('Book_Now');
                            $btnClass = '';
                            if(isset($value['is_postponed'])){ 
                               if($value['is_postponed'] == 1){
                                  $postponed = 1;
                                  $url = 'javascript:void(0)';
                                  $btn = getLang('postponed');
                                  $btnClass = 'style="background-color: #615f67"';
                               }
                            }
                            ?>
                            <a href="<?php echo  $url;?>">
                            <div class="eventContent">
                              <h2 class="allpartyhead"><?php echo strtoupper($value['title']); ?></h2>
                              <h3><?php echo date('d, M Y',$value['time_from']); ?></h3>
                              <?php if($value['is_sold']==1){ ?>
                                <h4><span style="color:red"><?php echo getLang('This_party_is_already_sold_out'); ?></span></h4>
                              <?php } ?>
                              <p><?php echo word_limiter(strip_tags(html_entity_decode($value['description'])), 35); ?></p>
                              
                              <div class="allparties_actions">
                                <?php 
                                  $upcomingdiscount = 0;
                                  if($value['discount_end_date'])
                                  {
                                     if($value['discount_end_date'] >= date('Y-m-d'))
                                     {
                                       $upcomingdiscount = $value['discount']; 
                                     }
                                  }
                                  else
                                  {
                                     $upcomingdiscount = $value['discount']; 
                                  }
                                  if($upcomingdiscount){ ?>
                                    <span><?php echo getLang('Now'); ?> <?php echo $value['discount']; ?>% <?php echo getLang('Discount'); ?></span>
                                    <?php if($value['discount_end_date']){ ?><span class="validDate"><?php echo getLang('Early_bird_price'); ?> <?php //echo date('d M Y',strtotime($value['discount_end_date'])); ?></span><?php } ?>
                                <?php } ?>   
                                  <p>
                                      <button type="button" class="allparties_bookbtn" <?php echo $btnClass; ?>><?php echo $btn; ?></button>    
                                  </p>
                              </div>
                            </div>
                            </a>
                        </div>
                      </div>   
              <?php 
                  }
                }  
              ?>
              <h2 class=" noborder evnttitle"><?php echo getLang('Past_Parties'); ?></h2>
              <?php 
                if(!empty($allPastParties)){ 
                  foreach ($allPastParties as $values) { 
              ?>
                      <div class="eventBox">
                        <div class="eventimg">
							            <div class="eventimg" style="background:url(<?php if(!empty($values['filename']) && file_exists(FCPATH.'assets/userfiles/'.$values['path'].'/'.$values['filename'].'.'.$values['extension'])){ echo base_url().'assets/userfiles/'.$values['path'].'/'.$values['filename'].'.'.$values['extension']; } else { echo base_url().'assets/images/casinoroyale_onsite.jpg'; }?>) no-repeat center center / cover ;">
                          <?php 
                            $postponed = 0;
                            $url = base_url().'parties/'.$values['alias'];
                            $btn = 'Review';
                            $btnClass = 'bookpartybtn';
                            if(isset($values['is_postponed'])){ 
                               if($values['is_postponed'] == 1){
                                  $postponed = 1;
                                  $url = 'javascript:void(0)';
                                  $btn = getLang('postponed');
                                  $btnClass = 'reviewBtn';
                               }
                            }
                            ?>
                            <a href="<?php echo $url;?>">
                            <div class="eventContent">
                              <h2 class="allpartyhead"><?php echo strtoupper($values['title']); ?></h2>
                              <h3><?php echo date('d, M Y',$values['time_from']); ?></h3>
                              <p><?php echo word_limiter(strip_tags(html_entity_decode($values['description'])), 35); ?></p>
                              <div class="allparties_actions">
                                <p>
                                      <button type="button" class="allparties_bookbtn" style="background-color: #615f67"><?php echo $btn; ?></button>    
                                  </p>
                              </div>
                            </div>
                            </a>
                        </div>
                      </div> 
                      </div>   
              <?php 
                  }
                }  
              ?>
            </div>
</section>