<?php 
	include './head.php';
  $viewCount=$DB->getColumn("SELECT count(*) FROM `pre_view`");
  $classCount=$DB->getColumn("SELECT count(*) FROM `pre_class`");
  $viewPvCount = $DB->getColumn("SELECT sum(pvAll) FROM `pre_view`");
?>
<div class="layui-container">
<div class="layui-fluid">
    <div class="layui-row layui-col-space20">
      <div class="layui-col-md6">
        <div class="layui-card" style="border-radius: 20px;">
          <div class="layui-card-header">版本信息</div>
          <div class="layui-card-body layui-text">
            <table class="layui-table">
              <colgroup>
                <col width="100">
                <col>
              </colgroup>
              <tbody>
                <tr>
                  <td>程序名称</td>
                  <td>小高教学网SEO静态页面生成系统</td>
                </tr>
                 <tr>
                  <td>当前版本</td>
                  <td>1.0</td>
                </tr>
                <tr>
                  <td>作者 Q Q </td>
                  <td>84065994</td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
        <?php echo ad(); ?>
        </div>
      <div class="layui-col-md6">
            <div class="layui-card" style="border-radius: 20px;">
              <div class="layui-card-header">系统数据</div>
              <div class="layui-card-body">
                <div class="layui-carousel layadmin-carousel layadmin-backlog" lay-anim="" lay-indicator="inside" lay-arrow="none" style="width: 100%; height: 280px;">
                  <div carousel-item="">
                    <ul class="layui-row layui-col-space10 layui-this">
                      <li class="layui-col-xs6">
                        <a class="layadmin-backlog-body">
                          <h3>页面数量</h3>
                          <p><cite><?php echo $viewCount; ?></cite></p>
                        </a>
                      </li>
                      <li class="layui-col-xs6">
                        <a class="layadmin-backlog-body">
                          <h3>分类数量</h3>
                          <p><cite><?php echo $classCount; ?></cite></p>
                        </a>
                      </li>
                      <li class="layui-col-xs6">
                        <a class="layadmin-backlog-body">
                          <h3>总访问量</h3>
                          <p><cite><?php echo $viewPvCount; ?></cite></p>
                        </a>
                      </li>
                    </ul>
                  </div>
              </div>
              </div>
            </div>

          <div class="layui-card" style="border-radius: 20px;">
            <div class="layui-card-header">总页面活跃量</div>
            <div class="layui-card-body">
              <table class="layui-table layuiadmin-page-table" lay-skin="line">
                <thead>
                  <tr>
                    <th>页面编号</th>
                    <th>页面名称</th>
                    <th>活跃量</th>
                  </tr> 
                </thead>
                <tbody>
                  <?php 
                    $viewInfo = $DB->query("SELECT * FROM `pre_view` ORDER BY `pvAll` DESC limit 8");
                    while($res = $viewInfo->fetch()){
                      echo '<tr>
                    <td>'.$res['id'].'</td>
                    <td>'.$res['title'].'</td>
                    <td>'.$res['pvAll'].'</td>
                  </tr>';
                    }
                  ?>
                </tbody>
              </table>
            </div>
          </div>
        </div>
<script src="../public/static/layuiadmin/layui/layui.all.js"></script>
  <script>
  layui.config({
      base: '../public/static/layuiadmin/' //静态资源所在路径
    }).extend({
      index: 'lib/index' //主入口模块
    }).use('index');

    var v = '1.0';
    $.ajax({
        url: "./ajax.php?act=update",
        data: {v},
        type: "GET",
        dataType: "json",
        success: function(data){
            if(data.code==1){
              layer.alert(1,{
                title:'版本更新',
                content:data.msg
              });
            }
        }
    });
  </script>
<?php 
	include 'foot.php';
?>