<?php $__env->startSection('content'); ?>
<?php $__env->startSection('sub_menu'); ?>
    <?php if ($types): ?>
        <div class="wrap-second-nav">
            <div class="second-nav" style="margin-bottom:0;">
                <a href="<?php echo URL::to('offerings'); ?>"<?php echo (!Input::get('type'))?' class="active"':''; ?>>ALL</a>
                <?php foreach ($types as $type): ?>
                <span><a href="<?php echo URL::to('offerings'); ?>?type=<?php echo $type->type_id; ?>"<?php echo (Input::get('type') == $type->type_id)?' class="active"':''; ?>><?php echo $type->type_name; ?></a></span>
                <?php endforeach; ?>
                <div class="pull-right">
                    <a href="<?php echo URL::to('offerings'); ?>">Tombstone view</a>
                    <span><a href="<?php echo URL::to('events'); ?>"  class="active">Event view</a></span>
                </div>
            </div>
        </div>
   <?php endif; ?>
<?php $__env->stopSection(); ?>
<div class="row">
    <div class="col-md-12">
        <div class="event-view">
            <p class="text-right">All times are according to Eastern Time, United States. </p>
            <?php if($events): ?>
            	<?php 
				$date = ''; 
				$i = 0;
				?>
            	<?php foreach($events as $event): ?>
                	<?php if($i == 0): ?>
                		<span class="mount"><?php echo mb_strtoupper(date('F', strtotime($event->starts_at))); ?></span>            
            				<ul>
                    <?php elseif(date('m', strtotime($event->starts_at)) !== $date): ?>
                        </ul>
                        <span class="mount"><?php echo mb_strtoupper(date('F', strtotime($event->starts_at))); ?></span>            
            			<ul>
                	<?php endif; ?>    
                <li <?php echo $event->starts_at == $event->ends_at?'class="without_grey_hover"':''; ?>>
                    <div><?php echo date('d', strtotime($event->starts_at)); ?></div>
                    <?php if($event->starts_at == $event->ends_at): ?>
                    <div><a href="<?php echo URL::to('offerings/'.$event->offering_id); ?>" ><?php echo $event->offer; ?></a> offering close</div>
                    <div><?php echo date('h:i a', strtotime($event->ends_at)); ?></div>
                    <?php else: ?>
                    <div><a href="<?php echo URL::to('offerings/'.$event->offering_id); ?>" ><?php echo $event->offer; ?></a> <?php echo $event->title; ?></div>
                    <div><?php echo date('h:i a', strtotime($event->starts_at)).' - '.date('h:i a', strtotime($event->ends_at)); ?></div>
                    <?php endif; ?>
                    
                    <div><a href="#modalForm-<?php echo $event->id; ?>" data-toggle="modal" class="btn register">Register</a></div>
                </li>
            		<?php $i++; $date = date('m', strtotime($event->starts_at)); ?>
                	
                    <?php if(4 == $i): ?>
                    	</ul>
           			<?php endif; ?>    
            	<?php endforeach; ?>
            <?php endif; ?>
        </div>
    </div>
</div>

 <?php echo $events->appends(array('type' => Input::get('type')))->links(); ?>

	<?php if($events): ?>
    	<?php foreach($events as $event): ?>
    <div class="modal modalForm" id="modalForm-<?php echo $event->id; ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
            <div class="gray_container webcast_register">
                <h4 class="head_h4"><?php echo $event->title; ?></h4>
                <?php echo $event->description; ?>
                <p><a href="<?php echo URL::to('events/view/'.$event->id); ?>" class="btn">REQUEST INVITATION</a></p>
            </div>
        </div><!-- /.modal-content -->
      </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
    	<?php endforeach; ?>
    <?php endif; ?>

    <div id="banqer" class="poisonous-green">
        <div class="inner">
            <a href="javascript:;" onclick="go_speak()" class="btn btn-learn">SPEAK WITH A BANQER</a>
            <div id="speak-body" style="display:none">
                <form method="post" id="speakForm" class="clearfix" autocomplete="off">
                    
                    <?php echo Form::text('fullname', null, array('id' => 'input-fullname', 'class' => 'form-control', 'required' => true, 'placeholder' => 'Full Name')); ?>
                    <?php echo Form::email('email', null, array('id' => 'input-email', 'class' => 'form-control', 'required' => true, 'placeholder' => 'Email Address')); ?>
                    <?php echo Form::text('phone', null, array('id' => 'input-phone', 'class' => 'form-control', 'required' => true, 'placeholder' => 'Phone Number')); ?>
                    <?php echo Form::textarea('message_body', null, array('id' => 'input-message', 'class' => 'form-control', 'required' => true, 'placeholder' => 'Message')); ?>
                    <?php echo Form::button('SEND', array('type' => 'submit' ,'class' => 'btn btn-blue pull-right')); ?>
                </form>
                <div class="contact">
                    You may also contact us directly at: <abbr title="Phone Number">+1 212 598 3322</abbr>
                </div>
            </div>
        </div>
    </div>
        
<?php $__env->stopSection(); ?>