
<!-- NOTAMS Header -->
<div class="content-header">
    <div class="header-section">
        <h1><i class="gi gi-envelope"></i> <Strong>NOTAMs</Strong><br><small>Crew Control Division | <?php echo SITE_NAME?> &copy; <?php echo date("Y");?></small></h1>
    </div>
</div>
<!-- END NOTAMS Header -->
<?php
if(!$notams) {
	echo "<div class='alert alert-danger'><strong>Oops</strong>There are no NOTAMs. You can resume flight ops normally</div>";
	return;
}
?>


<div class="row">
	<div class="col-md-12">
		<div class="block">
			<div class="block-title">
				<h3><strong>NOTAM</strong> Box</h3>
			</div>
			<script src="<?php echo SITE_URL; ?>/lib/skins/iCrew/js/pages/tablesDatatables.js"></script>
          <script>$(function(){ TablesDatatables.init(); });</script>
			<table  id="example" class="table table-bordered table-striped table-hover"style="width:100%" >
				<thead>
					 <th>Code</th>
                     <th>Title</th>
                     <th>Validity</th>
                     <th>Status</th>
                     <th>View</th>
                     
				</thead>
				<tbody>
				<?php
                     foreach($notams as $notam) {
                     	
                     	
                     ?>
                  <tr>
                     <td><code><?php echo $notam->code; ?></code></td>
                     <td><?php echo $notam->title; ?><br><span class="label label-info"><?php echo NotamsData::getSeries($notam->series); ?></span></td>
                     <td><?php echo date(DATE_FORMAT, strtotime($notam->valid_from)); ?> - <?php echo date(DATE_FORMAT, strtotime($notam->valid_till)); ?></td>
                     
                     <td><?php if(NotamsData::readStatus($notam->id, Auth::$userinfo->pilotid)) echo "<span class='label label-success'>Read</span>"; else echo "<span class='label label-danger'>Unread</span>"; ?></td>
                     
                   
                     <td>
                        <a href="<?php echo url('notams/view/'.$notam->id); ?>" style="text-decoration: none;" class="btn btn-warning btn-sm">View</a>
                     </td>
                     
                   
                  </tr>
                  <?php
                     }
                     ?>
				</tbody>
			</table>
		</div>
	</div>
</div>

 <script>
    $(document).ready(function() {
    $('#example').DataTable();
} );
</script>
