<?php

/** @var \SquirrelsInventory\Controller $this */
$id = is_numeric($this->data) ? abs(round($this->data)) : 0;
$auto = new \SquirrelsInventory\Auto($id);
?>

<?php 
if ($auto->getId() == 0 || $auto->getId() === NULL) {
    ?>

	<p>
		The inventory you are looking for is no longer available.
		Please check back later.
	</p>

<?php 
} else {
    ?>

	<div class="squirrels squirrels-auto">

		<div class="row">
			<div class="col-md-12">

				<h3 class="squirrels-title">
					<?php 
    echo $auto->getYear() > 0 ? $auto->getYear() : '';
    ?>
					<?php 
    echo $auto->getMake()->getTitle();
				});
			<?php 
    }
    ?>

		</script>

		<p><em>(Hint: The "add" button is at the top!)</em></p>

	<?php 
} elseif ($action == 'edit') {
    ?>

		<?php 
    $id = isset($_GET['id']) && is_numeric($_GET['id']) ? abs(round($_GET['id'])) : 0;
    $auto = new \SquirrelsInventory\Auto($id);
    ?>

		<h1>
			<?php 
    echo __('Edit Inventory', 'squirrels_inventory');
    ?>
			<a href="?page=<?php 
    echo $_REQUEST['page'];
    ?>
" class="page-title-action">
				<?php 
    echo __('Cancel', 'squirrels_inventory');
    ?>
			</a>
			<?php