<?php
use \common\libs\MyLib;
?>
<?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/iCheck/custom.css" rel="stylesheet">
<?php $this->endBlock(); ?>

<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <div class="row">
                <div class="col-sm-12">
                    <form role="form" class="form-horizontal data-from" id="theFrm">
                        <input type="hidden" name="car_id" value="<?=intval($car_id)?>">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">无效理由</label>
                            <div class="col-sm-7">
                                <select name="invalid_id" class="form-control">
                                    <option value="0">---请选择---</option>
                                    <?php
                                    foreach($invalid_items as $item) {
                                        echo '<option value="'.$item->id.'">'.$item->name.'</option>';
                                    }
                                    ?>
                                </select>
                            </div>
                        </div>
                        <div>
                            <div class="row">
                                <div class="col-sm-5 col-sm-offset-5">
                                    <button class="btn btn-primary btn-save" type="button">
                                        <strong>提 交</strong>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<?php $this->beginBlock('footer_js'); ?>
<script type="text/javascript" language="javascript">
    $(function () {
        //提交按钮
        $(".btn-save").click(function(){
            parent.layer.confirm('是否确认提交？', {
                btn: ['确认','取消'], //按钮
                shade: false //不显示遮罩
            }, function(){
                var params = $("#theFrm").serialize();
                $.post('/car/invalid-save',params,function(obj){
                    parent.layer.msg(obj.msg);
                    if(obj.success) {
                        parent.history.go(-1);
                        layer_close();
                    }
                },'json');
            }, function(){
                //
            });
        });
    })
</script>
<?php $this->endBlock('footer_js'); ?>
