本文整理匯總了PHP中Dashboard::get_chart_visits方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dashboard::get_chart_visits方法的具體用法?PHP Dashboard::get_chart_visits怎麽用?PHP Dashboard::get_chart_visits使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Dashboard
的用法示例。
在下文中一共展示了Dashboard::get_chart_visits方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: action_dashboard
/**
* Admin dashboard view
*
* @access public
* @return void
*/
public function action_dashboard($type = 'm')
{
$orders = \Dashboard::get_order($type);
$visitors = \Dashboard::get_visits($type);
$c_orders = \Dashboard::get_chart_order($type);
$co_html = '';
foreach ($c_orders as $order) {
$co_html .= '[' . (int) $order['MNTH'] . ', ' . (double) $order['total_price'] . ']';
$co_html .= ',';
}
$c_visits = \Dashboard::get_chart_visits();
$visits_html = '';
foreach ($c_visits as $order) {
$visits_html .= '[' . (int) $order['MNTH'] . ', ' . (double) $order['visits'] . ']';
$visits_html .= ',';
}
if ($type == 'd') {
$type = 'Today';
} elseif ($type == 'm') {
$type = 'This Month';
} elseif ($type == 'y') {
$type = 'This Year';
} else {
$type = 'This Week';
}
$users = \Sentry::user()->all('front');
// if(!empty($users))
// {
// foreach($users as $key => $item)
// {
// $user_tmp = \Sentry::user((int)$item['id']);
// if($user_tmp->get('metadata.guest') == 1)
// unset($users[$key]);
// else
// $users[$key] = $user_tmp;
// }
// }
$items['orders'] = $orders[0]['total_order'];
$items['sales'] = $orders[0]['total_sales'];
$items['visits'] = $visitors[0]['visits'];
$items['users'] = count($users);
$items['chart_orders'] = $co_html;
$items['chart_visits'] = $visits_html;
$items['type'] = $type;
//\View::set_global('full_page', true);
\View::set_global('title', 'Dashboard');
\Theme::instance()->set_partial('content', $this->view_dir . 'dashboard')->set('items', $items);
}