• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP isc_substr函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: GetExportFileTypeList

	/**
	* Gets a list of available export file types
	*
	* @return array An array of available file types in the format: filetype => type_details_array[]
	*/
	public static function GetExportFileTypeList()
	{
		$files = scandir(TYPE_ROOT);

		$types = array();

		foreach($files as $file) {
			if(!is_file(TYPE_ROOT . $file) || isc_substr($file, -3) != "php") {
				continue;
			}

			require_once TYPE_ROOT . $file;

			$file = isc_substr($file, 0, isc_strlen($file) - 4);
			/*
			$pos = isc_strrpos($file, ".");
			$typeName = isc_strtoupper(isc_substr($file, $pos + 1));
			*/
			$className = "ISC_ADMIN_EXPORTFILETYPE_" . strtoupper($file); //$typeName;
			if(!class_exists($className)) {
				continue;
			}

			$obj = new $className;
			if (!$obj->ignore) {
				$types[$file] = $obj->GetTypeDetails();
			}
		}

		return $types;
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:36,代码来源:class.exportfiletype.factory.php


示例2: GetExportMethodList

 /**
  * Gets a list of available export methods
  *
  * @return array An array of details about available export methods. methodname => details[]
  */
 public static function GetExportMethodList()
 {
     $files = scandir(METHOD_ROOT);
     $methods = array();
     foreach ($files as $file) {
         if (!is_file(METHOD_ROOT . $file) || isc_substr($file, -3) != "php") {
             continue;
         }
         require_once METHOD_ROOT . $file;
         $file = isc_substr($file, 0, isc_strlen($file) - 4);
         $file = strtoupper($file);
         /*
         $pos = isc_strrpos($file, ".");
         $methodName = isc_strtoupper(isc_substr($file, $pos + 1));
         */
         $className = "ISC_ADMIN_EXPORTMETHOD_" . $file;
         //$methodName;
         if (!class_exists($className)) {
             continue;
         }
         $obj = new $className();
         $methods[$file] = $obj->GetMethodDetails();
     }
     return $methods;
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:30,代码来源:class.importmethod.factory.php


示例3: _ConstructPostData

		protected function _ConstructPostData($postData)
		{

			$billingDetails = $this->GetBillingDetails();

			$qbXML = new SimpleXMLElement('<?qbmsxml version="2.0"?><QBMSXML />');
			$signOnDesktop = $qbXML->addChild('SignonMsgsRq')->addChild('SignonDesktopRq');
			$signOnDesktop->addChild('ClientDateTime', date('Y-m-d\TH:i:s'));
			$signOnDesktop->addChild('ApplicationLogin', $this->GetValue('ApplicationLogin'));
			$signOnDesktop->addChild('ConnectionTicket', $this->GetValue('ConnectionTicket'));
			$signOnDesktop->addChild('Language', 'English');
			$signOnDesktop->addChild('AppID', $this->GetValue('AppID'));
			$signOnDesktop->addChild('AppVer', '1.0');

			$cardChargeRequest = $qbXML->addChild('QBMSXMLMsgsRq')->addChild('CustomerCreditCardChargeRq');
			$cardChargeRequest->addChild('TransRequestID', $this->GetCombinedOrderId());
			$cardChargeRequest->addChild('CreditCardNumber', $postData['ccno']);
			$cardChargeRequest->addChild('ExpirationMonth', $postData['ccexpm']);
			$cardChargeRequest->addChild('ExpirationYear', $postData['ccexpy']);
			$cardChargeRequest->addChild('IsECommerce', 'true');
			$cardChargeRequest->addChild('Amount', $this->GetGatewayAmount());
			$cardChargeRequest->addChild('NameOnCard', isc_substr($postData['name'], 0, 30));
			$cardChargeRequest->addChild('CreditCardAddress', isc_substr($billingDetails['ordbillstreet1'], 0, 30));
			$cardChargeRequest->addChild('CreditCardPostalCode', isc_substr($billingDetails['ordbillzip'], 0, 9));
			$cardChargeRequest->addChild('SalesTaxAmount', $this->GetTaxCost());
			$cardChargeRequest->addChild('CardSecurityCode', $postData['cccvd']);
			return $qbXML->asXML();
		}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:28,代码来源:module.qbms.php


示例4: rightTruncate

	/**
	* Cuts the provided string to the specified length, applying a suffix if necessary, using the store's current character set.
	*
	* Usage:
	* $str = 'alpha beta gamma';
	* $str = Store_String::rightTruncate($str, 10);
	* // $str === 'alpha b...';
	*
	* @param string $str
	* @param int $length
	* @param string $suffix
	* @return string
	*/
	public static function rightTruncate($str, $length, $suffix = '...')
	{
		$strLength = isc_strlen($str);
		if ($strLength <= $length) {
			return $str;
		}

		$suffixLength = isc_strlen($suffix);
		return isc_substr($str, 0, $length - $suffixLength) . $suffix;
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:23,代码来源:String.php


示例5: SetPanelSettings

 public function SetPanelSettings()
 {
     $count = 0;
     $GLOBALS['SNIPPETS']['HomeSaleProducts'] = '';
     if (GetConfig('HomeNewProducts') == 0) {
         $this->DontDisplay = true;
         return;
     }
     if (GetConfig('EnableProductReviews') == 0) {
         $GLOBALS['HideProductRating'] = "display: none";
     }
     $query = "\n\t\t\t\tSELECT p.*, FLOOR(prodratingtotal/prodnumratings) AS prodavgrating, imageisthumb, imagefile, " . GetProdCustomerGroupPriceSQL() . "\n\t\t\t\tFROM [|PREFIX|]products p\n\t\t\t\tLEFT JOIN [|PREFIX|]product_images pi ON (p.productid=pi.imageprodid)\n\t\t\t\tWHERE p.prodsaleprice != 0 AND p.prodsaleprice < p.prodprice AND p.prodvisible='1' AND (imageisthumb=1 OR ISNULL(imageisthumb))\n\t\t\t\t" . GetProdCustomerGroupPermissionsSQL() . "\n\t\t\t\tORDER BY RAND()\n\t\t\t";
     $query .= $GLOBALS['ISC_CLASS_DB']->AddLimit(0, GetConfig('HomeNewProducts'));
     $result = $GLOBALS['ISC_CLASS_DB']->Query($query);
     $GLOBALS['AlternateClass'] = '';
     while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
         if ($GLOBALS['AlternateClass'] == 'Odd') {
             $GLOBALS['AlternateClass'] = 'Even';
         } else {
             $GLOBALS['AlternateClass'] = 'Odd';
         }
         $GLOBALS['ProductCartQuantity'] = '';
         if (isset($GLOBALS['CartQuantity' . $row['productid']])) {
             $GLOBALS['ProductCartQuantity'] = (int) $GLOBALS['CartQuantity' . $row['productid']];
         }
         $GLOBALS['ProductId'] = $row['productid'];
         $GLOBALS['ProductName'] = isc_html_escape($row['prodname']);
         $GLOBALS['ProductLink'] = ProdLink($row['prodname']);
         // Determine the price of this product
         $originalPrice = CalcRealPrice(CalcProdCustomerGroupPrice($row, $row['prodprice']), 0, 0, $row['prodistaxable']);
         $GLOBALS['OriginalProductPrice'] = CurrencyConvertFormatPrice($originalPrice);
         $GLOBALS['ProductPrice'] = CalculateProductPrice($row);
         $GLOBALS['ProductRating'] = (int) $row['prodavgrating'];
         // Workout the product description
         $desc = strip_tags($row['proddesc']);
         if (isc_strlen($desc) < 120) {
             $GLOBALS['ProductSummary'] = $desc;
         } else {
             $GLOBALS['ProductSummary'] = isc_substr($desc, 0, 120) . "...";
         }
         $GLOBALS['ProductThumb'] = ImageThumb($row['imagefile'], ProdLink($row['prodname']));
         $GLOBALS['SNIPPETS']['HomeSaleProducts'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("HomeSaleProductsItem");
         if (!$GLOBALS['SNIPPETS']['HomeSaleProducts']) {
             $this->DontDisplay = true;
             return;
         }
     }
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:48,代码来源:HomeSaleProducts.php


示例6: SetPanelSettings

		public function SetPanelSettings()
		{
			$GLOBALS['ISC_CLASS_CATEGORY'] = GetClass('ISC_CATEGORY');

			// Should we hide the comparison button?
			if(GetConfig('EnableProductComparisons') == 0 || $GLOBALS['ISC_CLASS_CATEGORY']->GetNumProducts() < 2) {
				$GLOBALS['HideCompareItems'] = "none";
			}

			// Load the products into the reference array
			$GLOBALS['ISC_CLASS_CATEGORY']->GetProducts($products);
			$GLOBALS['CategoryProductListing'] = "";

			if(GetConfig('ShowProductRating') == 0) {
				$GLOBALS['HideProductRating'] = "display: none";
			}

			$display_mode = ucfirst(GetConfig("CategoryDisplayMode"));
			if ($display_mode == "Grid") {
				$display_mode = "";
			}
			$GLOBALS['DisplayMode'] = $display_mode;

			if ($display_mode == "List") {
				if (GetConfig('ShowAddToCartLink') && $GLOBALS['ISC_CLASS_CATEGORY']->GetNumProducts() > 0) {
					$GLOBALS['HideAddButton'] = '';
				} else {
					$GLOBALS['HideAddButton'] = 'none';
				}

				$GLOBALS['ListJS'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ListCheckForm");
			}

			$GLOBALS['CompareButton'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("CompareButton" . $display_mode);

			if ($display_mode == "List" && $GLOBALS['ISC_CLASS_CATEGORY']->GetNumPages() > 1) {
				$GLOBALS['CompareButtonTop'] = $GLOBALS['CompareButton'];
			}

			$GLOBALS['AlternateClass'] = '';
			foreach($products as $row) {
				$this->setProductGlobals($row);

				// for list style
				if ($display_mode == "List") {
					// get a small chunk of the product description
					$desc = isc_substr(strip_tags($row['proddesc']), 0, 225);
					if (isc_strlen($row['proddesc']) > 225) {
						// trim the description back to the last period or space so words aren't cut off
						$period_pos = isc_strrpos($desc, ".");
						$space_pos = isc_strrpos($desc, " ");
						// find the character that we should trim back to. -1 on space pos for a space that follows a period, so we dont end up with 4 periods
						if ($space_pos - 1 > $period_pos) {
							$pos = $space_pos;
						}
						else {
							$pos = $period_pos;
						}
						$desc = isc_substr($desc, 0, $pos);
						$desc .= "...";
					}

					$GLOBALS['ProductDescription'] = $desc;

					$GLOBALS['AddToCartQty'] = "";

					if (CanAddToCart($row) && GetConfig('ShowAddToCartLink')) {
						if (isId($row['prodvariationid']) || trim($row['prodconfigfields'])!='' || $row['prodeventdaterequired']) {
							$GLOBALS['AddToCartQty'] = '<a href="' . $GLOBALS["ProductURL"] . '">' . $GLOBALS['ProductAddText'] . "</a>";
						}
						else {
							$GLOBALS['CartItemId'] = $GLOBALS['ProductId'];
							// If we're using a cart quantity drop down, load that
							if (GetConfig('TagCartQuantityBoxes') == 'dropdown') {
								$GLOBALS['Quantity0'] = "selected=\"selected\"";
								$GLOBALS['QtyOptionZero'] = '<option %%GLOBAL_Quantity0%% value="0">Quantity</option>';
								$GLOBALS['QtySelectStyle'] = 'width: auto;';
								$GLOBALS['AddToCartQty'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("CartItemQtySelect");
							// Otherwise, load the textbox
							} else {
								$GLOBALS['ProductQuantity'] = 0;
								$GLOBALS['AddToCartQty'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("CartItemQtyText");
							}
						}
					}
				} // for grid style
				else {
					$GLOBALS["CompareOnSubmit"] = "onsubmit=\"return compareProducts(config.CompareLink)\"";
				}

				$GLOBALS['CategoryProductListing'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("CategoryProductsItem" . $display_mode);
			}

			if($GLOBALS['ISC_CLASS_CATEGORY']->GetNumProducts() == 0) {
				// There are no products in this category
				$GLOBALS['CategoryProductListing'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("CategoryNoProductsMessage");
				$GLOBALS['HideOtherProductsIn'] = 'none';

				$GLOBALS['ExtraCategoryClass'] = "Wide WideWithLeft";
				if($GLOBALS['SNIPPETS']['SubCategories'] != '') {
//.........这里部分代码省略.........
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:CategoryContent.php


示例7: _StoreInsArtFileAndReturnId

 public function _StoreInsArtFileAndReturnId($FileName, $fname)
 {
     $dir = $fname;
     if (is_array($_FILES[$FileName]) && $_FILES[$FileName]['name'] != "") {
         // If it's an image, make sure it's a valid image type
         if (isc_strtolower(isc_substr($_FILES[$FileName]['name'], -3)) != "pdf") {
             return "";
         }
         if (!is_dir(sprintf("../%s", $dir))) {
             @mkdir("../" . $dir, 0777);
         }
         // Clean up the incoming file name a bit
         $_FILES[$FileName]['name'] = preg_replace("#[^\\w.]#i", "_", $_FILES[$FileName]['name']);
         $_FILES[$FileName]['name'] = preg_replace("#_{1,}#i", "_", $_FILES[$FileName]['name']);
         $randomFileName = GenRandFileName($_FILES[$FileName]['name']);
         $dest = realpath(ISC_BASE_PATH . "/" . $dir);
         $dest .= "/" . $randomFileName;
         if (move_uploaded_file($_FILES[$FileName]["tmp_name"], $dest)) {
             isc_chmod($dest, ISC_WRITEABLE_FILE_PERM);
             // The file was moved successfully
             return $randomFileName;
         } else {
             // Couldn't move the file, maybe the directory isn't writable?
             return "";
         }
     } else {
         // The file doesn't exist in the $_FILES array
         return "";
     }
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:30,代码来源:class.product_18_12.php


示例8: _GetMaxUploadSize

	protected function _GetMaxUploadSize()
	{
		$sizes = array(
			"upload_max_filesize" => ini_get("upload_max_filesize"),
			"post_max_size" => ini_get("post_max_size")
		);
		$max_size = -1;
		foreach($sizes as $size) {
			if (!$size) {
				continue;
			}
			$unit = isc_substr($size, -1);
			$size = isc_substr($size, 0, -1);
			switch(isc_strtolower($unit)) {
				case "g":
					$size *= 1024;
				case "m":
					$size *= 1024;
				case "k":
					$size *= 1024;
			}
			if($max_size == -1 || $size > $max_size) {
				$max_size = $size;
			}
		}
		if($max_size >= 1048576) {
			$max_size = floor($max_size/1048576)."MB";
		} else {
			$max_size = floor($max_size/1024)."KB";
		}
		return $max_size;
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:32,代码来源:class.remote.redirects.php


示例9: GetProductFieldDetails

	/**
	 * Generate a list of product fields for configurable products to be shown
	 * for a particular item in the cart based on the customer's configuration.
	 *
	 * @param array $productFields Array containing list of product fields for this product.
	 * @param int $cartItemId The ID of the item in the shopping cart.
	 */
	public function GetProductFieldDetails($productFields, $cartItemId)
	{
		// custom product fields on cart page
		$GLOBALS['HideCartProductFields'] = 'display:none;';
		$GLOBALS['CartProductFields'] = '';
		if(isset($productFields) && !empty($productFields) && is_array($productFields)) {
			$GLOBALS['HideCartProductFields'] = '';
			foreach($productFields as $filedId => $field) {

				switch ($field['type']) {
					//field is a file
					case 'file': {

						//file is an image, display the image
						$fieldValue = '<a target="_Blank" href="'.$GLOBALS['ShopPath'].'/viewfile.php?cartitem='.$cartItemId.'&prodfield='.$filedId.'">'.isc_html_escape($field['fileOriginalName']).'</a>';
						break;
					}
					//field is a checkbox
					case 'checkbox': {
						$fieldValue = GetLang('Checked');
						break;
					}
					//if field is a text area or short text display first
					default: {
						if(isc_strlen($field['value'])>50) {
							$fieldValue = isc_substr(isc_html_escape($field['value']), 0, 50)." ..";
						} else {
							$fieldValue = isc_html_escape($field['value']);
						}
					}
				}

				if(trim($fieldValue) != '') {
					$GLOBALS['CustomFieldName'] = isc_html_escape($field['name']);
					$GLOBALS['CustomFieldValue'] = $fieldValue;
					$GLOBALS['CartProductFields'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("CartProductFields");
				}
			}
		}
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:47,代码来源:CartContent.php


示例10: EditDiscountStep1

		private function EditDiscountStep1()
		{
			$GLOBALS['Title'] = GetLang('EditDiscount');
			$GLOBALS['Intro'] = GetLang('EditDiscountIntro');
			$GLOBALS['Enabled'] = 'checked="checked"';
			$GLOBALS['FormAction'] = "editDiscount2";
			$GLOBALS['DiscountTypes'] = '';
			$GLOBALS['Edit'] = 'display : none;';
			$GLOBALS['DiscountJavascriptValidation'] = '';
			$GLOBALS['DiscountEnabledCheck'] = 'checked="checked"';

			$rules = GetAvailableModules('rule', false, false, false);

			$GLOBALS['RuleList'] = '';

			$GLOBALS['MaxUses'] = '';
			$GLOBALS['DiscountExpiryFields'] = 'display : none';
			$GLOBALS['DiscountMaxUsesDisabled'] = 'readonly="readonly"';
			$GLOBALS['DiscountExpiryDateDisabled'] = 'readonly="readonly"';

			require_once(ISC_BASE_PATH.'/lib/api/discount.api.php');
			$discountAPI = new API_DISCOUNT();

			$discountId = (int) $_GET['discountId'];

			if ($discountAPI->DiscountExists($discountId)) {

				$discount = $this->GetDiscountData($discountId);
				$freeShippingMessageLocations = unserialize($discount['free_shipping_message_location']);
				$GLOBALS['DiscountId'] = $discountId;
				$GLOBALS['DiscountName'] = isc_html_escape($discount['discountname']);

				$module = explode('_',$discount['discountruletype']);

				if (isset($module[1])) {
					GetModuleById('rule', $ruleModule, $module[1]);
					if(!is_object($ruleModule)) {
						// Something really bad went wrong >_<
						exit;
					}
				}
				else {
					die('Can\'t find the module');
				}

				$cd = unserialize($discount['configdata']);

				if (!empty($cd)) {
					foreach ($cd as $var => $data) {

						if (isc_substr($var,0,5) == "varn_") {
							$data = FormatPrice($data, false, false);
						}

						$GLOBALS[$var] = $data;
					}
				}

				$ruleModule->initialize($discount);
				$ruleModule->initializeAdmin();

				$GLOBALS['RuleList'] = '';

				$GLOBALS['Vendor'] = '0';
				if(gzte11(ISC_HUGEPRINT)) {
					$GLOBALS['Vendor'] = 1;
				}

				foreach ($rules as $rule) {
					$rulesSorted[$rule['object']->getRuleType()][] = $rule;
				}

				$first = true;
				$GLOBALS['CurrentRule'] = 'null';

				foreach ($rulesSorted as $type => $ruleType) {

					if ($first) {
						$GLOBALS['RuleList'] .= '<h4 style="margin-top:5px; margin-bottom:5px;">'.$type.' '.GetLang('BasedRule').'</h4>';
					} else {
						$GLOBALS['RuleList'] .= '<h4 style="margin-bottom:5px;">'.$type.' '.GetLang('BasedRule').'</h4>';
					}
					$first = false;

					foreach ($ruleType as $rule) {

						$GLOBALS['RuleList'] .= '<label><input type="radio" class="discountRadio" onClick="UpdateModule(this.id,'.(int)$rule['object']->vendorSupport().')" name="RuleType" value="'.$rule['id'].'" ';
						if ($rule['id'] == $discount['discountruletype']) {
							$GLOBALS['RuleList'] .= ' checked="checked" ';
							$GLOBALS['CurrentRule'] = "'".$rule['id']."'";
						}

						$GLOBALS['RuleList'] .= 'id="'.$rule['id'].'"> ';

						if (!(int)$rule['object']->vendorSupport() && $GLOBALS['Vendor'] == 1) {
							$GLOBALS['RuleList'] .= '<span class="aside">'.$rule['object']->getDisplayName().'</span>';
						} else {
							$GLOBALS['RuleList'] .= '<span>'.$rule['object']->getDisplayName().'</span>';
						}

//.........这里部分代码省略.........
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:class.discounts.php


示例11: _GetBackupList

	public function _GetBackupList()
	{
		$backups = array();

		if(!is_dir(ISC_BACKUP_DIRECTORY)) {
			isc_mkdir(ISC_BACKUP_DIRECTORY);
		}

		if(is_dir(ISC_BACKUP_DIRECTORY)) {
			$dh = opendir(ISC_BACKUP_DIRECTORY);
			if($dh) {
				while(($file = readdir($dh)) !== false) {
					if(isc_substr($file, 0, 6) == "backup") {
						$backups[$file] = array(
							"size" => filesize(ISC_BACKUP_DIRECTORY . $file),
							"mtime" => filemtime(ISC_BACKUP_DIRECTORY . $file)
						);
						if(!is_file(ISC_BACKUP_DIRECTORY . $file)) {
							$backups[$file]['directory'] = 1;
						}
					}
				}
			}
		}

		return $backups;
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:27,代码来源:class.backup.php


示例12: buildXML

	public function buildXML()
	{
		if (isc_strtolower($this->spool["service"]) !== "add" && is_array($this->spoolReferenceData)) {
			$this->writeEscapedElement("ListID", $this->spoolReferenceData["ListID"]);
			$this->writeEscapedElement("EditSequence", $this->spoolReferenceData["EditSequence"]);
		}elseif(isc_strtolower($this->spool["service"]) !== "add"){
			$fullName = $this->spoolNodeData["FirstName"] . ' ' . $this->spoolNodeData["LastName"];
			$query = "SELECT * FROM [|PREFIX|]accountingref WHERE accountingreftype='customerguest' AND accountingrefvalue LIKE '%" . $GLOBALS["ISC_CLASS_DB"]->Quote($fullName) . "%' ORDER BY accoutingrefid DESC LIMIT 1";
			$result = $GLOBALS["ISC_CLASS_DB"]->Query($query);
			if ($row = $GLOBALS["ISC_CLASS_DB"]->Fetch($result)) {
				$this->writeEscapedElement("ListID", @unserialize($row["ListID"]));
				$this->writeEscapedElement("EditSequence", @unserialize($row['EditSequence']));
			}
		}

		$this->buildCustomerGuestNameNode($name, $this->spoolNodeData["OrderID"]);

		$this->writeEscapedElement("Name", isc_substr($this->spoolNodeData["FirstName"] . ' ' . $this->spoolNodeData["LastName"], 0, 50));
		$this->writeEscapedElement("IsActive", "true");

		$customerTypeListId = $this->accounting->getCustomerParentTypeListId(true);

		if (!$customerTypeListId || trim($customerTypeListId) == '') {
				throw new QBException("Unable to find customer parent type reference for guest checkout in customerguest", $this->spool);
		}

		$this->xmlWriter->startElement("ParentRef");
		if (isc_strtolower($this->spool["service"]) == "add") {
			$this->writeEscapedElement("FullName", 'Cart Guest Checkout Customers');
		}else{
			$this->writeEscapedElement("ListID", $customerTypeListId);
		}
		$this->xmlWriter->endElement();


		/**
		 * Cannot be set if it is empty
		 */
		if ($this->spoolNodeData["FirstName"] !== '') {
			$this->writeEscapedElement("FirstName", isc_substr($this->spoolNodeData["FirstName"], 0, 25));
		}

		/**
		 * Same with this one
		 */
		if ($this->spoolNodeData["LastName"] !== '') {
			$this->writeEscapedElement("LastName", isc_substr($this->spoolNodeData["LastName"], 0, 25));
		}


		if (isset($this->spoolNodeData["ordbillphone"]) && $this->spoolNodeData["ordbillphone"] !== '') {
			$this->writeEscapedElement("Phone", $this->spoolNodeData["ordbillphone"]);
		} elseif (isset($this->spoolNodeData["Phone"]) && $this->spoolNodeData["Phone"] !== '') {
			$this->writeEscapedElement("Phone", $this->spoolNodeData["Phone"]);
		} else {
			$this->writeEscapedElement("Phone", '555-555-6666');
		}

		if (isset($this->spoolNodeData["ordbillemail"]) && $this->spoolNodeData["ordbillemail"] !== '') {
			$this->writeEscapedElement("Email", $this->spoolNodeData["ordbillemail"]);
		} elseif (isset($this->spoolNodeData["Email"]) && $this->spoolNodeData["Email"] !== '') {
			$this->writeEscapedElement("Email", $this->spoolNodeData["Email"]);
		} else {
			$this->writeEscapedElement("Email", '[email protected]');
		}

		return $this->buildOutput();
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:68,代码来源:entity.customerguest.php


示例13: _ReplaceTokens

		/**
		* _ReplaceTokens
		* Replace the placeholder tokens with values from the database
		*
		* @param String $row The row from the CSV file
		* @param Array $Data A reference to the database row for the product
		* @return String
		*/
		private function _ReplaceTokens($Row, &$Data)
		{

			$tokens = $this->_GetTokens();

			foreach($this->_GetTokens() as $token => $val) {
				if(isset($Data[$val]) || $token == "{PRODLINK}" || $token == "{STORENAME}") {
					switch($token) {
						case "{PRODSUMMARY}": {
							$Data[$val] = $this->_Strip(strip_tags($Data[$val]));

							if(strlen($Data[$val]) > 32) {
								$Data[$val] = isc_substr($Data[$val], 0, 32) . "...";
							}

							$Data[$val] = trim($Data[$val]);
							$Data[$val] = str_replace("\n", "", $Data[$val]);
							$Data[$val] = str_replace("\r", "", $Data[$val]);
							$Data[$val] = str_replace("\t", " ", $Data[$val]);
							break;
						}
						case "{PRODPRICE}": {
							$price = getClass('ISC_TAX')->getPrice($Data[$val], $Data['tax_class_id'], getConfig('taxDefaultTaxDisplayProducts'));
							$Data[$val] = FormatPrice($price, false, true);
							break;
						}
						case "{PRODLINK}": {
							$Data[$val] = ProdLink($Data['prodname']);
							break;
						}
						case "{STORENAME}": {
							$Data[$val] = GetConfig("StoreName");
							break;
						}
					}

					// Replace the value from the row
					$Row = str_replace($token, $Data[$val], $Row);
				}
				else {
					// Replace the value with nothing
					$Row = str_replace($token, "", $Row);
				}
			}

			$Row = str_replace("{Campaign Name}", GetConfig('StoreName'), $Row);
			$Row = str_replace("{Ad Group Name}", $this->_Strip($Data['prodname']), $Row);
			$Row = str_replace("{Component Type}", "Ad", $Row);
			$Row = str_replace("{Component Status}", "On", $Row);
			$Row = str_replace("{Keyword}", "", $Row);
			$Row = str_replace("{Keyword Alt Text}", "", $Row);
			$Row = str_replace("{Keyword Custom URL}", "", $Row);
			$Row = str_replace("{Sponsored Search Bid (USD)}", "", $Row);
			$Row = str_replace("{Sponsored Search Bid Limit (USD)}", "", $Row);
			$Row = str_replace("{Sponsored Search Status}", "", $Row);
			$Row = str_replace("{Match Type}", "", $Row);
			$Row = str_replace("{Content Match Bid (USD)}", "", $Row);
			$Row = str_replace("{Content Match Bid Limit (USD)}", "", $Row);
			$Row = str_replace("{Content Match Status}", "", $Row);
			$Row = str_replace("{Ad Name}", $this->_BuildAdName($Data['prodname']), $Row);
			$Row = str_replace("{Watch List}", "", $Row);
			$Row = str_replace("{Campaign ID}", "", $Row);
			$Row = str_replace("{Campaign Description}", "", $Row);
			$Row = str_replace("{Campaign Start Date}", "", $Row);
			$Row = str_replace("{Campaign End Date}", "", $Row);
			$Row = str_replace("{Ad Group ID}", "", $Row);
			$Row = str_replace("{Ad Group: Optimize Ad Display}", "", $Row);
			$Row = str_replace("{Ad ID}", "", $Row);
			$Row = str_replace("{Keyword ID}", "", $Row);
			$Row = str_replace("{Checksum}", "", $Row);
			$Row = str_replace("{Error Message}", "", $Row);

			// Run one final trim
			$Row = trim($Row);

			// Return the row
			return $Row;
		}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:86,代码来源:addon.ysm.php


示例14: writeRawElement

	/**
	 * Write an XML node element with raw value
	 *
	 * Method will write an XML node element WITHOUT encoding the value. PLEASE BE CAREFULL!!!
	 *
	 * @access protected
	 * @param string $name The XML node name
	 * @param string $value The XML node value
	 * @param int $maxLength The optional maximum length of the value. Default is 0 (unlimited)
	 * @return bool TRUE if the node was created, FALSE on error
	 */
	protected function writeRawElement($name, $value, $maxLength=0)
	{
		if (trim($name) == "") {
			return false;
		}

		if ($maxLength > 0) {
			$value = isc_substr($value, 0, $maxLength);
		}

		$this->xmlWriter->startElement($name);
		$this->xmlWriter->writeRaw($value);
		$this->xmlWriter->endElement();

		return true;
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:27,代码来源:entity.base.php


示例15: buildXML

	public function buildXML()
	{
		if (isc_strtolower($this->spool["service"]) == "edit" && is_array($this->spoolReferenceData)) {
			$this->writeEscapedElement("ListID", $this->spoolReferenceData["ListID"]);
			$this->writeEscapedElement("EditSequence", $this->spoolReferenceData["EditSequence"]);
		}

		$this->buildProductVariationNameNode($this->spoolNodeData["prodname"], $this->spoolNodeData["combinationid"]);
		$this->writeEscapedElement("IsActive", "true");

		/**
		 * Set the product variation parent. Only do this for adding (want to edit the least amount as possible)
		 */
		if (isc_strtolower($this->spool["service"]) == "add") {
			$productTypeListId = $this->accounting->getProductParentTypeListId(true);

			if (!$productTypeListId || trim($productTypeListId) == '') {
				throw new QBException("Unable to find product parent type reference for product variation in productvariation", $this->spool);
			}

			$this->xmlWriter->startElement("ParentRef");
			$this->writeEscapedElement("ListID", $productTypeListId);
			$this->xmlWriter->endElement();
		}

		if ($this->compareClientVersion("7.0") && isset($this->spoolNodeData["vcsku"]) && $this->spoolNodeData["vcsku"] !== "") {
			$this->writeEscapedElement("ManufacturerPartNumber", $this->spoolNodeData["vcsku"]);
		}

		/**
		 * OK, different tag names for different versions for different countries. Good times, good times
		 */
		if ($this->compareClientCountry("uk") || $this->compareClientCountry("ca")) {
			if ($this->compareClientVersion("3.0")) {
				$this->xmlWriter->startElement("TaxCodeForSaleRef");
			} else {
				$this->xmlWriter->startElement("TaxCodeRef");
			}
		} else {
			$this->xmlWriter->startElement("SalesTaxCodeRef");
		}

		$this->writeEscapedElement("FullName", "NON");
		$this->xmlWriter->endElement();

		$this->writeEscapedElement("SalesDesc", isc_substr($this->spoolNodeData["prodvariationname"], 0, 4095));
		$prodPrice = CalcProductVariationPrice($this->spoolNodeData["prodprice"], $this->spoolNodeData["vcpricediff"], $this->spoolNodeData["vcprice"]);
		$this->writeEscapedElement("SalesPrice", number_format($prodPrice, 2, ".", ""));

		/**
		 * We can only set this for the add process as the mod process is only available in versions 7.0 and above
		 */
		if (isc_strtolower($this->spool["service"]) == "add" || $this->compareClientVersion("7.0")) {

			$incomeAccountListId = $this->accounting->getAccountListId("income");

			if (trim($incomeAccountListId) == '') {
				throw new QBException("Cannot find the income account ListID for product variation ID: " . $this->spoolNodeData["combinationid"], $this->spool);
			}

			$this->xmlWriter->startElement("IncomeAccountRef");
			$this->writeEscapedElement("ListID", $incomeAccountListId);
			$this->xmlWriter->endElement();
		}

		if (isset($this->spoolNodeData["prodcostprice"]) && $this->spoolNodeData["prodcostprice"] > 0) {
			$this->writeEscapedElement("PurchaseDesc", isc_substr($this->spoolNodeData["prodvariationname"], 0, 4095));
			$this->writeEscapedElement("PurchaseCost", number_format($this->spoolNodeData["prodcostprice"], 2, ".", ""));
		}

		$cogsAccountListId = $this->accounting->getAccountListId("costofgoodssold");

		if (trim($cogsAccountListId) == '') {
			throw new QBException("Cannot find the cogs account ListID for product variation ID: " . $this->spoolNodeData["combinationid"], $this->spool);
		}

		$this->xmlWriter->startElement("COGSAccountRef");
		$this->writeEscapedElement("ListID", $cogsAccountListId);
		$this->xmlWriter->endElement();

		$fixedAccountListId = $this->accounting->getAccountListId("fixedasset");

		if (trim($fixedAccountListId) == '') {
			throw new QBException("Cannot find the fixed account ListID for product ID: " . $this->spoolNodeData["combinationid"], $this->spool);
		}

		$this->xmlWriter->startElement("AssetAccountRef");
		$this->writeEscapedElement("ListID", $fixedAccountListId);
		$this->xmlWriter->endElement();

		/**
		 * Only do this is we are a new product OR if we are handling the inventory levels
		 */
		if (isc_strtolower($this->spool["service"]) == "add" || $this->accounting->getValue("invlevels") == ACCOUNTING_QUICKBOOKS_TYPE_SHOPPINGCART) {
			$this->writeEscapedElement("ReorderPoint", (int)$this->spoolNodeData["vclowstock"]);
		}

		if ($this->compareClientCountry("uk") && $this->compareClientVersion("2.0")) {
			if (GetConfig("PricesIncludeTax")) {
				$this->writeEscapedElement("AmountIncludesVAT", "1");
//.........这里部分代码省略.........
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:entity.productvariation.php


示例16: GetManualPaymentFields

		/**
		 * Return a list of any manual payment fields that should be shown when creating/editing
		 * an order via the control panel, if any.
		 *
		 * @param array An array containing the details of existing values, if any.
		 * @return array An array of manual payment fields.
		 */
		public function GetManualPaymentFields($existingOrder=array())
		{
			$monthOptions = '';
			$issueMonthOptions = '<option value="">&nbsp;</option>';
			for($i = 1; $i <= 12; $i++) {
				$stamp = mktime(0, 0, 0, $i, 15, date("Y"));
				$i = str_pad($i, 2, "0", STR_PAD_LEFT);

				$monthOptions .= '<option value="'.$i.'">'.date('M', $stamp).'</option>';

				$issueMonthOptions .= '<option value="'.$i.'">'.date('M', $stamp).'</option>';
			}

			$yearOptions = '';
			for($i = date("Y"); $i <= date("Y")+10; $i++) {
				$value = isc_substr($i, 2, 2);
				$yearOptions .= '<option value="'.$value.'">'.$i.'</option>';
			}

			$issueYearOptions = '<option value="">&nbsp;</option>';
			for($i = date("Y"); $i > date("Y")-5; --$i) {
				$value = isc_substr($i, 2, 2);
				$issueYearOptions .= '<option value="'.$value.'">'.$i.'</option>';
			}

			$cardOptions = $this->_GetCCTypes();
			return array(
				'creditcard_name' => array(
					'type' => 'text',
					'title' => GetLang('CCManualCardHoldersName'),
					'value' => '',
					'required' => true
				),
				'creditcard_cctype' => array(
					'type' => 'select',
					'title' => GetLang('CCManualCreditCardType'),
					'options' => $cardOptions,
					'onchange' => "PaymentValidation_" . $this->GetId() . ".updateCreditCardType()",
					'required' => true
				),
				'creditcard_ccno' => array(
					'type' => 'text',
					'title' => GetLang('CCManualCreditCardNo'),
					'value' => '',
					'required' => true
				),
				'creditcard_cccvd' => array(
					'type' => 'text',
					'title' => GetLang('CCManualCreditCardCCV2'),
					'value' => '',
					'required' => true,
					'class' => 'Field50',
				),
				'creditcard_ccexp' => array(
					'type' => 'html',
					'title' => GetLang('CCManualExpirationDate'),
					'html' => '
						<select name="paymentField[' . $this->GetId() . '][creditcard_ccexpm]">'.$monthOptions.'</select>
						&nbsp;
						<select name="paymentField[' . $this->GetId() . '][creditcard_ccexpy]">'.$yearOptions.'</select>
					',
					'required' => true
				),
				'creditcard_issueno' => array(
					'type' => 'text',
					'title' => GetLang('CCManualCreditCardIssueNo'),
					'value' => '',
					'required' => true
				),
				'creditcard_issuedate' => array(
					'type' => 'html',
					'title' => GetLang('CCManualIssueDate'),
					'html' => '
						<select name="paymentField[' . $this->GetId() . '][creditcard_issuedatem]">'.$issueMonthOptions.'</select>
						&nbsp;
						<select name="paymentField[' . $this->GetId() . '][creditcard_issuedatey]">'.$issueYearOptions.'</select>
					',
					'required' => true
				)
			);
		}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:88,代码来源:class.generic.creditcard.php


示例17: setProductGlobals

	public function setProductGlobals($row)
	{
		if($GLOBALS['AlternateClass'] == 'Odd') {
			$GLOBALS['AlternateClass'] = 'Even';
		}
		else {
			$GLOBALS['AlternateClass'] = 'Odd';
		}

		$GLOBALS['ProductCartQuantity'] = '';
		if(isset($GLOBALS['CartQuantity'.$row['productid']])) {
			$GLOBALS['ProductCartQuantity'] = (int)$GLOBALS['CartQuantity'.$row['productid']];
		}

		$GLOBALS['ProductId'] = (int)$row['productid'];
		$GLOBALS['ProductName'] = isc_html_escape($row['prodname']);
		$GLOBALS['ProductLink'] = ProdLink($row['prodname']);
		$GLOBALS['ProductRating'] = (int)$row['prodavgrating'];

		// Determine the price of this product
		$GLOBALS['ProductPrice'] = '';
		if (GetConfig('ShowProductPrice') && !$row['prodhideprice']) {
			$GLOBALS['ProductPrice'] = formatProductCatalogPrice($row);
		}

		// Workout the product description
		$desc = strip_tags($row['proddesc']);

		if (isc_strlen($desc) < 120) {
			$GLOBALS['ProductSummary'] = $desc;
		} else {
			$GLOBALS['ProductSummary'] = isc_substr($desc, 0, 120) . "...";
		}

		$GLOBALS['ProductThumb'] = ImageThumb($row, ProdLink($row['prodname']));
		$GLOBALS['ProductDate'] = isc_date(GetConfig('DisplayDateFormat'), $row['proddateadded']);

		$GLOBALS['ProductPreOrder'] = false;
		$GLOBALS['ProductReleaseDate'] = '';
		$GLOBALS['HideProductReleaseDate'] = 'display:none';

		if ($row['prodpreorder']) {
			$GLOBALS['ProductPreOrder'] = true;
			if ($row['prodreleasedate'] && $row['prodreleasedateremove'] && time() >= (int)$row['prodreleasedate']) {
				$GLOBALS['ProductPreOrder'] = false;
			} else if ($row['prodreleasedate']) {
				$GLOBALS['ProductReleaseDate'] = GetLang('ProductListReleaseDate', array('releasedate' => isc_date(GetConfig('DisplayDateFormat'), (int)$row['prodreleasedate'])));
				$GLOBALS['HideProductReleaseDate'] = '';
			}
		}

		if (isId($row['prodvariationid']) || trim($row['prodconfigfields'])!='' || $row['prodeventdaterequired'] == 1) {
			$GLOBALS['ProductURL'] = ProdLink($row['prodname']);
			$GLOBALS['ProductAddText'] = GetLang('ProductChooseOptionLink');
		} else {
			$GLOBALS['ProductURL'] = CartLink($row['productid']);
			if ($GLOBALS['ProductPreOrder']) {
				$GLOBALS['ProductAddText'] = GetLang('ProductPreOrderCartLink');
			} else {
				$GLOBALS['ProductAddText'] = GetLang('ProductAddToCartLink');
			}
		}

		if (CanAddToCart($row) && GetConfig('ShowAddToCartLink')) {
			$GLOBALS['HideActionAdd'] = '';
		} else {
			$GLOBALS['HideActionAdd'] = 'none';
		}


		$GLOBALS['HideProductVendorName'] = 'display: none';
		$GLOBALS['ProductVendor'] = '';
		if(GetConfig('ShowProductVendorNames') && $row['prodvendorid'] > 0) {
			$vendorCache = $GLOBALS['ISC_CLASS_DATA_STORE']->Read('Vendors');
			if(isset($vendorCache[$row['prodvendorid']])) {
				$GLOBALS['ProductVendor'] = '<a href="'.VendorLink($vendorCache[$row['prodvendorid']]).'">'.isc_html_escape($vendorCache[$row['prodvendorid']]['vendorname']).'</a>';
				$GLOBALS['HideProductVendorName'] = '';
			}
		}
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:80,代码来源:products_panel.php


示例18: GetManualPaymentFields

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP isclanmember函数代码示例发布时间:2022-05-15
下一篇:
PHP isc_strtoupper函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap