<?php $__env->startSection('content'); ?>

	<p class="head_inner_nav">
        <a href="<?php echo URL::to('admin/offerings'); ?>">Offerings</a><span>></span> Events
    </p> 
    
	<div class="row">
		<div class="col-xs-6">
			<h2>"<?php echo $offering->name; ?>" Offering - Events</h2>
		</div>
		<div class="col-xs-6">
			<div class="buttons" id="right-buttons">
				<a href="<?php echo URL::to('admin/offerings/'.$offering->offering_id.'/event/create'); ?>" class="btn btn-primary"><i class="glyphicon glyphicon-plus"></i> Add a new Event</a>
			</div>
		</div>
	</div>
	
	<table class="table table-bordered table-striped">
		<thead>
			<tr>
				<th class="text-center">ID</th>
				<th class="col-md-4">Title</th>
				<th class="text-center">Start date</th>
				<th class="text-center">End Date</th>
				<th class="text-center" colspan="3">Actions</th>
			</tr>
		</thead>
		<tbody>
		<?php if($events): ?>
			<?php foreach($events as $event): ?>
			<tr>
				<td class="text-center"><?php echo $event->event_id; ?></td>
				<td><?php echo $event->title; ?></td>
				<td><?php echo date('M d, Y, g:ia',strtotime($event->starts_at)); ?></td>
				<td class="text-center"><?php echo date('M d, Y, g:ia',strtotime($event->ends_at)); ?></td>
                <td align="center"><a href="<?php echo URL::to('admin/offerings/'.$offering->offering_id.'/event/'.$event->event_id.'/faq'); ?>" title="FAQ"><i class="glyphicon glyphicon-question-sign"></i></a></td>
				<td align="center"><a href="<?php echo URL::to('admin/offerings/'.$offering->offering_id.'/event/'.$event->event_id.'/edit'); ?>" title="Edit"><i class="glyphicon glyphicon-pencil"></i></a></td>
				<td align="center">
					<?php echo Form::open(array('route' => array('admin.offerings.'.$event->offering_id.'.event.destroy', $event->event_id), 'method' => 'DELETE')); ?>
					<button type="submit" onclick="return confirm('Are you sure?')" class="btn btn-link"  title="Delete"><i class="glyphicon glyphicon-trash"></i></button>
					<?php echo Form::close(); ?>
				</td>
			</tr>
			<?php endforeach; ?>
		<?php else: ?>
			<tr>
				<td colspan="6">No events yet.</td>
			</tr>
		<?php endif; ?>
		</tbody>
	</table>
    
     <?php echo $events->appends(array('query' => Input::get('query')))->links(); ?>
	
<?php $__env->stopSection(); ?>