<?php $__env->startSection("content"); ?>
<div>
	<ol class="breadcrumb">
	  <li><a href="<?php echo e(URL::route('user.home')); ?>"><?php echo trans('messages.home'); ?></a></li>
	 
	  <li class="active"><?php echo Lang::choice('messages.equipment-breakdown',2); ?></li>
	</ol>
</div>
<?php if(Session::has('message')): ?>
	<div class="alert alert-info"><?php echo trans(Session::get('message')); ?></div>
<?php endif; ?>
<div class="panel panel-default">
	<div class="panel-heading ">
		<span class="ion-gear-a"></span>
		<?php echo trans('messages.equipment-breakdown'); ?>

		<div class="panel-btn">

			<a href="<?php echo URL::route("equipmentbreakdown.create"); ?>" class="btn btn-sm btn-info">
                                <span class="glyphicon glyphicon-plus-sign"></span>
                                <?php echo trans('messages.add'); ?>

                            </a>
			
		</div>
	</div>


	<div class="panel-body">
	<div class="table-responsive">
  	<table class="table table-striped search-table small-font">
			<thead>
				<tr>
					<th class="col-sm-1">Date</th>
					<th class="col-sm-1">Name</th>
					<th class="col-sm-2">Description</th>
					<th class="col-sm-2">Actions taken</th>
					<th class="col-sm-1">HSD request</th>
					<th class="col-sm-1">In charge</th>
					<th class="col-sm-1">Rank of importance</th>					
					<th class="col-sm-1">Report date</th>											
					<th class="col-sm-1">Restore date</th>											
					<th class="col-sm-1">Restored by</th>

				</tr>
			</thead>			
			<tbody>
			
			<?php foreach($items as $item): ?>
				<tr>
				<td  class="col-sm-1">  <?php echo date('d M Y', strtotime($item->created_at)); ?></td>
				<td  class="col-sm-1">  <?php echo $item->equipment->name; ?></td>
				<td  class="col-sm-2">  <?php echo $item->description; ?></td>
				<td  class="col-sm-2">  <?php echo $item->action_taken; ?></td>
				<td class="col-sm-1">  <?php echo $item->hsd_request; ?></td>
				<td class="col-sm-1">  <?php echo $item->staff($item->in_charge_id); ?></td>
				<td class="col-sm-1">  <?php echo ($item->priority==1?'High':($item->priority==2?'Moderate':'Low')); ?></td>
				<td class="col-sm-1">   <?php echo $item->report_date!=null?(date('d M Y', strtotime($item->report_date))):''; ?></td>
				<td class="col-sm-1">   <?php echo $item->restore_date!=null?(date('d M Y', strtotime($item->restore_date))):''; ?></td>
				<td class="col-sm-1">  <?php echo $item->restored_by!=null?($item->staff($item->restored_by)) :""; ?></td>
				<td>
				<?php if($item->restore_date==null): ?>  	
					<a class="btn btn-sm btn-info" href="<?php echo URL::route('equipmentbreakdown.restore', array($item->id)); ?>" >
							<span class="glyphicon glyphicon-edit"></span>
							
					</a>
				<?php endif; ?>
                </td>
			<?php endforeach; ?>
						
				</tr>
	
			</tbody>
  </table>
</div>

		<?php Session::put('SOURCE_URL', URL::full());?>
	</div>
	
</div>


<?php $__env->stopSection(); ?>
<?php echo $__env->make("layout", array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>