Exemplo n.º 1
0
 public function feed()
 {
     if (!class_exists('vmRSS')) {
         require VMPATH_ADMIN . '/helpers/vmrss.php';
     }
     $this->virtuemartFeed = vmRSS::getVirtueMartRssFeed();
     $this->extensionsFeed = vmRSS::getExtensionsRssFeed();
     $document = JFactory::getDocument();
     $headData = $document->getHeadData();
     $headData['scripts'] = array();
     $document->setHeadData($headData);
     ob_clean();
     ob_start();
     include VMPATH_SITE . DS . 'views' . DS . 'virtuemart' . DS . 'tmpl' . DS . 'feed.php';
     echo ob_get_clean();
     jExit();
 }
Exemplo n.º 2
0
	function display($tpl = null) {

		if (!class_exists('VmImage'))
			require(VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php');
		VmConfig::loadJLang('com_virtuemart_orders',TRUE);

		$model = VmModel::getModel('virtuemart');

		$nbrCustomers = $model->getTotalCustomers();
		$this->nbrCustomers=$nbrCustomers;

		$nbrActiveProducts = $model->getTotalActiveProducts();
		$this->nbrActiveProducts= $nbrActiveProducts;
		$nbrInActiveProducts = $model->getTotalInActiveProducts();
		$this->nbrInActiveProducts= $nbrInActiveProducts;
		$nbrFeaturedProducts = $model->getTotalFeaturedProducts();
		$this->nbrFeaturedProducts= $nbrFeaturedProducts;

		$ordersByStatus = $model->getTotalOrdersByStatus();
		$this->ordersByStatus= $ordersByStatus;

		$recentOrders = $model->getRecentOrders();
			if(!class_exists('CurrencyDisplay'))require(VMPATH_ADMIN.DS.'helpers'.DS.'currencydisplay.php');

			/* Apply currency This must be done per order since it's vendor specific */
			$_currencies = array(); // Save the currency data during this loop for performance reasons
			foreach ($recentOrders as $virtuemart_order_id => $order) {

				//This is really interesting for multi-X, but I avoid to support it now already, lets stay it in the code
				if (!array_key_exists('v'.$order->virtuemart_vendor_id, $_currencies)) {
					$_currencies['v'.$order->virtuemart_vendor_id] = CurrencyDisplay::getInstance('',$order->virtuemart_vendor_id);
				}
				$order->order_total = $_currencies['v'.$order->virtuemart_vendor_id]->priceDisplay($order->order_total);
			}
		$this->recentOrders= $recentOrders;
		$recentCustomers = $model->getRecentCustomers();
		$this->recentCustomers=$recentCustomers;

		if (!class_exists('vmRSS')) require(VMPATH_ADMIN.'/helpers/vmrss.php');

		$this->extensionsFeed = vmRSS::getExtensionsRssFeed();

		$virtuemartFeed = vmRSS::getVirtueMartRssFeed();
		$this->virtuemartFeed=$virtuemartFeed;

		if(JFactory::getApplication()->isSite()){
			$bar = JToolBar::getInstance('toolbar');
			$bar->appendButton('Link', 'back', 'COM_VIRTUEMART_LEAVE', 'index.php?option=com_virtuemart&manage=0');
		}

		if($this->manager('report')){
			vmSetStartTime('report');
			$reportModel		= VmModel::getModel('report');
			vRequest::setvar('task','');
			$myCurrencyDisplay = CurrencyDisplay::getInstance();
			$revenueBasic = $reportModel->getRevenue(60,true);
			$this->report = $revenueBasic['report'];

			vmJsApi::addJScript( "jsapi","//google.com/jsapi",false,false,'' );
			vmJsApi::addJScript('vm.stats_chart',$revenueBasic['js'],false);
			vmTime('Created report','report');
		}

		parent::display($tpl);
	}