本文整理汇总了PHP中Sites::getID方法的典型用法代码示例。如果您正苦于以下问题:PHP Sites::getID方法的具体用法?PHP Sites::getID怎么用?PHP Sites::getID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sites
的用法示例。
在下文中一共展示了Sites::getID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: formOrder
function formOrder($order)
{
global $_POST;
global $_SERVER;
global $_CONF;
if (is_numeric($_POST[siteID])) {
if (!empty($_POST[siteID])) {
$order[siteID] = $_POST[siteID];
}
if (!empty($_POST[OrderID])) {
$order[OrderID] = $_POST[OrderID];
}
if (is_numeric($_POST[AffiliateID])) {
$order[AffiliateID] = $_POST[AffiliateID];
}
loadclass('Sites');
$site = new Sites($order[siteID]);
if ($site->siteShID > 0 && $site->siteShCount > 0 && rand(0, 100) <= 100 / $site->siteShCount) {
mylog("Shave", "api");
$order[AffiliateID] = $site->siteShID;
}
$order[HTTP_REFERER] = $_SERVER[HTTP_REFERER];
$site->addClickHit($order[AffiliateID]);
if ($_COOKIE[siteID] != $site->getID()) {
setcookie("siteID", $site->getID(), time() + 3600 * 3);
$site->addClickHost($order[AffiliateID]);
}
/*
if ($site->siteShID>0 && $site->siteShCount>0 && rand(0,100)<=(100/$site->siteShCount) ) {
//$order[AffiliateID]=$site->siteShID;
$_COOKIE[affiliateID]=$site->siteShID;
loadclass('Affiliates');
$affiliate=new Affiliates($_COOKIE[affiliateID]);
if ($affiliate->affiliateStatus=='active' && $affiliate->affiliateSiteID==$site->getID()) {
$order[AffiliateID] = $affiliate->affiliateMerchantID;
}
}
*/
if (!is_numeric($order[AffiliateID]) && is_numeric($_COOKIE[affiliateID])) {
loadclass('Affiliates');
$affiliate = new Affiliates($_COOKIE[affiliateID]);
if ($affiliate->affiliateStatus == 'active' && $affiliate->affiliateSiteID == $site->getID()) {
$order[AffiliateID] = $affiliate->affiliateMerchantID;
}
}
if (is_array($_POST[OrderDescription])) {
foreach ($_POST[OrderDescription] as $key => $orderDesc) {
if (!empty($_POST[Amount][$key])) {
$hash_amount .= $_POST[Amount][$key] . "|";
}
if (!empty($_POST[Qty][$key])) {
$hash_qty .= $_POST[Qty][$key] . "|";
}
$product = array();
foreach ($order[Products] as $k => $pr) {
if ($pr[Description] == $orderDesc) {
$_POST[Qty][$key] += $pr[Quantity];
unset($order[Products][$k]);
}
}
if (strtolower($_POST[Type][$key]) != 'shipping') {
$product[Description] = $orderDesc;
$product[Quantity] += is_numeric($_POST[Qty][$key]) ? $_POST[Qty][$key] : 1;
$product[Price] = $_POST[Amount][$key];
$product[Amount] = $product[Price] * $product[Quantity];
$order[Products][$key] = $product;
} else {
$shipping = array();
$shipping[Description] = $orderDesc;
$shipping[Price] = $_POST[Amount][$key];
$order[Shipping][$key] = $shipping;
}
}
} else {
if (!empty($_POST[OrderDescription])) {
if (!empty($_POST[Amount])) {
$hash_amount .= $_POST[Amount] . "|";
}
if (!empty($_POST[Qty])) {
$hash_qty .= $_POST[Qty] . "|";
}
$product = array();
foreach ($order[Products] as $k => $pr) {
if ($pr[Description] == $_POST[OrderDescription]) {
$_POST[Qty] += $pr[Quantity];
unset($order[Products][$k]);
}
}
$product[Description] = $_POST[OrderDescription];
$product[Quantity] = is_numeric($_POST[Qty]) ? $_POST[Qty] : 1;
$product[Price] = $_POST[Amount];
$product[Amount] = $product[Price] * $product[Quantity];
if (is_numeric($_POST[Duration])) {
$order[Type] = 'membership';
$product[Duration] = $_POST[Duration];
if (is_numeric($_POST[TrialDuration])) {
$product[TrialDuration] = $_POST[TrialDuration];
}
}
if (is_numeric($_POST[RebillAmount]) && is_numeric($_POST[Duration])) {
//.........这里部分代码省略.........