<?php
include_once("htui_header.php");

$sql   ="select * from {$tablepre}upload_log order by id desc limit 8"; 
$myrow = $db->get_all($sql);

if(!empty($myrow) && is_array($myrow)){

   foreach($myrow as $k => $v){
	  $str = "select * from scuser where ID='".$v['scuser_id']."'"; 
      $rs  = $db->get_row($str);
	  $myrow[$k]['UserName'] = $rs['UserName'];
   }

}
?>
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>飞天后台管理系统模板-飞天素材网</title>
<meta name="keywords" content="后台模板,后台管理系统,HTML模板">
<meta name="description" content="基于Bootstrap后台管理系统的HTML模板">
<meta name="author" content="ftsucai.com">
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/fonts.css" rel="stylesheet">
<link href="../css/htstyle.css" rel="stylesheet">
</head>

<body>

    <!--页面主要内容-->
    <main class="ftdms-layout-content">
      
      <div class="container-fluid" style="margin-bottom:90px;">
        <!--
        <div class="row" style="margin-top:15px;">
          <div class="col-sm-6 col-lg-3">
            <div class="card bg-primary">
              <div class="card-body clearfix">
                <div class="pull-left">
                  <p class="h6 text-white m-t-0">今日收入</p>
                  <p class="h3 text-white m-b-0">100,000.00</p>
                </div>
                <div class="pull-right"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="ftsucai-56 fa-1-5x"></i></span> </div>
              </div>
            </div>
          </div>
          
          <div class="col-sm-6 col-lg-3">
            <div class="card bg-danger">
              <div class="card-body clearfix">
                <div class="pull-left">
                  <p class="h6 text-white m-t-0">昨日收入</p>
                  <p class="h3 text-white m-b-0">200,000.00</p>
                </div>
                <div class="pull-right"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="ftsucai-310 fa-1-5x"></i></span> </div>
              </div>
            </div>
          </div>
          
          <div class="col-sm-6 col-lg-3">
            <div class="card bg-success">
              <div class="card-body clearfix">
                <div class="pull-left">
                  <p class="h6 text-white m-t-0">月度累计收入</p>
                  <p class="h3 text-white m-b-0">1000,000.00</p>
                </div>
                <div class="pull-right"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="ftsucai-55 fa-1-5x"></i></span> </div>
              </div>
            </div>
          </div>
          
          <div class="col-sm-6 col-lg-3">
            <div class="card bg-purple">
              <div class="card-body clearfix">
                <div class="pull-left">
                  <p class="h6 text-white m-t-0">年度累计收入</p>
                  <p class="h3 text-white m-b-0">5,000,000.00</p>
                </div>
                <div class="pull-right"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="ftsucai-310 fa-1-5x"></i></span> </div>
              </div>
            </div>
          </div>
        </div>
        -->

        <div class="row" style="margin-top:12px;">
          
          
		  <div class="col-lg-6"> 
            <div class="card">
              <div class="card-header">
                <h4>每月注册用户</h4>
              </div>
              <div class="card-body">
                <canvas class="chartjs-bars"></canvas>
              </div>
            </div>
          </div>
          
		  <div class="col-lg-6"> 
            <div class="card">
              <div class="card-header">
                <h4>每月收入走势</h4>
              </div>
              <div class="card-body">
                <canvas class="chartjs-lines"></canvas>
              </div>
            </div>
          </div>
           
        </div>
        
		
		<div class="row">
          
          <div class="col-lg-6"> 
            <div class="card">
              <div class="card-header">
                <h4>每月发布信息</h4>
              </div>
              <div class="card-body">
                <canvas class="js-chartjs-bars"></canvas>
              </div>
            </div>
          </div>
          
          <div class="col-lg-6"> 
            <div class="card">
              <div class="card-header">
                <h4>每月下载走势</h4>
              </div>
              <div class="card-body">
                <canvas class="js-chartjs-lines"></canvas>
              </div>
            </div>
          </div>
           
        </div>
        
        <div class="row">
          <div class="col-lg-12">
            <div class="card">
              <div class="card-body">
			    <div class="card-header"><h4>最新文件上传日志</h4>
			       <ul class="card-actions">
                    <li> <span><a href="upload_log_list.php">更多...</a></span> </li>
                   </ul>
			    </div>
                <div class="table-responsive">
                  <table class="table table-hover">
                    <thead>
                      <tr>
                        <th>#</th>
						<th>上传文件</th>
                        <th>日志类型</th>
                        <th>上传位置</th>
						<th>上传用户</th>
                        <th>IP地址</th>
						<th>上传时间</th>
                      </tr>
                    </thead>
                    <tbody>
					<?php
					  $i=0;
					  foreach ($myrow as $k=>$v){
						  $i++;
                          $uplod_type='前台上传';$paymsg='否';
						  if ($v['uplod_type']==1){
							 $uplod_type='后台上传';
						  }
					?>
                      <tr>
                        <td><?php echo $i;?></td>
						<td><?php echo $v['upload_file'];?></td>
                        <td><?php echo $uplod_type;?></td>
                        <td><?php echo $v['action_file'];?></td>
						<td><?php echo $v['UserName']?></td>
                        <td><?php echo $v['ip_addr'];?></td>
						<td><?php echo $v['add_time'];?></td>
                      </tr>
                    <?php
		            }	
					?>  
                    </tbody>
                  </table>
                </div>
              </div>
            </div>
          </div>
          
        </div>
        
      </div>
      
    </main>
    <!--End 页面主要内容-->

<script type="text/javascript" src="../js/jquery.min.js"></script>

<!--图表插件-->
<script type="text/javascript" src="../js/Chart.js"></script>
<script type="text/javascript">
$(document).ready(function(e) {
    var $dashChartBarsCnt  = jQuery( '.js-chartjs-bars' )[0].getContext( '2d' ),
        $dashChartLinesCnt = jQuery( '.js-chartjs-lines' )[0].getContext( '2d' );
		$dashChartBars     = jQuery( '.chartjs-bars' )[0].getContext( '2d' );
		$dashChartLines    = jQuery( '.chartjs-lines' )[0].getContext( '2d' );

	var $ChartBarsData = {
		labels: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'],
		datasets: [
			{
				label: '当前每月注册人数',
                borderWidth: 1,
                borderColor: 'rgba(0,0,0,0)',
				backgroundColor: 'rgba(72,116,207,0.7)',
                hoverBackgroundColor: "rgba(72,176,247,1)",
                hoverBorderColor: "rgba(0,0,0,0)",
				data: [2550, 1550, 1600, 3300, 4800, 3500, 1600, 2510, 2200, 1800, 3900, 1800]
			},
			{
				label: '同期每月注册人数',
                borderWidth: 1,
                borderColor: 'rgba(0,0,0,0)',
				backgroundColor: 'rgba(170,221,255,0.7)',
                hoverBackgroundColor: "rgba(170,221,255,1)",
                hoverBorderColor: "rgba(0,0,0,0)",
				data: [2050, 1590, 1900, 3000, 4000, 3700, 1800, 2010, 2800, 2100, 3800, 3700]
			}
		]
	};


	var $ChartLinesData = {
		labels: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'],
		backgroundColor: ['rgba(255, 0, 0, 0.2)'],
		datasets: [
			{
				label: '当前每月收入',
				data: [50, 55, 60, 80, 75, 40, 65, 40, 68, 20, 72, 60],
				borderColor: '#69cb00',
				backgroundColor: 'rgba(103,203,0, 1)',
                borderWidth: 1,
                fill: false,
                lineTension: 0.5
			},
			{
				label: '每月同期收入',
				data: [46, 50, 52, 68, 40, 35, 65, 45, 58, 30, 72, 56],
				borderColor: '#909080',
				backgroundColor: 'rgba(144,144,128, 1)',
                borderWidth: 1,
                fill: false,
                lineTension: 0.5
			}
		]
	};

	var $dashChartBarsData = {
		labels: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'],
		datasets: [
			{
				label: '当前每月发布数',
                borderWidth: 1,
                borderColor: 'rgba(0,0,0,0)',
				backgroundColor: 'rgba(7, 191, 220,0.6)',
                hoverBackgroundColor: "rgba(7, 191, 220,1)",
                hoverBorderColor: "rgba(0,0,0,0)",
				data: [2500, 1500, 1200, 3200, 4800, 3500, 1500, 2510, 2200, 1800, 3900, 1800]
			},
			{
				label: '同期每月发布数',
                borderWidth: 1,
                borderColor: 'rgba(0,0,0,0)',
				backgroundColor: 'rgba(189, 230, 235,0.6)',
                hoverBackgroundColor: "rgba(189, 230, 235,1)",
                hoverBorderColor: "rgba(0,0,0,0)",
				data: [2000, 1600, 1800, 3500, 4900, 3800, 1900, 2510, 2200, 1800, 3900, 1800]
			}
		]
	};

    var $dashChartLinesData = {
		labels: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'],
		backgroundColor: ['rgba(255, 0, 0, 0.2)'],
		datasets: [
			{
				label: '当前每月下载数',
				data: [20, 35, 40, 30, 45, 60, 55, 40, 48, 40, 42, 50],
				borderColor: '#DA212F',
				backgroundColor: 'rgba(218,33,47, 1)',
                borderWidth: 1,
                fill: false,
                lineTension: 0.5
			},
			{
				label: '同期每月下载数',
				data: [28, 30, 30, 36, 40, 58, 59, 45, 40, 47, 49, 55],
				borderColor: '#909080',
				backgroundColor: 'rgba(144,144,128, 1)',
                borderWidth: 1,
                fill: false,
                lineTension: 0.5
			}
		]
	};
    
    new Chart($dashChartBarsCnt, {
        type: 'bar',
        data: $dashChartBarsData
    });

	new Chart($dashChartBars, {
        type: 'bar',
        data: $ChartBarsData
    });

    new Chart($dashChartLines, {
        type: 'line',
        data: $ChartLinesData
    });
    var myLineChart = new Chart($dashChartLinesCnt, {
        type: 'line',
        data: $dashChartLinesData,
    });

});
</script>
<!--
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?f3ed4f7661db7c6a64a1f8eb56083b1b";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
-->
</body>
</html>