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

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

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

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