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


PHP FormatPriceInCurrency函数代码示例

本文整理汇总了PHP中FormatPriceInCurrency函数的典型用法代码示例。如果您正苦于以下问题:PHP FormatPriceInCurrency函数的具体用法?PHP FormatPriceInCurrency怎么用?PHP FormatPriceInCurrency使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: __construct

	public function __construct($customerId = null)
	{
		// use the same settings as orders by default
		$this->setDoubleOptIn(GetConfig('EmailIntegrationOrderDoubleOptin'));
		$this->setSendWelcome(GetConfig('EmailIntegrationOrderSendWelcome'));

		if (!$customerId) {
			return;
		}

		$entity = new ISC_ENTITY_CUSTOMER();

		$data = $entity->get($customerId);
		if (!$data) {
			throw new Interspire_EmailIntegration_Subscription_Exception();
		}

		unset($data['custpassword']);

		$this->_data = $data;
		unset($data);

		$this->setSubscriptionIP($this->_data['custregipaddress']);

		// customer custom form fields

		/** @var ISC_FORM */
		$form = $GLOBALS["ISC_CLASS_FORM"];

		// populate empty form fields as a starting point -- this makes exports of imported customers work OK because they may not have a custformsessionid, or this ensures that export data is current with configured form fields even if the stored form fields are out of date
		$formFields = $form->getFormFields(FORMFIELDS_FORM_ACCOUNT);
		foreach ($formFields as /** @var ISC_FORMFIELD_BASE */$formField) {
			if ($formField->getFieldPrivateId()) {
				continue;
			}
			$this->_data[$formField->getFieldId()] = '';
		}

		// load saved data for this customer
		if (isId($this->_data['custformsessionid'])) {
			$customFields = $form->getSavedSessionData($this->_data['custformsessionid']);
			foreach ($customFields as $fieldId => $value) {
				$this->_data['FormField_' . $fieldId] = $value;
			}
		}

		// for email integration purposes, money values must be stored in an array as both numeric and formatted to allow for translation to both number fields and text fields, while maintaining currency information
		SetupCurrency();
		$moneyFields = array('custstorecredit');
		foreach ($moneyFields as $moneyFieldId) {
			$this->_data[$moneyFieldId] = array(
				'numeric' => $this->_data[$moneyFieldId],
				'formatted' => FormatPriceInCurrency($this->_data[$moneyFieldId]),
			);
		}

		unset($this->_data['addresses']); // the addresses provided by entity class are mixed billing/shipping addresses, can't be sure so discard them
		// find last used _billing_ address for this customer by non-deleted orders
		$order = $GLOBALS['ISC_CLASS_DB']->FetchRow("SELECT ordformsessionid, ordbillstreet1, ordbillstreet2, ordbillsuburb, ordbillstate, ordbillzip, ordbillcountryid FROM `[|PREFIX|]orders` WHERE ordcustid = " . (int)$customerId . " AND deleted = 0 ORDER BY orddate DESC LIMIT 1");
		if (is_array($order)) {
			// create fields specifically for email integration based on customer data

			if (isId($order['ordformsessionid'])) {
				$customFields = $form->getSavedSessionData($order['ordformsessionid']);
				foreach ($customFields as $fieldId => $value) {
					$this->_data['CustomerSubscription_Address_FormField_' . $fieldId] = $value;
				}
			}

			$this->_data['CustomerSubscription_Address'] = array(
				'addr1' => $order['ordbillstreet1'],
				'addr2' => $order['ordbillstreet2'],
				'city' => $order['ordbillsuburb'],
				'state' => $order['ordbillstate'],
				'zip' => $order['ordbillzip'],
				'country' => GetCountryById($order['ordbillcountryid']),
				'countryiso2' => GetCountryISO2ById($order['ordbillcountryid']),
				'countryiso3' => GetCountryISO3ById($order['ordbillcountryid']),
			);

			$this->_data['CustomerSubscription_Address_address1'] = $this->_data['CustomerSubscription_Address']['addr1'];
			$this->_data['CustomerSubscription_Address_address2'] = $this->_data['CustomerSubscription_Address']['addr2'];
			$this->_data['CustomerSubscription_Address_city'] = $this->_data['CustomerSubscription_Address']['city'];
			$this->_data['CustomerSubscription_Address_state'] = $this->_data['CustomerSubscription_Address']['state'];
			$this->_data['CustomerSubscription_Address_zip'] = $this->_data['CustomerSubscription_Address']['zip'];
			$this->_data['CustomerSubscription_Address_country'] = $this->_data['CustomerSubscription_Address']['country'];
			$this->_data['CustomerSubscription_Address_countryiso2'] = $this->_data['CustomerSubscription_Address']['countryiso2'];
			$this->_data['CustomerSubscription_Address_countryiso3'] = $this->_data['CustomerSubscription_Address']['countryiso3'];
		}

		// transform customer group data if available
		if ($this->_data['customergroup']) {
			$this->_data['customergroupid'] = $this->_data['customergroup']['customergroupid'];
			$this->_data['groupname'] = $this->_data['customergroup']['groupname'];
		}
		else
		{
			$this->_data['customergroupid'] = '';
			$this->_data['groupname'] = '';
		}
//.........这里部分代码省略.........
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:Customer.php

示例2: FormatColumns

 /**
  * Applies formatting to values such as price, date and text formats
  *
  * @param array The row of data to format
  * @param array Optional subset of fields to use when performing formatting. Defaults to the entire loaded field array.
  */
 protected function FormatColumns(&$row, $fields = array())
 {
     if (!count($fields)) {
         $fields = $this->fields;
     }
     foreach ($row as $column => $value) {
         if (!isset($fields[$column])) {
             continue;
         }
         $field = $fields[$column];
         // format the value if required
         if (isset($field['format'])) {
             $format = $field['format'];
             if ($format == "number") {
                 if ($this->template['priceformat'] == "formatted") {
                     $row[$column] = FormatPriceInCurrency($value);
                 } else {
                     $row[$column] = FormatPrice($value, false, false, true);
                 }
             } elseif ($format == "date") {
                 if ($value != '0') {
                     $row[$column] = date($this->dateformat, $value);
                 } else {
                     $value = '';
                 }
             } elseif ($format == "text") {
                 // remove html tags and decode entities
                 //$decoded = html_entity_decode(strip_tags($value));
                 $decoded = $value;
                 // remove excess white space
                 $excess = preg_replace("/^(\\s+)/m", "", $decoded);
                 // replace new lines with spaces
                 $row[$column] = preg_replace("/([\\r\\n]+)/m", " ", $excess);
             } elseif ($format == "bool") {
                 $value = (bool) $value;
                 if ($this->blankforfalse && !$value) {
                     $row[$column] = "";
                 } else {
                     switch ($this->boolformat) {
                         case "onezero":
                             if ($value) {
                                 $row[$column] = "1";
                             } else {
                                 $row[$column] = "0";
                             }
                             break;
                         case "truefalse":
                             if ($value) {
                                 $row[$column] = GetLang("TrueLabel");
                             } else {
                                 $row[$column] = GetLang("FalseLabel");
                             }
                             break;
                         case "yesno":
                             if ($value) {
                                 $row[$column] = GetLang("YesLabel");
                             } else {
                                 $row[$column] = GetLang("NoLabel");
                             }
                             break;
                     }
                 }
             }
         }
     }
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:72,代码来源:class.exportfiletype.php

示例3: GetPriceFormats

 private function GetPriceFormats()
 {
     SetupCurrency();
     $currency = GetDefaultCurrency();
     $price = number_format(1543.987, $currency['currencydecimalplace'], $currency['currencydecimalstring'], '');
     $formats = array("number" => $price, "formatted" => FormatPriceInCurrency(1543.987));
     return $formats;
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:8,代码来源:class.importtemplates_1_10.php

示例4: GetOrderQuickView

 /**
  * Display the quick view for an order
  *
  * @return void
  **/
 public function GetOrderQuickView()
 {
     $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->LoadLangFile('orders');
     // Output a quick view for this order to be used on the manage orders page
     $orderId = (int) $_REQUEST['o'];
     $GLOBALS["OrderId"] = $orderId;
     // Get the details for this order from the database
     $query = "\n\t\t\t\tSELECT o.*, CONCAT(custconfirstname, ' ', custconlastname) AS custname, custconemail, custconphone, s.zonename AS shippingzonename,\n\t\t\t\t(SELECT COUNT(messageid) FROM [|PREFIX|]order_messages WHERE messageorderid=orderid AND messagestatus='unread') AS numunreadmessages\n\t\t\t\tFROM [|PREFIX|]orders o\n\t\t\t\tLEFT JOIN [|PREFIX|]customers c ON (c.customerid=o.ordcustid)\n\t\t\t\tLEFT JOIN [|PREFIX|]shipping_zones s ON (s.zoneid=o.ordshippingzoneid)\n\t\t\t\tWHERE o.orderid='" . $GLOBALS['ISC_CLASS_DB']->Quote($orderId) . "'\n\t\t\t";
     $result = $GLOBALS['ISC_CLASS_DB']->Query($query);
     if ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
         // If this user is a vendor, do they have permission to acess this order?
         if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId() && $row['ordvendorid'] != $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId()) {
             exit;
         }
         $GLOBALS['OrderDate'] = isc_date("d M Y H:i:s", $row['orddate']);
         $GLOBALS['ISC_CLASS_ADMIN_ORDERS'] = GetClass('ISC_ADMIN_ORDERS');
         $GLOBALS['OrderStatusOptions'] = $GLOBALS['ISC_CLASS_ADMIN_ORDERS']->GetOrderStatusOptions($row['ordstatus']);
         $GLOBALS['TrackingNo'] = $row['ordtrackingno'];
         $GLOBALS['NumMessages'] = $row['numunreadmessages'];
         if ($row["numunreadmessages"] == 0) {
             $GLOBALS["HideMessages"] = "none";
         }
         if (!gzte11(ISC_LARGEPRINT)) {
             $GLOBALS["HideMessageItems"] = "none";
         }
         $row['custname'] = isc_html_escape(trim($row['custname']));
         $addressDetails = array('shipfirstname' => $row['ordbillfirstname'], 'shiplastname' => $row['ordbilllastname'], 'shipcompany' => $row['ordbillcompany'], 'shipaddress1' => $row['ordbillstreet1'], 'shipaddress2' => $row['ordbillstreet2'], 'shipcity' => $row['ordbillsuburb'], 'shipstate' => $row['ordbillstate'], 'shipzip' => $row['ordbillzip'], 'shipcountry' => $row['ordbillcountry'], 'countrycode' => $row['ordbillcountrycode']);
         $GLOBALS['BillingAddress'] = ISC_ADMIN_ORDERS::BuildOrderAddressDetails($addressDetails);
         $GLOBALS['BillingEmail'] = '';
         $GLOBALS['BillingPhone'] = '';
         $GLOBALS['ShippingEmail'] = '';
         $GLOBALS['ShippingPhone'] = '';
         // For the iPhone's "Map This" feature
         $GLOBALS['OneLineBillingAddress'] = trim(isc_html_escape($row['ordbillstreet1'] . ' ' . $row['ordbillstreet2'] . ' ' . $row['ordbillsuburb'] . ' ' . $row['ordbillstate'] . ' ' . $row['ordbillzip'] . ' ' . $row['ordbillcountry']));
         $GLOBALS['OneLineShippingAddress'] = trim(isc_html_escape($row['ordshipstreet1'] . ' ' . $row['ordshipstreet2'] . ' ' . $row['ordshipsuburb'] . ' ' . $row['ordshipstate'] . ' ' . $row['ordshipzip'] . ' ' . $row['ordshipcountry']));
         // This customer still exists, use their most recent email address and phone number
         if ($row['custname'] != '') {
             $GLOBALS['BillingEmail'] = sprintf('<a href="mailto:%s" target="_blank">%s</a>', urlencode($row['custconemail']), isc_html_escape($row['custconemail']));
             $GLOBALS['ShippingEmail'] = sprintf('<a href="mailto:%s" target="_blank">%s</a>', urlencode($row['custconemail']), isc_html_escape($row['custconemail']));
             if ($row['ordbillphone'] != '') {
                 $GLOBALS['BillingPhone'] = isc_html_escape($row['ordbillphone']);
             } else {
                 $GLOBALS['BillingPhone'] = isc_html_escape($row['custconphone']);
             }
             if ($row['ordshipphone'] != '') {
                 $GLOBALS['ShippingPhone'] = isc_html_escape($row['ordshipphone']);
             } else {
                 $GLOBALS['ShippingPhone'] = isc_html_escape($row['custconphone']);
             }
         } else {
             if ($row['ordbillphone'] != '' || $row['ordbillemail'] != '' || $row['ordshipphone'] != '' || $row['ordshipemail'] != '') {
                 $GLOBALS['BillingEmail'] = sprintf('<a href="mailto:%s" target="_blank">%s</a>', $row['ordbillemail'], $row['ordbillemail']);
                 $GLOBALS['BillingPhone'] = isc_html_escape($row['ordbillphone']);
                 $GLOBALS['ShippingEmail'] = sprintf('<a href="mailto:%s" target="_blank">%s</a>', $row['ordshipemail'], $row['ordshipemail']);
                 $GLOBALS['ShippingPhone'] = isc_html_escape($row['ordshipphone']);
             }
         }
         if ($GLOBALS['BillingPhone'] === '') {
             $GLOBALS['BillingPhone'] = GetLang('NA');
         }
         if ($GLOBALS['BillingEmail'] === '') {
             $GLOBALS['BillingEmail'] = GetLang('NA');
         }
         if ($GLOBALS['ShippingPhone'] === '') {
             $GLOBALS['ShippingPhone'] = GetLang('NA');
         }
         if ($GLOBALS['ShippingEmail'] === '') {
             $GLOBALS['ShippingEmail'] = GetLang('NA');
         }
         $GLOBALS['PaymentMethod'] = array();
         if ($row['orderpaymentmethod'] == '') {
             $row['orderpaymentmethod'] = "N/A";
         }
         if ($row['orderpaymentmethod'] != "storecredit" && $row['orderpaymentmethod'] != "giftcertificate") {
             if ($row['ordgatewayamount']) {
                 $row['orderpaymentmethod'] .= " (" . FormatPriceInCurrency($row['ordgatewayamount'], $row['orddefaultcurrencyid']) . ")";
             } else {
                 $row['orderpaymentmethod'] .= " (" . FormatPriceInCurrency($row['ordtotalamount'], $row['orddefaultcurrencyid']) . ")";
             }
             // Does the payment method have any extra info to show?
             $provider = null;
             $GLOBALS['ExtraInfo'] = '';
             if (GetModuleById('checkout', $provider, $row['orderpaymentmodule'])) {
                 if (method_exists($provider, "DisplayPaymentDetails")) {
                     $GLOBALS['ExtraInfo'] = $provider->DisplayPaymentDetails($row);
                 }
             }
             $GLOBALS['PaymentMethod'][] = $row['orderpaymentmethod'];
         }
         if ($row['ordstorecreditamount'] > 0) {
             $GLOBALS['PaymentMethod'][] = GetLang('PaymentStoreCredit') . " (" . FormatPriceInCurrency($row['ordstorecreditamount'], $row['orddefaultcurrencyid']) . ")";
         }
         if ($row['ordgiftcertificateamount'] > 0 && gzte11(ISC_LARGEPRINT)) {
             $GLOBALS['PaymentMethod'][] = sprintf(GetLang('PaymentGiftCertificates'), $row['orderid']) . " (" . FormatPriceInCurrency($row['ordgiftcertificateamount'], $row['orddefaultcurrencyid']) . ")";
         }
//.........这里部分代码省略.........
开发者ID:nirvana-info,项目名称:old_bak,代码行数:101,代码来源:class.remote_dec04.php

示例5: ManageOrdersGrid


//.........这里部分代码省略.........
         }
     } else {
         $GLOBALS['Nav'] = "";
     }
     if (isset($_GET['searchQuery'])) {
         $query = $_GET['searchQuery'];
     } else {
         $query = "";
     }
     $GLOBALS['Nav'] = rtrim($GLOBALS['Nav'], ' |');
     $GLOBALS['SmallNav'] = rtrim($GLOBALS['SmallNav'], ' |');
     $GLOBALS['SearchQuery'] = $query;
     $GLOBALS['SortField'] = $sortField;
     $GLOBALS['SortOrder'] = $sortOrder;
     $sortLinks = array("Id" => "orderid", "Cust" => "custname", "Date" => "orddate", "Status" => "ordstatus", "Message" => "newmessages", "Total" => "ordtotalamount", "Review" => "ordoverview");
     BuildAdminSortingLinks($sortLinks, "index.php?ToDo=viewOrders&amp;" . $searchURL . "&amp;page=" . $page, $sortField, $sortOrder);
     // Workout the maximum size of the array
     $max = $start + ISC_ORDERS_PER_PAGE;
     if ($max > count($orderResult)) {
         $max = count($orderResult);
     }
     if (!gzte11(ISC_LARGEPRINT)) {
         $GLOBALS['HideOrderMessages'] = "none";
         $GLOBALS['CustomerNameSpan'] = 2;
     }
     // Display the orders
     while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($orderResult)) {
         $GLOBALS['OrderId'] = $row['orderid'];
         $GLOBALS['CustomerId'] = $row['ordcustid'];
         $GLOBALS['OrderId1'] = $row['orderid'];
         $GLOBALS['Customer'] = isc_html_escape($row['custname']);
         $GLOBALS['Date'] = isc_date(GetConfig('DisplayDateFormat'), $row['orddate']);
         $GLOBALS['OrderStatusOptions'] = $this->GetOrderStatusOptions($row['ordstatus']);
         $GLOBALS['Total'] = FormatPriceInCurrency($row['ordtotalamount'], $row['orddefaultcurrencyid'], null, true);
         $GLOBALS['GatewayTotal'] = FormatPriceInCurrency($row['ordgatewayamount'], $row['orddefaultcurrencyid'], null, true);
         $GLOBALS['TrackingNo'] = isc_html_escape($row['ordtrackingno']);
         $orderreview = '';
         switch ($row['ordoverview']) {
             case 0:
                 $orderreview = GetLang('OviewRequestNo');
                 break;
             case 1:
                 $orderreview = GetLang('OviewRequestYes');
                 break;
             case 2:
                 $orderreview = GetLang('OviewRequestSure');
                 break;
             default:
                 $orderreview = GetLang('OviewRequestNo');
                 break;
         }
         $GLOBALS['Review'] = $orderreview;
         // Look up the country for the IP address of this order
         if (gzte11(ISC_LARGEPRINT)) {
             $suspiciousOrder = false;
             $GLOBALS['FlagCellClass'] = $GLOBALS['FlagCellTitle'] = '';
             if ($row['ordgeoipcountrycode'] != '') {
                 $flag = strtolower($row['ordgeoipcountrycode']);
                 // If the GeoIP based country code and the billing country code don't match, we flag this order as a different colour
                 if (strtolower($row['ordgeoipcountrycode']) != strtolower($row['ordbillcountrycode'])) {
                     $GLOBALS['FlagCellClass'] = "Suspicious";
                     $suspiciousOrder = true;
                 }
                 $countryName = $row['ordgeoipcountry'];
             } else {
                 $flag = strtolower($row['ordbillcountrycode']);
开发者ID:nirvana-info,项目名称:old_bak,代码行数:67,代码来源:class.orders.php

示例6: GetListRow

 public function GetListRow($row)
 {
     $new_row['ID'] = $row['orderid'];
     $new_row['Customer'] = $row['custname'];
     $new_row['Date'] = isc_date(GetConfig('DisplayDateFormat'), $row['orddate']);
     if ($row['ordstatus'] == 0) {
         $new_row['Status'] = GetLang('Incomplete');
     } else {
         $new_row['Status'] = $row['ordstatustext'];
     }
     $new_row['Tracking No.'] = $row['ordtrackingno'];
     $new_row['Total'] = FormatPriceInCurrency($row['ordtotalamount'], $row['orddefaultcurrencyid'], null, true);
     return $new_row;
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:14,代码来源:orders.php

示例7: ManageOrdersGrid


//.........这里部分代码省略.........
			$sortLinks = array(
				"Id" => "orderid",
				"Cust" => "custname",
				"Date" => "orddate",
				"Status" => "ordstatus",
				"Message" => "newmessages",
				"Total" => "total_inc_tax"
			);
			BuildAdminSortingLinks($sortLinks, "index.php?ToDo=viewOrders&amp;".http_build_query($sortURL)."&amp;page=".$page, $sortField, $sortOrder);

			// Workout the maximum size of the array
			$max = $start + $perPage;

			if ($max > count($orderResult)) {
				$max = count($orderResult);
			}

			if(!gzte11(ISC_LARGEPRINT)) {
				$GLOBALS['HideOrderMessages'] = "none";
				$GLOBALS['CustomerNameSpan'] = 2;
			}

			// Display the orders
			while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($orderResult)) {
				$this->template->assign('order', $row);
				$GLOBALS['OrderId'] = $row['orderid'];
				$GLOBALS['CustomerId'] = $row['ordcustid'];
				$GLOBALS['OrderId1'] = $row['orderid'];
				$GLOBALS['Customer'] = isc_html_escape($row['custname']);

				$GLOBALS['Date'] = isc_date(GetConfig('DisplayDateFormat'), $row['orddate']);
				$GLOBALS['OrderStatusOptions'] = $this->GetOrderStatusOptions($row['ordstatus']);

				$GLOBALS['Total'] = FormatPriceInCurrency($row['total_inc_tax'], $row['orddefaultcurrencyid'], null, true);

				$GLOBALS['NotesIcon'] = "";
				$GLOBALS['CommentsIcon'] = "";

				// Look up the country for the IP address of this order
				if(gzte11(ISC_LARGEPRINT)) {
					$suspiciousOrder = false;
					$GLOBALS['FlagCellClass'] = $GLOBALS['FlagCellTitle'] = '';
					if($row['ordgeoipcountrycode'] != '') {
						$flag = strtolower($row['ordgeoipcountrycode']);
						// If the GeoIP based country code and the billing country code don't match, we flag this order as a different colour
						if(strtolower($row['ordgeoipcountrycode']) != strtolower($row['ordbillcountrycode'])) {
							$GLOBALS['FlagCellClass'] = "Suspicious";
							$suspiciousOrder = true;

						}
						$countryName = $row['ordgeoipcountry'];
					}
					else {
						$flag = strtolower($row['ordbillcountrycode']);
						$countryName = $row['ordbillcountry'];
						$GLOBALS['FlagCellTitle'] = $row['ordbillcountry'];
					}
					// Do we have a country flag to show?
					if(file_exists(ISC_BASE_PATH."/lib/flags/".$flag.".gif")) {
						$flag = GetConfig('AppPath')."/lib/flags/".$flag.".gif";
						if($suspiciousOrder == true) {
							$title = sprintf(GetLang('OrderCountriesDontMatch'), $row['ordbillcountry'], $row['ordgeoipcountry']);
							$GLOBALS['OrderCountryFlag'] = "<span onmouseout=\"HideQuickHelp(this);\" onmouseover=\"ShowQuickHelp(this, '".GetLang('PossibleFraudulentOrder')."', '".$title."');\"><img src=\"".$flag."\" alt='' /></span>";
						}
						else {
							$GLOBALS['OrderCountryFlag'] = "<img src=\"".$flag."\" alt='' title=\"".$countryName."\" />";
开发者ID:hungnv0789,项目名称:vhtm,代码行数:67,代码来源:class.orders.php

示例8: GetListRow

 public function GetListRow($row)
 {
     $new_row['ID'] = $row['productid'];
     $new_row['SKU'] = $row['prodcode'];
     $new_row['Name'] = $row['prodname'];
     $new_row['Price'] = FormatPriceInCurrency($row['prodprice']);
     if ($row['prodvisible']) {
         $new_row['Visible'] = '<img src="images/tick.gif" alt="tick"/>';
     } else {
         $new_row['Visible'] = '<img src="images/cross.gif" alt="cross"/>';
     }
     if ($row['prodfeatured']) {
         $new_row['Featured'] = '<img src="images/tick.gif" alt="tick"/>';
     } else {
         $new_row['Featured'] = '<img src="images/cross.gif" alt="cross"/>';
     }
     return $new_row;
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:18,代码来源:products.php

示例9: SalesStatsByNumViewsGrid


//.........这里部分代码省略.........
             }
             // Are we on page 2 or above?
             if ($page < $num_pages) {
                 $paging .= sprintf("<a href='javascript:void(0)' onclick='ChangeSalesViewsPage(%d)'>%s</a> | ", $page + 1, GetLang('Next'));
             } else {
                 $paging .= sprintf("%s | ", GetLang('Next'));
             }
             // Is there more than one page? If so show the &raquo; to go to the last page
             if ($num_pages > 1) {
                 $paging .= sprintf("<a href='javascript:void(0)' onclick='ChangeSalesViewsPage(%d)'>&raquo;</a> | ", $num_pages);
             } else {
                 $paging .= "&raquo; | ";
             }
             $paging = rtrim($paging, ' |');
             $GLOBALS['Paging'] = $paging;
             // Should we set focus to the grid?
             if (isset($_GET['FromLink']) && $_GET['FromLink'] == "true") {
                 $GLOBALS['JumpToOrdersByItemsSoldGrid'] = "<script type=\"text/javascript\">document.location.href='#ordersByItemsSoldAnchor';</script>";
             }
             //Sorting code moved to the topof this loop
             //Code here has been moved to the fucntion GetQueries
             // Add the Limit
             $mainQuery = "SELECT o.*, c.*,us.username, s.statusdesc AS ordstatustext, CONCAT(custconfirstname, ' ', custconlastname) AS custname\n                    \n                FROM [|PREFIX|]orders o\n                    LEFT JOIN [|PREFIX|]customers c ON (o.ordcustid=c.customerid)\n                    LEFT JOIN [|PREFIX|]order_status s ON (s.statusid=o.ordstatus)\n                    LEFT JOIN [|PREFIX|]users us ON us.`pk_userid` = o.orderowner \n                WHERE\n                    o.ordstatus > 0 \n                    AND o.orddate >= '" . $from_stamp . "'\n                    AND o.orddate <= '" . $to_stamp . "' {$cursortfield}   \n                ORDER BY " . $sortField . " " . $sortOrder;
             $mainQuery .= $GLOBALS['ISC_CLASS_DB']->AddLimit($start, $per_page);
             $result = $GLOBALS['ISC_CLASS_DB']->Query($mainQuery);
             if ($GLOBALS['ISC_CLASS_DB']->CountResult($result) > 0) {
                 while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
                     $GLOBALS['OrderId'] = $row['orderid'];
                     $GLOBALS['CustomerId'] = $row['ordcustid'];
                     $GLOBALS['OrderId1'] = $row['orderid'];
                     $GLOBALS['Customer'] = isc_html_escape($row['custname']);
                     $GLOBALS['Date'] = isc_date(GetConfig('DisplayDateFormat'), $row['orddate']);
                     $GLOBALS['OrderStatusOptions'] = $this->GetOrderStatusOptions($row['ordstatus']);
                     $GLOBALS['Total'] = FormatPriceInCurrency($row['ordtotalamount'], $row['orddefaultcurrencyid'], null, true);
                     $GLOBALS['TrackingNo'] = isc_html_escape($row['ordtrackingno']);
                     $GLOBALS['username'] = isc_html_escape($row['username']);
                     switch ($row['requeststatus']) {
                         case 0:
                             $orderreview = GetLang('OviewRequestNo');
                             break;
                         case 1:
                             $orderreview = GetLang('OviewRequestYes');
                             break;
                         case 2:
                             $orderreview = GetLang('OviewRequestSure');
                             break;
                         default:
                             $orderreview = GetLang('OviewRequestNo');
                             break;
                     }
                     $GLOBALS['Review'] = $orderreview;
                     //Show payment status blow order status
                     $GLOBALS['PaymentStatus'] = '';
                     $GLOBALS['HidePaymentStatus'] = 'display:none;';
                     $GLOBALS['PaymentStatusColor'] = '';
                     if ($row['ordpaymentstatus'] != '') {
                         $GLOBALS['HidePaymentStatus'] = '';
                         $GLOBALS['PaymentStatusColor'] = '';
                         switch ($row['ordpaymentstatus']) {
                             case 'authorized':
                                 $GLOBALS['PaymentStatusColor'] = 'PaymentAuthorized';
                                 break;
                             case 'captured':
                                 $GLOBALS['PaymentStatus'] = GetLang('Payment') . " " . ucfirst($row['ordpaymentstatus']);
                                 $GLOBALS['PaymentStatusColor'] = 'PaymentCaptured';
                                 break;
开发者ID:nirvana-info,项目名称:old_bak,代码行数:67,代码来源:class.sales.php

示例10: ManageEbayLiveListingGrid


//.........这里部分代码省略.........
			"OrderNumber" => "order_no",
		);


		if (isset($_GET['sortField']) && in_array($_GET['sortField'], $sortLinks)) {
			$sortField = $_GET['sortField'];
			SaveDefaultSortField("ManageEbayListing", $_REQUEST['sortField'], $sortOrder);
		}
		else {
			$sortField = "ei.datetime_listed";
			list($sortField, $sortOrder) = GetDefaultSortField("ManageEbayListing", $sortField, $sortOrder);
		}

		if (isset($_GET['page'])) {
			$page = (int)$_GET['page'];
		} else {
			$page = 1;
		}

		$sortURL = sprintf("&sortField=%s&sortOrder=%s", $sortField, $sortOrder);
		$GLOBALS['SortURL'] = $sortURL;

		// Limit the number of questions returned
		if ($page == 1) {
			$start = 1;
		} else {
			$start = ($page * ISC_EBAY_LISTING_PER_PAGE) - (ISC_EBAY_LISTING_PER_PAGE-1);
		}

		$start = $start-1;

		// Get the results for the query
		$listingResult = $this->_GetEbayListingList($query, $start, $sortField, $sortOrder, $numListing);
		$numPages = ceil($numListing / ISC_EBAY_LISTING_PER_PAGE);

		// Add the "(Page x of n)" label
		if($numListing > ISC_EBAY_LISTING_PER_PAGE) {
			$GLOBALS['Nav'] = sprintf("(%s %d of %d) &nbsp;&nbsp;&nbsp;", GetLang('Page'), $page, $numPages);
			$GLOBALS['Nav'] .= BuildPagination($numListing, ISC_EBAY_LISTING_PER_PAGE, $page, sprintf("index.php?ToDo=viewEbay&currentTab=0%s", $sortURL));
		}
		else {
			$GLOBALS['Nav'] = "";
		}

		$GLOBALS['Nav'] = rtrim($GLOBALS['Nav'], ' |');
		$GLOBALS['SearchQueryListing'] = $query;
		$GLOBALS['SortField'] = $sortField;
		$GLOBALS['SortOrder'] = $sortOrder;

		BuildAdminSortingLinks($sortLinks, "index.php?ToDo=viewEbay&amp;currentTab=0&amp;".$searchURL."&amp;page=".$page, $sortField, $sortOrder);

		// Workout the maximum size of the array
		$max = $start + ISC_EBAY_LISTING_PER_PAGE;

		if ($max > count($listingResult)) {
			$max = count($listingResult);
		}
		if($numListing > 0) {
			$GLOBALS['ManageEbayLiveListingIntro'] = sprintf(GetLang('ManageEbayLiveListingIntro'), $numListing);

			// Display the live listing
			while ($row = $GLOBALS["ISC_CLASS_DB"]->Fetch($listingResult))
			{
				$GLOBALS['Item'] = isc_html_escape($row['title']);
				if (trim($row['ebay_item_link'])) {
					$GLOBALS['Item'] = '<a target="_blank" href="'.$row['ebay_item_link'].'">' .$GLOBALS['Item']. '</a>';
				}
				$GLOBALS['DateListed'] = CDate($row['datetime_listed']);
				$GLOBALS['Type'] = GetLang(isc_html_escape($row['listing_type']));
				$GLOBALS['Status'] = GetLang(isc_html_escape(ucfirst($row['listing_status'])));
				$GLOBALS['BidCount'] = GetLang('NA');
				if (!empty ($row['bid_count'])) {
					$GLOBALS['BidCount'] = $row['bid_count'];
				}
				$GLOBALS['QuantityRemaining'] = GetLang('NA');
				if (!empty ($row['quantity_remaining'])) {
					$GLOBALS['QuantityRemaining'] = $row['quantity_remaining'];
				}
				$currentPriceCurrency = GetCurrencyByCode($row['current_price_currency']);
				$GLOBALS['CurrentPrice'] = FormatPriceInCurrency($row['current_price'], $currentPriceCurrency['currencyid']);
				$binPriceCurrency = GetCurrencyByCode($row['buyitnow_price_currency']);
				$GLOBALS['BinPrice'] = FormatPriceInCurrency($row['buyitnow_price'], $binPriceCurrency['currencyid']);
				$GLOBALS['OrderNumber'] = $row['order_no'];
				if ($row['order_no'] == '') {
					$GLOBALS['OrderNumber'] = '';
				}
				$GLOBALS['EbayItemId'] = $row['ebay_item_id'];
				if ($row['listing_type'] == 'FixedPriceItem') {
					$GLOBALS['BinPrice'] = $GLOBALS['CurrentPrice'];
					$GLOBALS['CurrentPrice'] = GetLang('NA');
				}

				$GLOBALS['EbayListingGrid'] .= $this->template->render('ebay.listing.manage.row.tpl');
			}

			return $this->template->render('ebay.listing.manage.grid.tpl');
		}
		$GLOBALS['ShowListingOptions'] = 'display:none;';
		return '';
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:class.ebay.php

示例11: __construct

	public function __construct($orderId = null)
	{
		$this->setDoubleOptIn(GetConfig('EmailIntegrationOrderDoubleOptin'));
		$this->setSendWelcome(GetConfig('EmailIntegrationOrderSendWelcome'));
		$this->setSubscriptionIP(GetIP());

		if (!$orderId) {
			return;
		}

		$entity = new ISC_ENTITY_ORDER;

		$data = $entity->get($orderId);
		if (!$data) {
			throw new Interspire_EmailIntegration_Subscription_Exception;
		}
		$this->_data = $data;
		unset($data);

		// copy any form fields associated with the order + associated customer and place into local subscription data

		if (isId($this->_data['ordformsessionid'])) {
			/** @var ISC_FORM */
			$form = $GLOBALS["ISC_CLASS_FORM"];

			$customFields = array();

			$formData = $form->getSavedSessionData($this->_data['customer']['custformsessionid']);
			if ($formData && !empty($formData)) {
				$customFields += $formData;
			}

			$formData = $form->getSavedSessionData($this->_data['ordformsessionid']);
			if ($formData && !empty($formData)) {
				$customFields += $formData;
			}

			foreach ($customFields as $fieldId => $value) {
				$this->_data['FormField_' . $fieldId] = $value;
			}
		}

		// generate fields specifically for email integration based on order data (ones that aren't covered by simple order data or by Form Fields)

		// get the first shipping address record because IEM had shipping method as mappable field
		$this->_data['shipping_method'] = '';
		$shippingMethod = $GLOBALS['ISC_CLASS_DB']->FetchOne("SELECT `method` FROM [|PREFIX|]order_shipping WHERE order_id = " . (int)$orderId . " LIMIT 1", 'method');
		if ($shippingMethod) {
			$this->_data['shipping_method'] = $shippingMethod;
		}

		// pre-formated 'full address' mappable field to pass to providers like mailchimp
		$this->_data['OrderSubscription_BillingAddress'] = array(
			'addr1' => $this->_data['ordbillstreet1'],
			'addr2' => $this->_data['ordbillstreet2'],
			'city' => $this->_data['ordbillsuburb'],
			'state' => $this->_data['ordbillstate'],
			'zip' => $this->_data['ordbillzip'],
			'country' => $this->_data['ordbillcountrycode'],
		);

		// country-code specific fields to pass to providers like MailChimp or IEM that support (or require in IEM's case) country codes
		$this->_data['OrderSubscription_BillingAddress_countryiso2'] = $this->_data['ordbillcountrycode'];
		$this->_data['OrderSubscription_BillingAddress_countryiso3'] = GetCountryISO3ById($this->_data['ordbillcountryid']);

		// for email integration, we prefer sending the value of an order as the total amount rather than the stored (charged) total - which could be less than the value due to store credit or gift certificates
		// so, generate some columns which are internal to this subscription data and map to those instead of total_ex and total_inc
		$this->_data['total_ex_tax'] = $this->_data['subtotal_ex_tax'] + $this->_data['shipping_cost_ex_tax'] + $this->_data['handling_cost_ex_tax'] + $this->_data['wrapping_cost_ex_tax'];
		$this->_data['total_inc_tax'] = $this->_data['subtotal_inc_tax'] + $this->_data['shipping_cost_inc_tax'] + $this->_data['handling_cost_inc_tax'] + $this->_data['wrapping_cost_inc_tax'];

		// generated fields: end

		// currency values must be stored in the subscription data as both numeric and formatted so that, when translated to the mail provider, it can be sent as either a number or string depending on the destination field
		$moneyFields = array(
			'subtotal_ex_tax',
			'subtotal_inc_tax',
			'subtotal_tax',
			'total_ex_tax',
			'total_inc_tax',
			'total_tax',
			'shipping_cost_ex_tax',
			'shipping_cost_inc_tax',
			'shipping_cost_tax',
			'handling_cost_ex_tax',
			'handling_cost_inc_tax',
			'handling_cost_tax',
			'wrapping_cost_ex_tax',
			'wrapping_cost_inc_tax',
			'wrapping_cost_tax',
			'ordrefundedamount',
			'ordstorecreditamount',
			'ordgiftcertificateamount',
			'orddiscountamount',
			'coupon_discount',
		);

		foreach ($moneyFields as $moneyFieldId) {
			$this->_data[$moneyFieldId] = array(
				'numeric' => $this->_data[$moneyFieldId],
				'formatted' => FormatPriceInCurrency($this->_data[$moneyFieldId], $this->_data['orddefaultcurrencyid']),
//.........这里部分代码省略.........
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:Order.php

示例12: GetOrderDetail

 public function GetOrderDetail($orderId, $type = "review")
 {
     $GLOBALS['RequestLogs'] = "";
     /*if($type == "review")
     		{
     			$GLOBALS['RequestLogs'] = "yes";
     		}*/
     $GLOBALS['HideRequestLogs'] = "display: none";
     $logQuery = "\n\t\t\tSELECT * \n\t\t    FROM [|PREFIX|]request_log rl\n\t\t  \tLEFT JOIN [|PREFIX|]requests r ON (r.requestid=rl.requestid)\n\t\t    WHERE r.orderid='" . $orderId . "' \n\t\t  \tORDER BY logdate ASC\n\t\t";
     $logResult = $GLOBALS['ISC_CLASS_DB']->Query($logQuery);
     while ($log = $GLOBALS['ISC_CLASS_DB']->Fetch($logResult)) {
         $GLOBALS['RequestLogs'] .= "<p>At [" . $log['logdate'] . "]: " . $log['logdesc'] . "</p>";
     }
     // should hide request logs
     /*if($GLOBALS['RequestLogs']!=""){
     			$GLOBALS['HideRequestLogs'] = "";
     		}*/
     $GLOBALS['OrderReviewLink'] = GetConfig('ShopPath') . "/order/review/" . $orderId;
     $query = "\n\t\t\tSELECT o.*, CONCAT(custconfirstname, ' ', custconlastname) AS custname, custconemail, custconphone, s.zonename AS shippingzonename,\n\t\t\t(SELECT COUNT(messageid) FROM [|PREFIX|]order_messages WHERE messageorderid=orderid AND messagestatus='unread') AS numunreadmessages\n\t\t\tFROM [|PREFIX|]orders o\n\t\t\tLEFT JOIN [|PREFIX|]customers c ON (c.customerid=o.ordcustid)\n\t\t\tLEFT JOIN [|PREFIX|]shipping_zones s ON (s.zoneid=o.ordshippingzoneid)\n\t\t\tWHERE o.orderid='" . $GLOBALS['ISC_CLASS_DB']->Quote($orderId) . "'\n\t\t";
     $result = $GLOBALS['ISC_CLASS_DB']->Query($query);
     if ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
         // If this user is a vendor, do they have permission to acess this order?
         if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId() && $row['ordvendorid'] != $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId()) {
             exit;
         }
         $GLOBALS['OrderDate'] = isc_date("d M Y H:i:s", $row['orddate']);
         $GLOBALS['ISC_CLASS_ADMIN_ORDERS'] = GetClass('ISC_ADMIN_ORDERS');
         $GLOBALS['OrderStatusOptions'] = $GLOBALS['ISC_CLASS_ADMIN_ORDERS']->GetOrderStatusOptions($row['ordstatus']);
         $GLOBALS['TrackingNo'] = $row['ordtrackingno'];
         $GLOBALS['NumMessages'] = $row['numunreadmessages'];
         $GLOBALS['contactEmail'] = $row['custconemail'];
         if ($row["numunreadmessages"] == 0) {
             $GLOBALS["HideMessages"] = "none";
         }
         if (!gzte11(ISC_LARGEPRINT)) {
             $GLOBALS["HideMessageItems"] = "none";
         }
         $row['custname'] = isc_html_escape(trim($row['custname']));
         $GLOBALS['CustomerName'] = $row['custname'];
         $GLOBALS['CouponsUsed'] = '';
         $GLOBALS['HideCouponsUsed'] = 'display: none';
         // Get the products in the order
         $query = "SELECT o.*\n\t\t\t\tFROM [|PREFIX|]order_coupons o\n\t\t\t\tWHERE ordcouporderid='" . $orderId . "'";
         $coupons = $GLOBALS['ISC_CLASS_DB']->Query($query);
         $allcoupons = array();
         $couponcode = '';
         $GLOBALS['CouponsUsedDetails'] = '';
         while ($coupon = $GLOBALS['ISC_CLASS_DB']->Fetch($coupons)) {
             $allcoupons[] = $coupon;
             if ($couponcode != $coupon['ordcouponcode']) {
                 $couponcode = $coupon['ordcouponcode'];
                 $GLOBALS['CouponsUsed'] .= $coupon['ordcouponcode'] . ',';
                 $GLOBALS['HideCouponsUsed'] = '';
                 $CoupDetails = "Coupon Code : " . $coupon['ordcouponcode'] . "<br />";
                 if ($coupon['ordcoupontype'] == 0) {
                     $CoupDetails .= "Coupon Amount : " . FormatPriceInCurrency($coupon['ordcouponamount'], $row['orddefaultcurrencyid']) . "<br />";
                 } else {
                     $CoupDetails .= "Coupon Amount : " . $coupon['ordcouponamount'] . "%<br />";
                 }
                 //$CoupDetails .= "Coupon Name : ".$coupon['ordcouponcode'];
                 $GLOBALS['CouponsUsedDetails'] .= $CoupDetails;
             }
         }
         $prodFieldsArray = $GLOBALS['ISC_CLASS_ADMIN_ORDERS']->GetOrderProductFieldsData($orderId);
         // Get the products in the order
         $query = "\n\t\t\t\tSELECT o.*, p.prodname\n\t\t\t\tFROM [|PREFIX|]order_products o\n\t\t\t\tLEFT JOIN [|PREFIX|]products p ON (p.productid=o.ordprodid)\n\t\t\t\tWHERE orderorderid='" . $orderId . "'\n\t\t\t\tORDER BY ordprodname";
         $pResult = $GLOBALS['ISC_CLASS_DB']->Query($query);
         $GLOBALS['ProductsTable'] = "<table width=\"95%\" align=\"center\" border=\"0\" cellspacing=0 cellpadding=0>";
         // Add a notice about the order containing only digitally downloadable products
         if ($row['ordisdigital'] == 1) {
             $GLOBALS['ProductsTable'] .= sprintf("\n\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td style=\"padding:5px; background-color:lightyellow\" width=\"100%%\" class=\"text\" colspan=\"2\">\n\t\t\t\t\t\t\t%s\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td colspan=\"2\">&nbsp;</td>\n\t\t\t\t\t</tr>\n\t\t\t\t", GetLang('DigitalOrderNotice'));
         }
         $wrappingTotal = 0;
         $originaltotal = 0;
         //blessen
         $originaltotal_temp = 0;
         while ($pRow = $GLOBALS['ISC_CLASS_DB']->Fetch($pResult)) {
             $sku = "";
             if ($pRow['ordprodsku'] != "") {
                 $sku = "<br /><em>" . isc_html_escape($pRow['ordprodsku']) . "</em>";
             }
             $sStart = $sEnd = '';
             $refunded = '';
             $shippedLabel = '';
             if ($pRow['ordprodqtyshipped'] > 0) {
                 $shippedLabel = '<div class="Shipped">' . sprintf(GetLang('OrderProductsShippedX'), $pRow['ordprodqtyshipped']) . '</div>';
             }
             if ($pRow['ordprodrefunded'] > 0) {
                 if ($pRow['ordprodrefunded'] == $pRow['ordprodqty']) {
                     $sStart = "<del>";
                     $sEnd = "</del>";
                     $refunded = '<div class="Refunded">' . GetLang('OrderProductRefunded') . '</span>';
                 } else {
                     $refunded = '<div class="Refunded">' . sprintf(GetLang('OrderProductsRefundedX'), $pRow['ordprodrefunded']) . '</div>';
                 }
                 $cost = $pRow['ordprodcost'] * ($pRow['ordprodqty'] - $pRow['ordprodrefunded']);
             } else {
                 $cost = $pRow['ordprodcost'] * $pRow['ordprodqty'];
             }
             if ($pRow['prodname']) {
//.........这里部分代码省略.........
开发者ID:nirvana-info,项目名称:old_bak,代码行数:101,代码来源:class.requests_sep14.php


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