{template "header.html"}
<script type="text/javascript">
    $(function() { //防止回车提交表单
        document.onkeydown = function(e){
            var ev = document.all ? window.event : e;
            if (ev.keyCode==13) {
                return false;
            }
        }
    });

    function dr_show_catid(catid) {
        if ($('.dr_cat_'+catid).is(":hidden")){
            $('.fc-cat-user').hide();
            $('.dr_cat_'+catid).show(200);
        }else{
            $('.dr_cat_'+catid).hide(200);
        }
    }

    $(function(){
        var table = $('.table-checkable');
        table.find('.group-checkable').change(function () {
            var set = jQuery(this).attr("data-set");
            var checked = jQuery(this).is(":checked");
            jQuery("."+set).each(function () {
                if (checked) {
                    $(this).prop("checked", true);
                    $(this).parents('tr').addClass("active");
                } else {
                    $(this).prop("checked", false);
                    $(this).parents('tr').removeClass("active");
                }
            });
        });
    });
</script>
<form class="form-horizontal" role="form" id="myform">
    {$form}
    <div class="form-body">

        <div class="table-scrollable">
            <table class="fc-cat-table table table-striped table-bordered  table-checkable dataTable">
                <thead>

                <tr class="heading">
                    <th width="200"></th>
                    <th class="dr_option_xx">
                        <label class="mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
                            {dr_lang('访问')}
                            <input type="checkbox" class="checkboxes group-checkable dr_form_{$table}_show" data-set="dr_form_{$table}_show" />
                            <span></span>
                        </label>
                        <label class="mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
                            {dr_lang('发布')}
                            <input type="checkbox" class="checkboxes group-checkable dr_form_{$table}_add" data-set="dr_form_{$table}_add" />
                            <span></span>
                        </label>
                        <label class="mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
                            {dr_lang('验证码')}
                            <input type="checkbox" class="checkboxes group-checkable dr_form_{$table}_code" data-set="dr_form_{$table}_code" />
                            <span></span>
                        </label>
                        <label class="mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
                            {dr_lang('审核')}
                            <input type="checkbox" class="checkboxes group-checkable dr_form_{$table}_verify" data-set="dr_form_{$table}_verify" />
                            <span></span>
                        </label>
                    </th>
                </tr>
                </thead>
                <tbody>
                {loop $list $i $t}
                <tr class="odd gradeX">
                    {if $t.level}
                    <td colspan="99"> {$t.name} </td>
                    {else}
                    <td {$t.space}>{$t.name}</td>
                    <td class="dr_option_xx">
                        <label class="mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
                            {dr_lang('访问')}
                            <input type="checkbox" class="checkboxes dr_form_{$table}_show" {if !in_array($i, (array)$auth[form][$table]['show'])} checked {/if} name="data[show][]" value="{$i}" />
                            <span></span>
                        </label>
                        <label class="mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
                            {dr_lang('发布')}
                            <input type="checkbox" class="checkboxes dr_form_{$table}_add" {if !in_array($i, (array)$auth[form][$table]['add'])} checked {/if} name="data[add][]" value="{$i}"/>
                            <span></span>
                        </label>
                        <label class="mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
                            {dr_lang('验证码')}
                            <input type="checkbox" class="checkboxes dr_form_{$table}_code" {if !in_array($i, (array)$auth[form][$table]['code'])} checked {/if} name="data[code][]" value="{$i}" />
                            <span></span>
                        </label>
                        <label class="mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
                            {dr_lang('审核')}
                            <input type="checkbox" class="checkboxes dr_form_{$table}_verify" {if !in_array($i, (array)$auth[form][$table]['verify'])} checked {/if} name="data[verify][]" value="{$i}" />
                            <span></span>
                        </label>
                        <br>
                        <div class="input-inline input-small">
                            <div class="input-group">
                                <input type="text" name="data[exp][{$i}]" value="{$auth[form][$table]['exp'][$i]}" class="form-control" placeholder="">
                                <span class="input-group-addon">+{SITE_EXPERIENCE}</span>
                            </div>
                        </div>
                        <div class="input-inline input-small">
                            <div class="input-group">
                                <input type="text" name="data[score][{$i}]" value="{$auth[form][$table]['score'][$i]}" class="form-control" placeholder="">
                                <span class="input-group-addon">+{SITE_SCORE}</span>
                            </div>
                        </div>
                        <div class="input-inline input-small">
                            <div class="input-group">
                                <input type="text" name="data[day_post][{$i}]" value="{$auth[form][$table]['day_post'][$i]}" class="form-control" placeholder="">
                                <span class="input-group-addon">{dr_lang('日发布')}</span>
                            </div>
                        </div>
                        <div class="input-inline input-small">
                            <div class="input-group">
                                <input type="text" name="data[total_post][{$i}]" value="{$auth[form][$table]['total_post'][$i]}" class="form-control" placeholder="">
                                <span class="input-group-addon">{dr_lang('发布总数')}</span>
                            </div>
                        </div>
                    </td>
                    {/if}
                </tr>
                {/loop}
                </tbody>
            </table>
        </div>
        <p style="padding: 10px; margin: 0">
            {dr_lang('±功能表示：正数为增加值，负数为扣减值')}
        </p>
        <p style="padding: 0 0 10px 10px; margin: 0">
            <a href="javascript:dr_help(611);">{dr_lang('如果权限存储无效、前端用户权限不生效时，请检查下"提交表单数量"')}</a>
        </p>

    </div>
</form>
<style>
    .dr_option_xx {
        text-align: left !important;
    }
    .dr_option_xx .mt-checkbox {
        margin-right: 10px;
        margin-bottom: 5px;
    }
</style>
{template "footer.html"}