<?php $this->view('ajax_loading_v'); ?>

<script type="text/javascript">
    $(function(){
        $('.thumbnails a').lightBox();
    });

</script>
<div class="textbox">
    <div class="toolbar">
        <div class="pull-left title"><?php echo $page_title; ?></div>
        <div class="pull-right">
            <?php echo anchor('carquery/car', "<i class='icon-remove-circle'></i> ปิด", array('class' => 'btn')); ?>
        </div>
        <div class="clear"></div>
    </div>
    <div class="textbox_content">
        <?php echo form_open('car/save', array('id' => 'myform')); ?>
        <input type="hidden" id="id" name="id" value="<?php echo @$row['id']; ?>"/>
        <table border="0" cellpadding="4" cellspacing="1" class="tblform-line">
            <tbody>
                <tr>
                    <td class="td1" width="150">ทะเบียน :</td>
                    <td><?php echo $row['code']; ?></td>
                </tr>
                <tr>
                    <td class="td1">ยี่ห้อ :</td>
                    <td class="td2"><?php echo $row['brand']; ?></td>
                </tr>
                <tr>
                    <td class="td1">รุ่น :</td>
                    <td class="td2"><?php echo $row['model']; ?></td>
                </tr>
                <tr>
                    <td class="td1">รายละเอืยดอื่นๆ :</td>
                    <td class="td2"><?php echo nl2br($row['detail']); ?></td>
                </tr>
                <tr>
                    <td class="td1">สถานะรถ :</td>
                    <td>
                        <?php
                        switch ($row['status']) {
                            case '0':
                                echo "จองได้";
                                break;
                            case '1':
                                echo "อยู่ระหว่างซ่อมแซม";
                                break;
                            case '2':
                                echo "งดจอง";
                                break;
                        }
                        ?>
                    </td>
                </tr>
                <tr>
                    <td class="td1">% น้ำมันคงเหลือ :</td>
                    <td class="td2"><?php echo nl2br($row['oilstatus']); ?> <b>%</b></td>
                </tr>
                <tr>
                    <td class="td1">คำอธิบายสถานะ :</td>
                    <td class="td2"><?php echo nl2br($row['status_text']); ?></td>
                </tr>
            </tbody>
        </table>
        <?php echo form_close(); ?>
        <h4>รูปรถ</h4>
        <ul class="thumbnails">
            <?php for ($i = 1; $i < 5; $i++): ?>
                <?php if (@$row['picture' . $i] != ''): ?>
                    <li class="span2">
                        <a class="thumbnail" href="<?php echo base_url(); ?>assets/upload_car/<?php echo $row['picture' . $i] . "?" . rand(0, 9999); ?>" title="ภาพรถ" >
                            <img src="<?php echo base_url(); ?>assets/upload_car/<?php echo $row['picture' . $i] . "?" . rand(0, 9999); ?>" style="width:140px;height:109px"/>
                        </a>
                    </li>
                <?php endif ?>
            <?php endfor ?>
        </ul>
        <?php echo form_close(); ?>
        <div class="clr"></div>
    </div>
</div>
