<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>KGCMS企业应用管理平台 - Powered by KGCMS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<!-- <meta http-equiv="cache-control" content="no-siteapp" /> -->
<link rel="stylesheet" href="{{ kg['tpl_url'] }}style/user_rank.css">
<script src="{{ kg['tpl_url'] }}script/jquery.min.js"></script>
<script src="{{ kg['server']['HTTP_HOST'] }}/tools/amazeui/js/amazeui.min.js"></script>
<script src="{{kg['tpl_url']}}script/common.js"></script>
<script src="{{ kg['tpl_url'] }}script/user_rank.js"></script>
</head>
<body data-type="generalComponents">
    {% include 'component_header.tpl' %}
    <div class="tpl-page-container tpl-page-header-fixed">
		<div class="scrollbar-wrap">
        {% include 'component_left.tpl' %}
        <div class="tpl-content-wrapper">
            <div class="tpl-content-page-title">
                会员等级设置
            </div>
            <ol class="am-breadcrumb">
                <li><a href="./" class="am-icon-home">首页</a></li>
                <li class="am-active">会员等级设置</li>
            </ol>
            <div class="tpl-portlet-components">
                <div class="portlet-title">
                    <div class="caption font-green bold">
                        <span class="am-icon-code"></span>&nbsp;会员等级设置
                    </div>
                    <div class="tpl-portlet-input tpl-fz-ml am-no-margintop">
                        <div class="am-btn-toolbar ngre-Hdadd-paddidngT ngco-No-paddingR">
                            <div class="am-btn-group am-btn-group-xs">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="tpl-block ngALL-AFenyeFu-margin">
   
                            <form class="am-form" action="#" method="post" id="am-form">
                                <input type="hidden" name="action" value="submit" />
                                <table class="am-table am-table-striped am-table-hover table-main ngco-Esz-mgibdr">
                                    <thead>
                                        <tr>
                                            <th>序号</th>
                                            <th>等级名称</th>
                                            <th>商品折扣</th>
                                            <th>升级所需积分</th>
                                            <th>升级所需金钱</th>
                                            <th>类型</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    {% if not data %}<div class="no-data"><ul>没有相关数据</ul></div>{% endif %}
                                    <tbody class="list1">
                                        {% for row in data %}
                                        <tr>
                                            <td>{{loop.index}}<input type="hidden" name="id" value="{{row['id']}}" /></td>
                                            <td><input name="title" value="{{row['rankname']}}" type="text" size="20"></td>
                                            <td><input name="discount" value="{{row['discount']}}" type="text" class="" size="15"></td>
                                            <td><input name="scores" value="{{row['scores']}}" type="text" class="" size="15"></td>
                                            <td><input name="money" value="{{row['money']}}" type="text" class="" size="4"></td>
                                            <td>{% if row['id'] ==1 %}系统{% else %}用户{% endif %}</td>
                                            <td>
                                                <div class="am-btn-toolbar">
                                                    <div class="am-btn-group am-btn-group-xs">
                                                        <a href="user_rank?action=del&id={{row['id']}}" class="am-btn am-btn-default am-btn-xs am-text-danger   ngro-Jclick-shanchubi"><span class="am-icon-trash-o"></span>&nbsp;删除</a>
                                                        {% if row['enable'] == 1 %}
                                                        <a href="user_rank?action=unenable&id={{row['id']}}" class="am-btn am-btn-default am-btn-xs am-text-success am-hide-sm-only"><span class="am-icon-check"></span>&nbsp;禁用</a>
                                                        {% else %}
                                                        <a href="user_rank?action=enable&id={{row['id']}}" class="am-btn am-btn-default am-btn-xs am-text-success am-hide-sm-only"><span class="am-icon-check"></span>&nbsp;启用</a>
                                                        {% endif %}
                                                        {% if row['auto'] == 1 %}
                                                        <a href="user_rank?action=unauto&id={{row['id']}}" class="am-btn am-btn-default am-btn-xs am-text-secondary am-hide-sm-only"><span class="am-icon-level-up"></span>&nbsp;手动升级</a>
                                                        {% else %}
                                                        <a href="user_rank?action=auto&id={{row['id']}}" class="am-btn am-btn-default am-btn-xs am-text-secondary am-hide-sm-only"><span class="am-icon-level-up"></span>&nbsp;自动升级</a>
                                                        {% endif %}
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                        {% endfor %}
                                    </tbody>
                                </table>
                                {% if not data %}<div class="no-data"><ul>没有相关数据</ul></div>{% endif %}
                            </form>
                       
					<div class="clearfix ">
						<div class="tpl-portlet-input tpl-add-fl">
						    <div class="am-btn-toolbar">
						        <div class="am-btn-group am-btn-group-xs">
						            <a class="am-btn am-btn-success" id="addList"><span class="am-icon-plus"></span>&nbsp;新增</a>
						        </div>
						    </div>
						</div>
					</div>
					<div class="text-center am-form-group">
						<a  class="am-btn am-btn-primary tpl-btn-bg-color-success submin_but">提交</a>
						<span class="place"></span>
						<a class="am-btn am-btn-primary tpl-btn-bg-color-success ">重置</a>
					</div>
                </div>
            </div>
			{% include 'component_footer.tpl' %}
        </div>
        
		</div><!-- /.scrollbar-wrap -->
    </div>
    <script>
    $(function() {
        var index = {{ data|length }} + 1;
        $("#addList").click(function() {
            var html = '<tr>\n' +
                '<td>' + index + '<input type="hidden" name="id" value="add" /></td>\n' +
                '<td><input name="title" value="" type="text" size="20"></td>\n' +
                '<td><input name="discount" value="" type="text" class="" size="15"></td>\n' +
                '<td><input name="scores" value="" type="text" class="" size="15"></td>\n' +
                '<td><input name="money" value="" type="text" class="" size="4"></td>\n' +
                '<td>用户</td>\n' +
                '<td>\n' +
                '<div class="am-btn-toolbar">\n' +
                '<div class="am-btn-group am-btn-group-xs">\n' +
                '<a class="am-btn am-btn-default am-btn-xs am-text-danger add-del"><span class="am-icon-trash-o"></span>&nbsp;删除</a>\n' +
                '</div>\n' +
                '</div>\n' +
                '</td>\n' +
                '</tr>'

            $('.list1').append(html)
            index += 1;
        })
    })
    </script>
</body>
</html>