<div class="content-wrapper">

    <section class="content-header">
        <?=$this->partial('layout/breadcrumb')?>

        <h1 class="pull-right">
            <a href="<?=$this->url('app', ['action'=> 'add']);?>" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> <?=$this->translate('添加商城')?></a>
            <?=$this->HelpUrl('appList')?>
        </h1>

    </section>

    <section class="content">
        <?=$this->partial('layout/messages'); ?>

        <div class="row">
            <div class="col-xs-12">
                <div class="box erp-box">

                    <div class="box-body table-responsive no-padding">
                        <table class="table table-hover">
                            <thead>
                            <tr class="erp-bg-thead">
                                <th width="40"><?=$this->translate('商城名称')?></th>
                                <th width="15%"><?=$this->translate('商城类型')?></th>
                                <th width="15%"><?=$this->translate('状态')?></th>
                                <th width="15%"><?=$this->translate('添加时间')?></th>
                                <th width="15%"><?=$this->translate('操作')?></th>
                            </tr>
                            </thead>

                            <?php if($this->appList) foreach ($this->appList as $value) { ?>
                                <tr>
                                    <td><?= $this->escapeHtml($value->getAppName())?></td>
                                    <td><?= $this->adminHelper()->appType($value->getAppType())?></td>
                                    <td><?= $value->getAppState() ==1 ? $this->translate('启用') : '<label class="text-danger">'.$this->translate('禁用').'</label>'?></td>
                                    <td><?= date("Y-m-d H:i:s", $value->getAppAddTime())?></td>
                                    <td>
                                        <a href="<?= $this->url('app',
                                            ['action'=>'edit', 'id'=>$value->getAppId()]); ?>"
                                           class="btn btn-xs btn-success"><i class="fa fa-pencil"></i> <?=$this->translate('编辑')?>
                                        </a>

                                        <a href="javascript:;" onclick="deleteConfirm('<?php echo $this->translate('您确实要删除该商城吗？'); ?>', '<?= $this->url('app', ['action'=>'delete', 'id'=>$value->getAppId()], ['query' => ['qToken' => $this->common()->getCsrfValue()]]); ?>');" class="btn btn-xs btn-danger">
                                            <i class="fa fa-trash"></i> <?=$this->translate('删除')?>
                                        </a>

                                    </td>
                                </tr>
                            <?php } ?>
                        </table>
                    </div>
                </div>

            </div>
        </div>

    </section>
</div>