<?php
include(dirname(__FILE__) . '/../header.php');
?>
<h2>部屋タイプ一覧</h2>

<?php if(is_array($roomtypes)) : ?>
<table class="list">
<th>id</th><th>name</th><th>期間</th><th>デフォルト数</th><th>受入人数</th><th>actions</th>
<?php foreach ($roomtypes as $roomtype): ?>
<tr>
<td><?php echo $roomtype['roomtypeid'] ?></td>
<td><?php echo $roomtype['roomtype_name'] ?></td>
<td><?php echo substr($roomtype['start_date'], 0, 10) . '～' . substr($roomtype['end_date'], 0, 10) ?></td>
<td><?php echo $roomtype['default_num'] ?></td>
<td><?php echo $roomtype['guest_min'] . '～' . $roomtype['guest_max'] ?></td>
<td>
<?php
echo '<a href="' . site_url('admin/roomtypes/edit/'. $roomtype['roomtypeid']) . '">編集</a> | ';
echo '<a href="' . site_url('admin/roomtypes/delete/'. $roomtype['roomtypeid']) . '">削除</a>';
?>
</td></tr>

<?php endforeach;?>
</table>
<?php endif;?>
<?php
echo '<a href="' . site_url('admin/roomtypes/add/') . '">部屋タイプの新規追加</a>';
?>
<?php
include(dirname(__FILE__) . '/../footer.php');
?>
