本文整理汇总了PHP中KSSystem::getController方法的典型用法代码示例。如果您正苦于以下问题:PHP KSSystem::getController方法的具体用法?PHP KSSystem::getController怎么用?PHP KSSystem::getController使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KSSystem
的用法示例。
在下文中一共展示了KSSystem::getController方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
public function display($tpl = null)
{
$_session = JFactory::getSession();
$model_account = KSSystem::getModel('account');
$controller = KSSystem::getController('account');
$this->title = JText::_('KM_CATALOG_YA_MARKET');
$model = $this->getModel('yamarket');
$app = JFactory::getApplication();
$this->document->addScript(JURI::base() . 'components/com_ksenmart/js/yamarket.js');
$this->document->addStyleSheet(JURI::base() . 'components/com_ksenmart/css/yamarket.css');
if (!$model_account->checkAuthorize()) {
$app->redirect('index.php?option=com_ksenmart&view=account&layout=default_login');
} else {
$uid = $model_account->getUserId();
if (!empty($uid) && $uid > 0) {
$layout = $this->getLayout();
$params = $model->getUserParams($uid);
if (empty($params->ya_site_id)) {
$app->redirect('index.php?option=com_ksenmart', 'KM_YA_MARKET_ACCESS_DENIED');
exit;
}
$shop_info = $model->getUserShopInfo($params->ya_site_id);
switch ($layout) {
case 'stat-placement':
$jinput = $app->input;
$fromDate = $jinput->get('fromDate', date('Y-m-d'), 'string');
$toDate = $jinput->get('toDate', date('Y-m-d'), 'string');
$groupBy = $jinput->get('groupBy', 'daily', 'string');
$this->path->addItem(JText::_('KM_YA_MARKET'), 'index.php?option=com_ksenmart&view=yamarket');
$this->path->addItem(JText::_('KM_YA_HITS_FOR_PLACEMENTS'));
$statistic = $model->getShopStatisticByPlacesFull($fromDate, $toDate, $groupBy);
$groupByList = JHTML::_('select.genericlist', array('daily' => 'дням', 'weekly' => 'неделям', 'monthly' => 'месяцам'), 'groupBy', 'class="inputbox"', 'value', 'text', $groupBy);
$this->assignRef('statistic', $statistic);
$this->assignRef('fromDate', $fromDate);
$this->assignRef('toDate', $toDate);
$this->assignRef('groupByList', $groupByList);
break;
case 'clicks-report-search':
$jinput = $app->input;
$groupBy = $jinput->get('groupBy', '-1', 'string');
$this->path->addItem(JText::_('KM_YA_MARKET'), 'index.php?option=com_ksenmart&view=yamarket');
$this->path->addItem(JText::_('KM_YA_CLICKS_REPORT_SEARCH'));
$offersStatistic = $model->getShopOffersStatistic($groupBy, true);
$groupByList = JHTML::_('select.genericlist', array('-1' => 'вчера', '-7' => '7 дней', '-30' => '30 дней'), 'groupBy', 'class="inputbox"', 'value', 'text', $groupBy);
$this->assignRef('offersStatistic', $offersStatistic);
$this->assignRef('groupByList', $groupByList);
break;
default:
$offers = $this->get('ShopOffers');
$balance = $this->get('ShopBalance');
$statistic = $this->get('ShopStatistic');
$statisticByPlaces = $this->get('ShopStatisticByPlaces');
$offersStatistic = $this->get('ShopOffersStatistic');
/*$test = $this->get('Test');
print_r($test);*/
$this->assignRef('params', $params);
$this->assignRef('offers', $offers);
$this->assignRef('balance', $balance);
$this->assignRef('statistic', $statistic);
$this->assignRef('statisticByPlaces', $statisticByPlaces);
$this->assignRef('offersStatistic', $offersStatistic);
$this->assignRef('shop_info', $shop_info);
break;
}
}
}
parent::display($tpl);
}