<?php include ADMIN_COMMON_PATH.'/header.html';?>
<div class="layui-container fly-marginTop fly-user-main">
    <?php include ADMIN_COMMON_PATH.'/products-nav.html';?>
    <div class="fly-panel fly-panel-user" pad20>
        <div class="layui-tab layui-tab-brief" lay-filter="email">
            <ul class="layui-tab-title" id="LAY_mine">
                <li class="" lay-id="list"><a href="/<?php echo ADMIN_DIR;?>/productscard/">卡密管理</a></li>
                <li class="" lay-id="add"><a href="/<?php echo ADMIN_DIR;?>/productscard/add">添加</a></li>
				<li class="" lay-id="addplus"><a href="/<?php echo ADMIN_DIR;?>/productscard/addplus">批量添加</a></li>
				<li class="" lay-id="import"><a href="/admin/productscard/import">导入</a></li>
				<li class="layui-this" lay-id="download">导出</li>
            </ul>
            <div class="layui-tab-content" style="padding: 20px 0;">
                <div class="layui-form-pane layui-tab-item layui-show">
                    <blockquote class="layui-elem-quote">
                        <p>导出注意事项如下：</p>
                        <p>1.文件类型为txt文本文件；</p>
                        <p>2.一次导出不要太多，受当前环境配置影响</p>
                    </blockquote>
                    <form class="layui-form layui-show" id="download_form" method="post" action="/<?php echo ADMIN_DIR;?>/productscard/downloadajax">
                        <div class="layui-form-item">
                            <label class="layui-form-label">商品</label>
                            <div class="layui-input-inline">
                                <select name="pid" lay-filter="required" lay-verify="required">
                                    <option value=""></option>
                                    <?php if(!empty($products)):?>
                                    <?php foreach($products AS $p):?>
                                    <option value="<?php echo $p['id'];?>"><?php echo $p['name'];?></option>
                                    <?php endforeach;?>
                                    <?php endif;?>
                                </select>
                            </div>
                            <div class="layui-input-inline">
                                <select name="active">
                                    <option value="-1"></option>
									<option value="0">可用</option>
									<option value="1">已使用</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item">
							<input type ="hidden" name ="csrf_token" value="<?php echo $csrf_token;?>">
                            <button class="layui-btn" id="startUpload" key="set-mine" type="submit" lay-filter="download" lay-submit>确认导出</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<!--引入公共底文件-->
<?php include ADMIN_COMMON_PATH.'/footer.html';?>
<script>
layui.use('adminproductscard');
</script>