<?php $__env->startSection('content'); ?>	
	<h2>Brokerage Companies</h2>
	<div class="buttons">
		<a href="<?php echo URL::route('admin.rental-brokerages.create'); ?>" class="btn btn-primary"><i class="glyphicon glyphicon-plus"></i> Add a new Brokerage</a>
	</div>
		
	<table class="table table-bordered table-striped">
		<thead>
			<tr>
				<th class="text-center">ID</th>
				<th class="col-lg-3">Company name</th>
				<th class="text-center"># Brokers</th>
				<th class="text-center"># Listings</th>
				<th class="text-center">Created</th>
				<th class="text-center" colspan="2">Actions</th>
			</tr>
		</thead>
		<tbody>
		<?php if($brokerages): ?>
			<?php foreach($brokerages as $brokerage): ?>
			<tr>
				<td class="text-center"><?php echo $brokerage->brokerage_id; ?></td>
				<td><?php echo $brokerage->name; ?></td>		
				<td class="text-center"><?php echo $brokerage->brokers()->count(); ?></td>	
				<td class="text-center"></td>				
				<td class="text-center"><?php echo date('m/d/y H:i',strtotime($brokerage->created_at)); ?></td>
				<td class="text-center"><a href="<?php echo URL::route('admin.rental-brokerages.edit', $brokerage->brokerage_id); ?>" class="btn btn-link" title="Edit">Edit</a></td>
				<td class="text-center">
					<?php echo Form::open(array('route' => array('admin.rental-brokerages.destroy', $brokerage->brokerage_id), 'method' => 'DELETE')); ?>
					<button type="submit" onclick="return confirm('Are you sure?')" class="btn btn-link" title="Delete">Delete</button>
					<?php echo Form::close(); ?>
				</td>
			</tr>
			<?php endforeach; ?>
		<?php else: ?>
			<tr>
				<td colspan="6">No brokerages yet.</td>
			</tr>
		<?php endif; ?>
		</tbody>
	</table>
	
	<div class="pagination"><?php echo $brokerages->links(); ?></div>

<?php $__env->stopSection(); ?>