<div class="content-wrapper">
    <?php
    $form = $this->form;
    $form->prepare();

    $form->get('deliveryName')->setAttributes([
        'placeholder' => $this->translate('配送名称')
    ]);
    $form->get('deliveryInfo')->setAttributes([
        'placeholder' => $this->translate('配送方式简介')
    ]);
    $form->get('deliveryUrl')->setAttributes([
        'placeholder' => $this->translate('配送方式官方网址')
    ]);
    $form->get('deliverySort')->setAttributes([
        'placeholder' => $this->translate('排序')
    ]);
    ?>
    <?php echo $this->form()->openTag($form); ?>
    <section class="content-header">
        <?php echo $this->partial('layout/breadcrumb'); ?>

        <h1 class="pull-right" id="dbshop-menu-top">
            <a href="<?php echo $this->url('delivery');?>" class="btn btn-default btn-sm"><i class="fa fa-arrow-left"></i> <?php echo $this->translate('返回配送列表'); ?></a>
            <button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-check"></i> <?php echo $this->translate('保存配送方式'); ?></button>
            <?php echo (isset($this->delivery) ? $this->HelpUrl('deliveryEdit') : $this->HelpUrl('deliveryAdd')); ?>
        </h1>
    </section>

    <section class="content">

        <div class="row">
            <div class="col-md-12">
                <div class="nav-tabs-custom">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab_1" data-toggle="tab"><?php echo $this->translate('基本设置'); ?></a></li>
                    </ul>
                    <div class="tab-content">
                        <?php echo $this->partial('layout/messages'); ?>
                        <div class="tab-pane active" id="tab_1">
                            <div class="box-body">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('配送(公司)名称'); ?><span class="must_add_value">*</span></label>
                                    <div class="col-sm-6">
                                        <?php echo $this->formElement($form->get('deliveryName')); ?>
                                        <?php echo $this->formElementErrors($form->get('deliveryName'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('配送(公司)简介'); ?></label>
                                    <div class="col-sm-6">
                                        <?php echo $this->formElement($form->get('deliveryInfo')); ?>
                                        <?php echo $this->formElementErrors($form->get('deliveryInfo'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('配送公司网址'); ?></label>
                                    <div class="col-sm-6">
                                        <?php echo $this->formElement($form->get('deliveryUrl')); ?>
                                        <?php echo $this->formElementErrors($form->get('deliveryUrl'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('轨迹绑定'); ?></label>
                                    <div class="col-sm-2">
                                        <?php echo $this->formElement($form->get('deliveryNameCode')); ?>
                                        <?php echo $this->formElementErrors($form->get('deliveryNameCode'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('货到付款'); ?></label>
                                    <div class="col-sm-2">
                                        <?php echo $this->formElement($form->get('cashOnDelivery')); ?>
                                        <?php echo $this->formElementErrors($form->get('cashOnDelivery'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('配送状态'); ?><span class="must_add_value">*</span></label>
                                    <div class="col-sm-6">
                                        <div class="checkbox">
                                            <label>
                                                <?php echo $this->formElement($form->get('deliveryState')); ?> <?php echo $this->translate('启用'); ?>
                                                <?php echo $this->formElementErrors($form->get('deliveryState'), ['class'=>'error-message']); ?>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('配送排序'); ?><span class="must_add_value">*</span></label>
                                    <div class="col-sm-2">
                                        <?php echo $this->formElement($form->get('deliverySort')); ?>
                                        <?php echo $this->formElementErrors($form->get('deliverySort'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>

    </section>
    <?php echo $this->form()->closeTag(); ?>
</div>
<script type="text/javascript">
    $('.select2').select2();
</script>