{if IS_USE_MODULE}
<div class="portlet portlet-sortable light bordered">
    <div class="portlet-title tabbable-line">
        <div class="caption">
            <i class="fa fa-bar-chart"></i>
            <span class="caption-subject"> {dr_lang('数据统计')} </span>
        </div>
    </div>
    <div class="portlet-body">
        <?php


		$mtotal = [];
		$module = $ci->get_cache('module-'.SITE_ID.'-content');
        if ($module) {
            foreach ($module as $dir => $t) {
                // 判断权限
                if (!$ci->_is_admin_auth($dir.'/home/index')) {
                    continue;
                }
                $mtotal[$dir] = [
                    'name' => dr_lang($t['name']),
                    'today' => \Phpcmf\Service::M('auth')->_menu_link_url($dir.'/home/index', $dir.'/home/index'),
                    'all' => \Phpcmf\Service::M('auth')->_menu_link_url($dir.'/home/index', $dir.'/home/index'),
                    'verify' => \Phpcmf\Service::M('auth')->_menu_link_url($dir.'/verify/index', $dir.'/verify/index'),
                    'recycle' => \Phpcmf\Service::M('auth')->_menu_link_url($dir.'/home/index', $dir.'/recycle/index'),
                    'timing' => \Phpcmf\Service::M('auth')->_menu_link_url($dir.'/home/index', $dir.'/time/index'),
                    'post' => \Phpcmf\Service::M('auth')->_menu_link_url($dir.'/home/index', $dir.'/home/add'),
                    'list' => \Phpcmf\Service::M('auth')->_menu_link_url($dir.'/home/index', $dir.'/home/index'),
                ];
            }
        }
        ?>
        <div class="">
            <table class="table table-mtotal table-nomargin table-bordered2 table-striped table-bordered table-advance">
                <thead>
                <tr>
                    <th>{dr_lang('模块')}</th>
                    <th style="text-align: center">{dr_lang('总数据')}</th>
                    <th style="text-align: center">{dr_lang('今日')}</th>
                    {if IS_USE_MEMBER}<th style="text-align: center">{dr_lang('待审核')}</th>{/if}
                    <th style="text-align: center">{dr_lang('待发布')}</th>
                    <th style="text-align: center">{dr_lang('回收站')}</th>
                </tr>
                </thead>
                <tbody>
                {loop $mtotal $dir $t}
                <tr>
                    <td>{$t.name}</td>
                    <td style="text-align: center"><a class="drlabel drlabel-success tooltips" data-container="body" data-placement="top" data-original-title="{dr_lang('数据量不一定是精确的，仅供参考')}" href="{$t.all}" id="{$dir}_all"><img src="{THEME_PATH}assets/images/mloading.gif"></a></td>
                    <td style="text-align: center"><a class="drlabel drlabel-success tooltips" data-container="body" data-placement="top" data-original-title="{dr_lang('数据量不一定是精确的，仅供参考')}" href="{$t.today}" id="{$dir}_today"><img src="{THEME_PATH}assets/images/mloading.gif"></a></td>
                    {if IS_USE_MEMBER}<td style="text-align: center"><a class="drlabel drlabel-important tooltips" data-container="body" data-placement="top" data-original-title="{dr_lang('数据量不一定是精确的，仅供参考')}" href="{$t.verify}" id="{$dir}_verify"><img src="{THEME_PATH}assets/images/mloading.gif"></a></td>{/if}
                    <td style="text-align: center"><a class="drlabel drlabel-important tooltips" data-container="body" data-placement="top" data-original-title="{dr_lang('数据量不一定是精确的，仅供参考')}" href="{$t.timing}" id="{$dir}_timing"><img src="{THEME_PATH}assets/images/mloading.gif"></a></td>
                    <td style="text-align: center"><a class="drlabel drlabel-important tooltips" data-container="body" data-placement="top" data-original-title="{dr_lang('数据量不一定是精确的，仅供参考')}" href="{$t.recycle}" id="{$dir}_recycle"><img src="{THEME_PATH}assets/images/mloading.gif"></a></td>

                    <script type="text/javascript">
                        $(function(){
                            $.getScript("{dr_url('module/api/mtotal')}&dir={$dir}");
                        });
                    </script>
                </tr>
                {/loop}
                </tbody>
            </table>

        </div>
    </div>
</div>
{/if}