<div class="content-wrapper">
    <?php
    $form = $this->form;
    $form->prepare();
    ?>
    <?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('operation-ad');?>" 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>
            <a href="javascript:;" onclick="deleteConfirm('<?php echo $this->translate('您确实要清除该广告内容吗?'); ?>', '<?php echo $this->url('operation-ad', ['action'=>'adDelete'], ['query' => ['type' => 'pc', 'class' => $this->classCode, 'placeCode' => $this->placeCode, 'qToken' => $this->adminHelper()->getCsrfValue()]]); ?>');" class="btn btn-sm btn-danger"><i class="fa fa-trash"></i> <?php echo $this->translate('清除广告'); ?></a>
            <?php echo $this->HelpUrl('pcAd'); ?>
        </h1>
    </section>

    <section class="content">

        <div class="row">
            <div class="col-md-12">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title"><?php echo $this->translate('设置广告'); ?></h3>
                    </div>

                    <div class="box-body">
                        <?php echo $this->partial('layout/messages'); ?>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('广告位置'); ?></label>
                            <div class="col-sm-5">
                                <p class="form-control-static"><?php echo $this->className . ' -> ' . $this->placeName; ?></p>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('广告类型'); ?></label>
                            <div class="col-sm-5">
                                <p class="form-control-static"><?php echo $this->adType == 'image' ? $this->translate('图片') : $this->translate('幻灯片'); ?></p>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('图片尺寸'); ?></label>
                            <div class="col-sm-5">
                                <p class="form-control-static"><?php echo $this->imageSize; ?></p>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('广告图片1'); ?></label>
                            <div class="col-sm-5">
                                <?php if(is_string($form->get('slideImage1')->getValue())) { ?>
                                    <img src="<?php echo $this->basePath($form->get('slideImage1')->getValue()); ?>" style="max-width: 800px;padding-bottom: 5px;">
                                <?php } ?>
                                <?php echo $this->formElement($form->get('slideImage1')); ?>
                                <?php echo $this->formElementErrors($form->get('slideImage1'), ['class'=>'error-message']); ?>
                                <?php echo $this->formElement($form->get('slideId1')); ?>
                                <?php echo $this->formElementErrors($form->get('slideId1'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('排序1'); ?></label>
                            <div class="col-sm-2">
                                <?php echo $this->formElement($form->get('slideSort1')); ?>
                                <?php echo $this->formElementErrors($form->get('slideSort1'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('URL地址1'); ?></label>
                            <div class="col-sm-6">
                                <?php echo $this->formElement($form->get('slideUrl1')); ?>
                                <?php echo $this->formElementErrors($form->get('slideUrl1'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('广告图片2'); ?></label>
                            <div class="col-sm-5">
                                <?php if(is_string($form->get('slideImage2')->getValue())) { ?>
                                    <img src="<?php echo $this->basePath($form->get('slideImage2')->getValue()); ?>" style="max-width: 800px;padding-bottom: 5px;">
                                <?php } ?>
                                <?php echo $this->formElement($form->get('slideImage2')); ?>
                                <?php echo $this->formElementErrors($form->get('slideImage2'), ['class'=>'error-message']); ?>
                                <?php echo $this->formElement($form->get('slideId2')); ?>
                                <?php echo $this->formElementErrors($form->get('slideId2'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('排序2'); ?></label>
                            <div class="col-sm-2">
                                <?php echo $this->formElement($form->get('slideSort2')); ?>
                                <?php echo $this->formElementErrors($form->get('slideSort2'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('URL地址2'); ?></label>
                            <div class="col-sm-6">
                                <?php echo $this->formElement($form->get('slideUrl2')); ?>
                                <?php echo $this->formElementErrors($form->get('slideUrl2'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('广告图片3'); ?></label>
                            <div class="col-sm-5">
                                <?php if(is_string($form->get('slideImage3')->getValue())) { ?>
                                    <img src="<?php echo $this->basePath($form->get('slideImage3')->getValue()); ?>" style="max-width: 800px;padding-bottom: 5px;">
                                <?php } ?>
                                <?php echo $this->formElement($form->get('slideImage3')); ?>
                                <?php echo $this->formElementErrors($form->get('slideImage3'), ['class'=>'error-message']); ?>
                                <?php echo $this->formElement($form->get('slideId3')); ?>
                                <?php echo $this->formElementErrors($form->get('slideId3'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('排序3'); ?></label>
                            <div class="col-sm-2">
                                <?php echo $this->formElement($form->get('slideSort3')); ?>
                                <?php echo $this->formElementErrors($form->get('slideSort3'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('URL地址3'); ?></label>
                            <div class="col-sm-6">
                                <?php echo $this->formElement($form->get('slideUrl3')); ?>
                                <?php echo $this->formElementErrors($form->get('slideUrl3'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('广告图片4'); ?></label>
                            <div class="col-sm-5">
                                <?php if(is_string($form->get('slideImage4')->getValue())) { ?>
                                    <img src="<?php echo $this->basePath($form->get('slideImage4')->getValue()); ?>" style="max-width: 800px;padding-bottom: 5px;">
                                <?php } ?>
                                <?php echo $this->formElement($form->get('slideImage4')); ?>
                                <?php echo $this->formElementErrors($form->get('slideImage4'), ['class'=>'error-message']); ?>
                                <?php echo $this->formElement($form->get('slideId4')); ?>
                                <?php echo $this->formElementErrors($form->get('slideId4'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('排序4'); ?></label>
                            <div class="col-sm-2">
                                <?php echo $this->formElement($form->get('slideSort4')); ?>
                                <?php echo $this->formElementErrors($form->get('slideSort4'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('URL地址4'); ?></label>
                            <div class="col-sm-6">
                                <?php echo $this->formElement($form->get('slideUrl4')); ?>
                                <?php echo $this->formElementErrors($form->get('slideUrl4'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('广告图片5'); ?></label>
                            <div class="col-sm-5">
                                <?php if(is_string($form->get('slideImage5')->getValue())) { ?>
                                    <img src="<?php echo $this->basePath($form->get('slideImage5')->getValue()); ?>" style="max-width: 800px;padding-bottom: 5px;">
                                <?php } ?>
                                <?php echo $this->formElement($form->get('slideImage5')); ?>
                                <?php echo $this->formElementErrors($form->get('slideImage5'), ['class'=>'error-message']); ?>
                                <?php echo $this->formElement($form->get('slideId5')); ?>
                                <?php echo $this->formElementErrors($form->get('slideId5'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('排序5'); ?></label>
                            <div class="col-sm-2">
                                <?php echo $this->formElement($form->get('slideSort5')); ?>
                                <?php echo $this->formElementErrors($form->get('slideSort5'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('URL地址5'); ?></label>
                            <div class="col-sm-6">
                                <?php echo $this->formElement($form->get('slideUrl5')); ?>
                                <?php echo $this->formElementErrors($form->get('slideUrl5'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('开始时间'); ?></label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        <i class="fa fa-calendar"></i>
                                    </div>
                                    <?php echo $this->formElement($form->get('adStartTime')); ?>
                                </div>
                                <?php echo $this->formElementErrors($form->get('adStartTime'), ['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-3">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        <i class="fa fa-calendar"></i>
                                    </div>
                                    <?php echo $this->formElement($form->get('adEndTime')); ?>
                                </div>
                                <?php echo $this->formElementErrors($form->get('adEndTime'), ['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-4">
                                <div class="checkbox">
                                    <label>
                                        <?php echo $this->formElement($form->get('adState')); ?><?php echo $this->translate('启用'); ?>
                                        <?php echo $this->formElementErrors($form->get('adState'), ['class'=>'error-message']); ?>
                                    </label>
                                </div>
                            </div>
                        </div>

                    </div>

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

    </section>
    <?php echo $this->form()->closeTag(); ?>

</div>
<script type="text/javascript">
    laydate.render({elem: '#adStartTime'});
    laydate.render({elem: '#adEndTime'});
</script>
