<?php
include(dirname(__FILE__) . '/../header.php');
?>
<h2>オプション一覧</h2>

<?php if(is_array($options)) : ?>
<table class="list">
<th>id</th><th>name</th><th>料金(円)</th><th>デフォルト数</th><th>最大数</th><th>actions</th>
<?php foreach ($options as $option): ?>
<tr>
<td><?php echo $option['optionid'] ?></td>
<td>
<?php echo $option['option_name'] ?><br />
<?php echo substr($option['start_date'], 0, 10) . '～' . substr($option['end_date'], 0, 10) ?>
</td>
<td><?php echo number_format($option['price']) ?></td>
<td><?php echo $option['default_num'] ?></td>
<td><?php echo $option['max_num'] ?></td>
<td>
<?php
echo '<a href="' . site_url('admin/options/edit/'. $hotelid . '/' . $option['optionid']) . '">編集</a> | ';
echo '<a href="' . site_url('admin/options/delete/'. $hotelid . '/' . $option['optionid']) . '">削除</a> | ';
echo '<a href="' . site_url('admin/vacantoptions/index/'. $hotelid . '/' . $option['optionid']) . '">空き編集</a>';
?>
</td></tr>

<?php endforeach;?>
</table>
<?php endif;?>
<?php
echo '<a href="' . site_url('admin/options/add/' . $hotelid) . '">オプションの新規追加</a>';
?>

<?php
include(dirname(__FILE__) . '/../footer.php');
?>
