<div class="col-sm-12">

	<?= $model->route ?>
</div>
<div class="col-sm-12">
	<span class="btn btn-primary" id="deviation" data-url="routedeviation?id=<?= $model->id ?>">Deviation</span>
</div>

<?php if ($model->routedeviations) { ?>
	<div class="row">
			<div class="col-sm-6 DarkerBlue">Comment/Reason</div>
			<div class="col-sm-6 DarkerBlue">Route Taken</div>
		</div>
	<?php foreach ($model->routedeviations as $key => $deviation) { ?>
		<div class="row">
			<div class="col-sm-6"><?= $deviation->comments ?></div>
			<div class="col-sm-6"><?= $deviation->routetaken ?></div>
		</div>
	<?php } ?>
<?php } ?>

<script>
$(function() {	
	$('#deviation').on('click', function() {
		$('#LGmodal .modal-body').load($(this).data('url'));
		$('#LGmodal').modal();
	})
})

</script>
