diff --git a/include/controllers/default/cockpit/charts/community.php b/include/controllers/default/cockpit/charts/community.php index 3ea609e04..d61485e33 100644 --- a/include/controllers/default/cockpit/charts/community.php +++ b/include/controllers/default/cockpit/charts/community.php @@ -24,6 +24,11 @@ class Controller_charts_community extends Crunchbutton_Controller_Account { $communities = $_communities; } c::view()->communities = $communities; - c::view()->display( 'charts/community/index' ); + + if( c::getPagePiece( 2 ) == 'delivery-tips' ){ + c::view()->display( 'charts/community/delivery_tips' ); + } else { + c::view()->display( 'charts/community/index' ); + } } } \ No newline at end of file diff --git a/include/library/Crunchbutton/Chart/User.php b/include/library/Crunchbutton/Chart/User.php index 836b546a9..bd1fea10d 100644 --- a/include/library/Crunchbutton/Chart/User.php +++ b/include/library/Crunchbutton/Chart/User.php @@ -1264,9 +1264,9 @@ class Crunchbutton_Chart_User extends Crunchbutton_Chart { $days = intval( $interval->format('%d') ); if( $days <= 4 ){ $_data[ $week ][ 'Power' ]++; } - if( $days > 4 && $days < 11 ){ $_data[ $week ][ 'Weekly' ]++; } - if( $days > 11 && $days < 18 ){ $_data[ $week ][ 'Bi-Weekly' ]++; } - if( $days > 18 && $days < 25 ){ $_data[ $week ][ 'Tri-Weekly' ]++; } + if( $days > 4 && $days <= 11 ){ $_data[ $week ][ 'Weekly' ]++; } + if( $days > 11 && $days <= 18 ){ $_data[ $week ][ 'Bi-Weekly' ]++; } + if( $days > 18 && $days <= 25 ){ $_data[ $week ][ 'Tri-Weekly' ]++; } if( $days > 25 ){ $_data[ $week ][ 'Monthly' ]++; } } } diff --git a/include/views/default/cockpit/charts/community/delivery_tips.phtml b/include/views/default/cockpit/charts/community/delivery_tips.phtml new file mode 100644 index 000000000..b3e741445 --- /dev/null +++ b/include/views/default/cockpit/charts/community/delivery_tips.phtml @@ -0,0 +1,166 @@ + + $this->title = 'Community metrics'; + $this->subtitle = 'Crunchbutton overview'; + $this->titleicon = 'bar-chart'; + + $communities = $this->communities; + +?> +