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_2.php
<? include_once("inc_header.php"); $on_menu="statistics"; $on_sub_menu=2; ?> <!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"); ?> <? $arr_yo=array("0"=>"월","1"=>"화","2"=>"수","3"=>"목","4"=>"금","5"=>"토","6"=>"일"); //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_avgyo=array(0=>array(),1=>array(),2=>array(),3=>array(),4=>array(),5=>array(),6=>array(),7=>array()); $arr_avgyo_avg=array(); $arr_gr_mon_x=array(); $arr_gr_mon_y=array(); $arr_gr_mon_y2=array(); $arr_gr_mon_y3=array(); $result=mysql_query("select avg(a.cnt) as cnt3, a.yo, avg(a.etime) as etime, avg(a.edist) as edist, avg(a.ecalo) as ecalo from (SELECT count(mem_no) as cnt, jdate, weekday(jdate) as yo, avg(exertime) as etime, avg(dist) as edist, avg(calo) as ecalo FROM `exerday_app` WHERE appname='total' and year(jdate) >= '2018' group by weekday(jdate) , jdate) as a group by a.yo ") or die(mysql_error()); while($rs=mysql_fetch_array($result)) { $arr_avgyo_avg[$rs[yo]]=$rs[cnt3]; $obj=(object) $c; $obj->yo=$arr_yo[$rs[yo]]; $obj->jmonth=$rs[jmonth]; $obj->exertime=$rs[etime]; $obj->dist=$rs[edist]; $obj->calo=$rs[ecalo]; $arr_avgmon[$rs[yo]]=$obj; $arr_gr_mon_x[$rs[yo]]="'".$arr_yo[$rs[yo]]."'"; $arr_gr_mon_y[$rs[yo]]=round($rs[ecalo]); $arr_gr_mon_y2[$rs[yo]]=round($arr_avgyo_avg[$rs[yo]]); $arr_gr_mon_y3[$rs[yo]]=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); /* for($n=0;$n<=6;$n++) { $rs=RS("select avg(a.cnt) as cnt from (SELECT count(mem_no) as cnt FROM `exerday_app` WHERE appname='total' and year(jdate) >= '2018' and weekday(jdate)='$n' group by jdate) as a "); $arr_avgyo_avg[$n]=$rs[cnt]; } */ /* $query="SELECT count(mem_no) as cnt, jdate FROM `exerday_app` WHERE appname='total' and year(jdate) >= '2018' and weekday(jdate)=0 group by jdate order by jdate desc "; $result=mysql_query($query) or die(mysql_error()); while($rs=mysql_fetch_array($result)) { array_push($arr_avgyo[0],$rs[cnt]); } $arr_avgyo_avg[0]=array_sum($arr_avgyo[0]) / count(array_filter($arr_avgyo[0])); $rs=RS("select avg(a.cnt) as cnt from (SELECT count(mem_no) as cnt FROM `exerday_app` WHERE appname='total' and year(jdate) >= '2018' and weekday(jdate)=1 group by jdate) as a "); $arr_avgyo_avg[1]=$rs[cnt]; $query="SELECT count(mem_no) as cnt, jdate FROM `exerday_app` WHERE appname='total' and year(jdate) >= '2018' and weekday(jdate)=2 group by jdate order by jdate desc "; $result=mysql_query($query) or die(mysql_error()); while($rs=mysql_fetch_array($result)) { array_push($arr_avgyo[2],$rs[cnt]); } $arr_avgyo_avg[2]=array_sum($arr_avgyo[2]) / count(array_filter($arr_avgyo[2])); $query="SELECT count(mem_no) as cnt, jdate FROM `exerday_app` WHERE appname='total' and year(jdate) >= '2018' and weekday(jdate)=3 group by jdate order by jdate desc "; $result=mysql_query($query) or die(mysql_error()); while($rs=mysql_fetch_array($result)) { array_push($arr_avgyo[3],$rs[cnt]); } $arr_avgyo_avg[3]=array_sum($arr_avgyo[3]) / count(array_filter($arr_avgyo[3])); $query="SELECT count(mem_no) as cnt, jdate FROM `exerday_app` WHERE appname='total' and year(jdate) >= '2018' and weekday(jdate)=4 group by jdate order by jdate desc "; $result=mysql_query($query) or die(mysql_error()); while($rs=mysql_fetch_array($result)) { array_push($arr_avgyo[4],$rs[cnt]); } $arr_avgyo_avg[4]=array_sum($arr_avgyo[4]) / count(array_filter($arr_avgyo[4])); $query="SELECT count(mem_no) as cnt, jdate FROM `exerday_app` WHERE appname='total' and year(jdate) >= '2018' and weekday(jdate)=5 group by jdate order by jdate desc "; $result=mysql_query($query) or die(mysql_error()); while($rs=mysql_fetch_array($result)) { array_push($arr_avgyo[5],$rs[cnt]); } $arr_avgyo_avg[5]=array_sum($arr_avgyo[5]) / count(array_filter($arr_avgyo[5])); $query="SELECT count(mem_no) as cnt, jdate FROM `exerday_app` WHERE appname='total' and year(jdate) >= '2018' and weekday(jdate)=6 group by jdate order by jdate desc "; $result=mysql_query($query) or die(mysql_error()); while($rs=mysql_fetch_array($result)) { array_push($arr_avgyo[6],$rs[cnt]); } $arr_avgyo_avg[6]=array_sum($arr_avgyo[6]) / count(array_filter($arr_avgyo[6])); */ //$query="SELECT weekday(jdate) as yo, count(distinct id) as cnt, count(id) as cnt2, avg(exertime) as etime, avg(dist) as edist, avg(calo) as ecalo FROM exerday_app where appname='total' and year(jdate) >= '2018' group by weekday(jdate) order by weekday(jdate) asc "; //$result=mysql_query($query) or die(mysql_error()); /* $arr_avgmon=array(); while($rs=mysql_fetch_array($result)) { $obj=(object) $c; $obj->yo=$arr_yo[$rs[yo]]; $obj->jmonth=$rs[jmonth]; $obj->exertime=$rs[etime]; $obj->dist=$rs[edist]; $obj->calo=$rs[ecalo]; $arr_avgmon[$rs[yo]]=$obj; $arr_gr_mon_x[$rs[yo]]="'".$arr_yo[$rs[yo]]."'"; $arr_gr_mon_y[$rs[yo]]=round($rs[ecalo]); $arr_gr_mon_y2[$rs[yo]]=round($arr_avgyo_avg[$rs[yo]]); $arr_gr_mon_y3[$rs[yo]]=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); */ ?> <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_avgmon as $ak => $av) { ?><th><?=$av->yo?></th><? } ?> </tr> </thead> <tbody> <tr> <td>(인당평균) 칼로리 (kcal)</td> <? foreach($arr_avgmon as $ak => $av) { ?><td><?=number_format($av->calo)?></td><? } ?> </tr> <tr> <td>(인당평균) 운동시간 (시:분:초)</td> <? foreach($arr_avgmon 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_avgmon as $ak => $av) { ?><td><?=number_format($av->dist/1000)?></td><? } ?> </tr> <tr> <td>평균 인원수 (명)</td> <? $n=0; foreach($arr_avgmon as $ak => $av) { ?><td><?=number_format($arr_avgyo_avg[$n])?> 명</td><? $n++; } ?> </tr> <!-- <tr> <td>명수 (명)</td> <? foreach($arr_avgmon as $ak => $av) { ?><td><?=number_format($av->mem_cnt2)?></td><? } ?> </tr> <tr> <td>회원수 (명)</td> <? foreach($arr_avgmon as $ak => $av) { ?><td><?=number_format($av->mem_cnt)?></td><? } ?> </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>요일별 평균 칼로리 ( y 축 : kcal )</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 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_lineChart2"></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_y?>], ], colors:{ '인당 평균칼로리': '#1ab394', } }, axis: { x: { type: 'category', categories: [<?=$str_gr_mon_x?>] } } }); c3.generate({ bindto: '#month_avg_calo_lineChart2', data:{ columns: [ ['평균 인원수(명)', <?=$str_gr_mon_y2?>], ], colors:{ '평균 인원수(명)': '#1ab394', } }, axis: { x: { type: 'category', categories: [<?=$str_gr_mon_x?>] } } }); }); </script> </body> </html> <script> </script>