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

<?php echo $this->session->flashdata('msg') ?>

<?php
//echo "datypes<br />\n";
//var_dump($daytypes);
//echo "<br />\n";
//echo "guesttypes<br />\n";
//var_dump($guesttypes);

echo form_open('admin/planprices/index/' . $hotelid . '/' . $planid);

echo '<table border="1px">' . "\n";
echo "<tr><td></td>";
foreach ($daytypes as $daytype)
{
    echo "<td>";
    echo $daytype['daytype_name'];
    echo " " . $daytype['rate'] . "%";
    echo "</td>";
}
echo "</tr>";
foreach ($guesttypes as $guesttype)
{
    $guesttypeid = $guesttype['guesttypeid'];
    echo "<tr>";
    echo "<td>";
    echo $guesttype['guesttype_name'];
    echo $guesttype['rate'] . "%";
    echo "</td>";
    foreach ($daytypes as $daytype)
    {
        $daytypeid = $daytype['daytypeid'];
        echo "<td>";
        $index = $guesttypeid . '_' . $daytypeid;
        if (isset($price[$index]))
        {
            $value = $price[$index];
        }
        else
        {
            $value = "";
        }
        echo '<input type="text" name="price[' . $index . ']" value="' . $value . '" size="10" />';
        echo "</td>" ."\n";
    }
    echo "</tr>";
}
echo "</table>\n";
?>
<input type="submit" name="submit" value="送信" />
</form>
<?php
include(dirname(__FILE__) . '/../footer.php');
?>
