当前位置: 首页>>代码示例>>PHP>>正文


PHP vRequest::setvar方法代码示例

本文整理汇总了PHP中vRequest::setvar方法的典型用法代码示例。如果您正苦于以下问题:PHP vRequest::setvar方法的具体用法?PHP vRequest::setvar怎么用?PHP vRequest::setvar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vRequest的用法示例。


在下文中一共展示了vRequest::setvar方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: display

	/**
	 * Render the view
	 */
	function display($tpl = null){

		if (!class_exists('VmHTML'))
			require(VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php');
		if (!class_exists('CurrencyDisplay'))
			require(VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php');


		$model		= VmModel::getModel();

		vRequest::setvar('task','');

		$this->SetViewTitle('REPORT');

		$myCurrencyDisplay = CurrencyDisplay::getInstance();

		//update order items button
		/*$q = 'SELECT * FROM #__virtuemart_order_items WHERE `product_discountedPriceWithoutTax` IS NULL ';
		$db = JFactory::getDBO();
		$db->setQuery($q);
		$res = $db->loadRow();
		if($res) {
			JToolBarHelper::custom('updateOrderItems', 'new', 'new', vmText::_('COM_VIRTUEMART_REPORT_UPDATEORDERITEMS'),false);
			vmError('COM_VIRTUEMART_REPORT_UPDATEORDERITEMS_WARN');
		}*/

		$this->addStandardDefaultViewLists($model);
		$revenueBasic = $model->getRevenue();

		if($revenueBasic){
			$totalReport['revenueTotal_brutto']= $totalReport['revenueTotal_netto']= $totalReport['number_of_ordersTotal'] = $totalReport['itemsSoldTotal'] = 0 ;
			foreach($revenueBasic as &$j){
				vmdebug('VirtuemartViewReport revenue',$j);
				$totalReport['revenueTotal_netto'] += $j['order_subtotal_netto'];
				$totalReport['revenueTotal_brutto'] += $j['order_subtotal_brutto'];
				$totalReport['number_of_ordersTotal'] += $j['count_order_id'];
				$j['order_subtotal_netto'] = $myCurrencyDisplay->priceDisplay($j['order_subtotal_netto']);
				$j['order_subtotal_brutto'] = $myCurrencyDisplay->priceDisplay($j['order_subtotal_brutto']);
				//$j['product_quantity'] = $model->getItemsByRevenue($j);
				$totalReport['itemsSoldTotal'] +=$j['product_quantity'];
			}
			$totalReport['revenueTotal_netto'] = $myCurrencyDisplay->priceDisplay($totalReport['revenueTotal_netto']);
			$totalReport['revenueTotal_brutto'] = $myCurrencyDisplay->priceDisplay($totalReport['revenueTotal_brutto']);
			// if ( 'product_quantity'==vRequest::getCmd('filter_order')) {
				// foreach ($revenueBasic as $key => $row) {
					// $created_on[] =$row['created_on'];
					// $intervals[] =$row['intervals'];
					// $itemsSold[] =$row['product_quantity'];
					// $number_of_orders[] =$row['count_order_id'];
					// $revenue[] =$row['revenue'];

				// }
				// if (vRequest::getCmd('filter_order_Dir') == 'desc') array_multisort($itemsSold, SORT_DESC,$revenueBasic);
				// else array_multisort($itemsSold, SORT_ASC,$revenueBasic);
			// }
		}
		$this->assignRef('report', $revenueBasic);
		$this->assignRef('totalReport', $totalReport);

		//$itemsSold = $model->getItemsSold($revenueBasic);
		//$this->assignRef('itemsSold', $itemsSold);
		// I tihnk is to use in a different layout such as product solds
		// PATRICK K.
		// $productList = $model->getOrderItems();
		// $this->assignRef('productList', $productList);

		$orderstatusM =VmModel::getModel('orderstatus');
		$this->lists['select_date'] = $model->renderDateSelectList();
		$orderstates = vRequest::getVar ('order_status_code', array('C','S'));
		$this->lists['state_list'] = $orderstatusM->renderOSList($orderstates,'order_status_code',TRUE);
		$this->lists['intervals'] = $model->renderIntervalsList();
		$this->assignRef('from_period', $model->from_period);
		$this->assignRef('until_period', $model->until_period);

		$pagination = $model->getPagination();
		$this->assignRef('pagination', $pagination);

		parent::display($tpl);
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:82,代码来源:view.html.php

示例2: display

    function display($tpl = null)
    {
        if (!class_exists('VmImage')) {
            require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php';
        }
        tsmConfig::loadJLang('com_tsmart_orders', TRUE);
        if (JFactory::getApplication()->isSite()) {
            $bar = JToolBar::getInstance('toolbar');
            $bar->appendButton('Link', 'back', 'com_tsmart_LEAVE', 'index.php?option=com_tsmart&manage=0');
        }
        $layout = $this->getLayout();
        if ($this->manager('report')) {
            vmSetStartTime('report');
            $model = tmsModel::getModel('tsmart');
            $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 $tsmart_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->tsmart_vendor_id, $_currencies)) {
                    $_currencies['v' . $order->tsmart_vendor_id] = CurrencyDisplay::getInstance('', $order->tsmart_vendor_id);
                }
                $order->order_total = $_currencies['v' . $order->tsmart_vendor_id]->priceDisplay($order->order_total);
            }
            $this->recentOrders = $recentOrders;
            $recentCustomers = $model->getRecentCustomers();
            $this->recentCustomers = $recentCustomers;
            $reportModel = tmsModel::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, true);
            vmTime('Created report', 'report');
        }
        //if($layout=='default'){
        $j = 'jQuery("#feed").ready(function(){
				var datas = "";
				vmSiteurl = "' . JURI::root() . '"
				jQuery.ajax({
						type: "GET",
						async: true,
						cache: false,
						dataType: "json",
						url: vmSiteurl + "index.php?option=com_tsmart&view=tsmart&task=feed",
						data: datas,
						dataType: "html"
					})
					.done(function( data ) {
						jQuery("#feed").append(data);
					});
				})';
        vmJsApi::addJScript('getFeed', $j, false, true);
        //}
        self::showACLPref($this);
        parent::display($tpl);
    }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:72,代码来源:view.html.php


注:本文中的vRequest::setvar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。