<?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>料金</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/planprice/set/' . $plan['planid']) . '">price</a>';
?>
<td>
<?php
echo '<a href="' . site_url('admin/plans/edit/'. $plan['planid']) . '">edit</a> | ';
echo '<a href="' . site_url('admin/plans/delete/'. $plan['planid']) . '">delete</a>';
?>
</td></tr>

<?php endforeach;?>
</table>
<?php endif;?>
<?php
echo '<a href="' . site_url('admin/plans/add/') . '">add plan</a>';
?>

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