Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
egg.eemo.co.kr
/
public_html
/
super5
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/egg.eemo.co.kr/public_html/super5/tot_5.php
<? include_once("inc_header.php"); $on_menu="statistics"; $on_sub_menu=5; ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title><?=$_TITLE?></title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="font-awesome/css/font-awesome.css" rel="stylesheet"> <link href="css/plugins/iCheck/custom.css" rel="stylesheet"> <link href="css/animate.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet"> <link href="css/plugins/datapicker/datepicker3.css" rel="stylesheet"> <link href="css/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet"> <link href="css/plugins/chosen/bootstrap-chosen.css" rel="stylesheet"> <!-- c3 Charts --> <link href="css/plugins/c3/c3.min.css" rel="stylesheet"> </head> <body class="fixed-sidebar"> <div id="wrapper"> <? include_once("inc_sidemenu.php"); ?> <div id="page-wrapper" class="gray-bg"> <? include_once("inc_top.php"); include_once("inc_now_position.php"); ?> <? //SELECT count(mem_no) as cnt, jdate FROM `exerday_app` WHERE appname='total' and weekday(jdate)=3 group by jdate order by jdate desc $arr_hour=array(); $arr_avgmon=array(); $arr_gr_mon_x=array(); $arr_gr_mon_y=array(); $arr_gr_mon_y2=array(); $arr_gr_mon_y3=array(); //SELECT count(mem_no) as cnt, hour(sdate) , avg(exertime) as etime, avg(dist) as edist, avg(calo) as ecalo FROM `exerlog_raw` WHERE date(sdate) >= '2018' and date(now()) != date(sdate) group by hour(sdate) $result=mysql_query("SELECT count(distinct mem_no) as cnt, hour(sdate) as hh , avg(exertime) as etime, avg(dist) as edist, avg(calo) as ecalo FROM `exerlog_raw` WHERE date(sdate) >= '2018' and date(now()) != date(sdate) group by hour(sdate) ") or die(mysql_error()); while($rs=mysql_fetch_array($result)) { $obj=(object) $c; $obj->hour=$rs[hh]; $obj->cnt=$rs[cnt]; $obj->exertime=$rs[etime]; $obj->dist=$rs[edist]; $obj->calo=$rs[ecalo]; $arr_hour[$rs[hh]]=$obj; $arr_gr_mon_x[$rs[hh]]="'".$rs[hh]."시'"; $arr_gr_mon_y[$rs[hh]]=round($rs[ecalo]); $arr_gr_mon_y2[$rs[hh]]=round($rs[cnt]); $arr_gr_mon_y3[$rs[hh]]=round($rs[etime]/60); } $str_gr_mon_x=implode(",",$arr_gr_mon_x); $str_gr_mon_y=implode(",",$arr_gr_mon_y); $str_gr_mon_y2=implode(",",$arr_gr_mon_y2); $str_gr_mon_y3=implode(",",$arr_gr_mon_y3); /* $prev_yy=date("Y",strtotime("-1 month")); $prev_mm=date("m",strtotime("-1 month")); echo $prev_date; $result=mysql_query("SELECT hour(sdate) as hh , avg(exertime) as etime, avg(dist) as edist, avg(calo) as ecalo FROM `exerlog_raw` WHERE year(sdate) = '$prev_yy' and month(sdate) = '$prev_mm' group by mem_no ") or die(mysql_error()); while($rs=mysql_fetch_array($result)) { } */ ?> <div class="wrapper wrapper-content animated fadeInRight"> <div class="row"> <div class="col-lg-12"> <div class="ibox "> <div class="ibox-title"> <h5>시간대별 월평균 운동량 (2018년 이후통계)</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#" class="dropdown-item">Config option 1</a> </li> <li><a href="#" class="dropdown-item">Config option 2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <div class="table-responsive"> <table class="table"> <thead> <tr> <th></th> <? foreach($arr_hour as $ak => $av) { ?><th><?=$av->hour?>시</th><? } ?> </tr> </thead> <tbody> <tr> <td>(시간대별) 평균칼로리 (kcal)</td> <? foreach($arr_hour as $ak => $av) { ?><td><?=number_format($av->calo)?></td><? } ?> </tr> <tr> <td>(시간대별) 평균 운동시간</td> <? foreach($arr_hour as $ak => $av) { ?><td> <? $vv=SecToTime($av->exertime); $exp_vv=explode(":",$vv); //echo number_format($exp_vv[0])." 시 ". $exp_vv[1]." 분"; echo $vv; ?> </td><? } ?> </tr> <tr> <td>(시간대별) 평균 운동거리 (km)</td> <? foreach($arr_hour as $ak => $av) { ?><td><?=number_format($av->dist/1000)?></td><? } ?> </tr> <tr> <td>(시간대별) 인원수 (명)</td> <? $n=0; foreach($arr_hour as $ak => $av) { ?><td><?=number_format($av->cnt)?> 명</td><? $n++; } ?> </tr> </tbody> </table> </div> </div><!--//ibox--> </div> </div> </div><!--row--> <div class="row"> <div class="col-lg-12"> <div class="ibox "> <div class="ibox-title"> <h5>Line Chart <small>시간대별 이용자수</small> </h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#" class="dropdown-item">Config option 1</a> </li> <li><a href="#" class="dropdown-item">Config option 2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <div> <div id="month_avg_calo_lineChart"></div> </div> </div><!--//ibox--> </div> </div> </div><!--row--> </div> <? include_once("inc_footer.php"); ?> </div> </div> <!-- Mainly scripts --> <script src="js/jquery-3.1.1.min.js"></script> <script src="js/popper.min.js"></script> <script src="js/bootstrap.js"></script> <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> <script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script> <!-- Custom and plugin javascript --> <script src="js/inspinia.js"></script> <script src="js/plugins/pace/pace.min.js"></script> <!-- d3 and c3 charts --> <script src="js/plugins/d3/d3.min.js"></script> <script src="js/plugins/c3/c3.min.js"></script> <script> $(document).ready(function(){ c3.generate({ bindto: '#month_avg_calo_lineChart', data:{ columns: [ ['시간대별 이용자수', <?=$str_gr_mon_y2?>], ], colors:{ '시간대별 이용자수': '#1ab394', } }, axis: { x: { type: 'category', categories: [<?=$str_gr_mon_x?>] } } }); }); </script> </body> </html> <script> </script>