@extends('admin.layout')

@section('content')

    <?php
    if (!isset($data)) $data = array();
    if (!$data && session("data")) {
        $data = session("data");
    }
    if (!$data && session('_old_input')) {
        $data = session("_old_input");
    }
    ?>
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>订单管理</h5>
                        <div class="ibox-tools">
                            <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        @if(role('Album/Order/index'))
                            <div class="row">
                                <div class="col-sm-3 pull-right">
                                    <a href="{{ U('Album/Order/index')}}"
                                       class="btn btn-sm btn-primary pull-right">返回列表</a>
                                </div>
                            </div>
                        @endif

                        <div class="row">
                            <div class="col-lg-10">
                                <form name="form_product" id="form-validation" action=""
                                      class="form-horizontal form-validation" accept-charset="UTF-8" method="post">

                                    <div class="form-group">

                                        <label class="control-label col-sm-3">产品分类</label>

                                        <div class="col-sm-9">
                                            <input id="data_category" name="data[category]" class="form-control"
                                                   value="{{ $data['category'] or ''}}" required="" aria-required="true"
                                                   placeholder="">
                                        </div>

                                    </div>
                                    <div class="form-group">

                                        <label class="control-label col-sm-3">产品型号</label>

                                        <div class="col-sm-9">
                                            <input id="data_type" name="data[type]" class="form-control"
                                                   value="{{ $data['type'] or ''}}" required="" aria-required="true"
                                                   placeholder="">
                                        </div>

                                    </div>
                                    <div class="form-group">

                                        <label class="control-label col-sm-3">产品颜色</label>

                                        <div class="col-sm-9">
                                            <input id="data_color" name="data[color]" class="form-control"
                                                   value="{{ $data['color'] or ''}}" required="" aria-required="true"
                                                   placeholder="">
                                        </div>

                                    </div>
                                    <div class="form-group">

                                        <label class="control-label col-sm-3">产品图片</label>

                                        <div class="col-sm-9">

                                            {!!  widget('Tools.ImgUpload')->multi2('/upload/album','picture',"picture",  isset($data['picture'])? $data['picture'] : '',["max"=>3]) !!}
                                        </div>

                                    </div>
                                    <div class="form-group">

                                        <label class="control-label col-sm-3">问题描述</label>

                                        <div class="col-sm-9">
                                            <textarea name="data[question]" id="" cols="100" rows="5">{!! $data['question'] or '' !!}</textarea>

                                        </div>

                                    </div>


                                    <div class="form-group">

                                        <label class="control-label col-sm-3">用户姓名</label>

                                        <div class="col-sm-9">
                                            <input id="data_customer_name" name="data[customer_name]"
                                                   class="form-control" value="{{ $data['customer_name'] or ''}}"
                                                   required="" aria-required="true" placeholder="">
                                        </div>

                                    </div>
                                    <div class="form-group">

                                        <label class="control-label col-sm-3">联系方式</label>

                                        <div class="col-sm-9">
                                            <input id="data_customer_phone" name="data[customer_phone]"
                                                   class="form-control" value="{{ $data['customer_phone'] or ''}}"
                                                   required="" aria-required="true" placeholder="">
                                        </div>

                                    </div>
                                    <div class="form-group">

                                        <label class="control-label col-sm-3">收货地址</label>

                                        <div class="col-sm-9">
                                            <input id="data_customer_address" name="data[customer_address]"
                                                   class="form-control" value="{{ $data['customer_address'] or ''}}"
                                                   required="" aria-required="true" placeholder="">
                                        </div>

                                    </div>
                                    <div class="form-group">

                                        <label class="control-label col-sm-3">费用</label>

                                        <div class="col-sm-9">
                                            <input id="data_price" name="data[price]" class="form-control" value="{{ $data['price'] or ''}}"  placeholder="">
                                        </div>

                                    </div>

                                    <div class="form-group">

                                        <label class="control-label col-sm-3">预计完成时间</label>

                                        <div class="col-sm-6">
                                            <input id="data_expected_time" name="data[expected_time]"
                                                   class="form-control" value="{{ $data['expected_time'] or ''}}"
                                                   type="date" >
                                        </div>

                                    </div>
                                    <div class="form-group">

                                        <label class="control-label col-sm-3">客服备注</label>

                                        <div class="col-sm-9">
                                            <input id="data_remark" name="data[remark]" class="form-control"
                                                   value="{{ $data['remark'] or ''}}"
                                                   placeholder="">
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="control-label col-sm-3">&nbsp;</label>
                                        <div class="col-sm-9">
                                            <input type="hidden" name="_referer"
                                                   value="<?php echo urlencode(request()->server('HTTP_REFERER'));?>"/>
                                            <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>"/>
                                            <input type="submit" class="btn btn-success" style="margin-right:20px;">
                                            <input type="reset" class="btn btn-default">
                                        </div>
                                    </div>

                                </form>
                            </div>
                            <!-- /.col-lg-10 -->
                        </div>
                        <!-- /.row -->
                    </div>
                </div>
            </div>
        </div>
    </div>

@endsection