<?php
include(dirname(__FILE__) . '/../header.php');
?>
<h2>予約一覧</h2>

<?php if(is_array($ress)) : ?>
<table class="list">
<th>id</th><th>予約日時</th><th>ユーザ</th><th>期間</th><th>プラン</th><th>人数</th><th>部屋数</th><th>料金</th><th>status</th><th>actions</th>
<?php foreach ($ress as $res): ?>
<tr>
<td><?php echo $res['resid'] ?></td>
<td><?php echo substr($res['created'], 0, 16) ?></td>
<td><?php echo $res['name'] ?></td>
<td><?php echo $res['cin'] . '～' . $res['cout'] ?></td>
<td><?php echo $res['plan_name'] ?></td>
<td><?php echo $res['basic_num']; ?></td>
<td><?php echo $res['room_num'] ?></td>
<td><?php echo number_format($res['total_price']) . '円'; ?></td>
<td>
<?php
switch ($res['status'])
{
    case 1:
        echo "仮予約";
        break;
    case 2:
        echo "本予約";
        break;
    case 0:
        echo "キャンセル";
        break;
}
//echo $res['status'];
?></td>
<td>
<?php
echo '<a href="' . site_url('admin/res/detail/' . $res['resid']) . '">詳細</a>';
?>
</td></tr>

<?php endforeach;?>
</table>
<?php endif;?>

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