<?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="info"><a href="/<?php echo ADMIN_DIR;?>/products/">商品管理</a></li>
                <li class="layui-this" lay-id="info">添加</a>
                </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.当商品类型属于激活状态时，产品在售才会显示在前台;</p>
                        <p> 2.手工发货商品原则上也支持库存管理，[限制]时购买会自动减少库存,[不限制]时库存默认为0；</p>
                        <p> 3.自动发货商品库存管理一定要注意设置：
                            <br/> [限制]时,购买会自动减少库存,同时对应卡密使用后会标记为已使用；
                            <br/> [不限制]时,购买库存仍为０,同时对应卡密使用后会仍可使用；
                        </p>
                    </blockquote>
                    <form class="layui-form layui-show" method="post">
                        <div class="layui-form-item">
                            <label class="layui-form-label">商品类型</label>
                            <div class="layui-input-inline">
                                <select name="typeid" lay-filter="required">
                                    <option value=""></option>
                                    <?php if(!empty($productstype)):?>
                                    <?php foreach($productstype AS $p):?>
										<option value="<?php echo $p['id'];?>"><?php echo $p['name'];?></option>
                                    <?php endforeach;?>
                                    <?php endif;?>
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="name" class="layui-form-label">商品名称</label>
                            <div class="layui-input-inline">
                                <input type="text" id="name" name="name" lay-verify="required" autocomplete="off" value="" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label for="description" class="layui-form-label">描述</label>
                            <div class="layui-input-block">
                                <textarea placeholder="" id="description" name="description" autocomplete="off" class="layui-textarea" style="height: 80px;"></textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">是否库存控制</label>
                            <div class="layui-input-block">
                                <input type="radio" name="stockcontrol" lay-filter="stockcontrol" value="1" title="限制" checked="">
                                <input type="radio" name="stockcontrol" lay-filter="stockcontrol" value="0" title="不限制">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="qty" class="layui-form-label">库存数量</label>
                            <div class="layui-input-inline">
                                <input type="number" id="qty" name="qty" lay-verify="required" autocomplete="off" value="1" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="price" class="layui-form-label">单价</label>
                            <div class="layui-input-inline">
                                <input type="number" id="price" name="price" lay-verify="required" autocomplete="off" value="" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">发货模式</label>
                            <div class="layui-input-block">
                                <input type="radio" name="auto" value="1" title="自动发货" checked="">
                                <input type="radio" name="auto" value="0" title="手工发货">
                            </div>
                        </div>
						
                        <div class="layui-form-item" style="display:none">
                            <label for="addons" class="layui-form-label">附加输入框</label>
                            <div class="layui-input-inline">
                                <input type="text" id="addons" name="addons" autocomplete="off" value="" class="layui-input">
                            </div>
							<div class="layui-form-mid layui-word-aux">自定义输入框，显示在商品订购页; A,B</div>
                        </div>
						
                        <div class="layui-form-item">
                            <label class="layui-form-label">是否销售</label>
                            <div class="layui-input-block">
                                <input type="radio" name="active" value="1" title="在售" checked="">
                                <input type="radio" name="active" value="0" title="停售">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="password" class="layui-form-label">商品密码</label>
                            <div class="layui-input-inline">
                                <input type="text" id="password" name="password" autocomplete="off" value="" class="layui-input">
                            </div>
							<div class="layui-form-mid layui-word-aux">可留空</div>
                        </div>
                        <div class="layui-form-item">
                            <label for="sort_num" class="layui-form-label">排序</label>
                            <div class="layui-input-inline">
                                <input type="number" id="sort_num" name="sort_num" lay-verify="required" autocomplete="off" value="99" class="layui-input">
                            </div>
							<div class="layui-form-mid layui-word-aux">数字越大，越靠前</div>
                        </div>
                        <div class="layui-form-item">
                            <input type="hidden" name="method" value="add">
                            <input type="hidden" name="id" value="0">
                            <button class="layui-btn" key="set-mine" lay-filter="edit" lay-submit>确认添加</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<!--引入公共底文件-->
<?php include ADMIN_COMMON_PATH.'/footer.html';?>
<script>
layui.use('adminproducts');
</script>