view.php
1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<h1><?=$flight->acid?></h1>
<?php
if (isset($error)) { ?>
<p class="bg-danger realops-message">Error: <?=$error?></p>
<?php
}
if (isset($success)) { ?>
<p class="bg-success realops-message"><?=$success?></p>
<?php
} ?>
<table class="table" id="realops-flight-view">
<tbody>
<tr>
<td colspan="2"><strong>Aircraft type:</strong> <?=$flight->type?></td>
</tr>
<tr>
<td><strong>Departing</strong><br />
<?=$flight->adep?><br />
<?=date('H:i', strtotime($flight->std))?> UTC
</td>
<td><strong>Arriving</strong><br />
<?=$flight->ades?><br />
<?=date('H:i', strtotime($flight->sta))?> UTC
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="2"><strong>Route: </strong><?=$flight->route?></td>
</tr>
<tr>
<td colspan="2"><strong>Information:</strong> <?=$flight->info?></td>
</tr>
</tfoot>
</table>
<div class="form-group">
<?php
if ($flight->user) {
if (Auth::check() && $flight->user->id == Auth::user()->id) { ?>
<form role="form" method="POST">
<input type="hidden" name="_method" value="DELETE" />
<p><button class="btn btn-danger">Cancel this booking</button></p>
</form>
<?php
} else { ?>
<p>This flight has been booked by <strong><?=$flight->user->name?></strong></p>
<?php
}
} else {
if (Auth::check()) { ?>
<form role="form" method="POST">
<p><button class="btn btn-primary">Book this flight</button></p>
</form>
<?php
} else { ?>
<p><a href="<?=Route::link('login')?>?return_url=<?=util::current_url_enc()?>" data-toggle="modal" data-target="#realops-login-info" class="btn btn-primary">Login to book this flight</a></p>
<?php
}
} ?>
</div>