コード例 #1
0
ファイル: upgradeproduct.php プロジェクト: billyprice1/whmcs
            $configoptions = array();
        }
        foreach ($configoption as $option) {
            $id = $option['id'];
            $optiontype = $option['optiontype'];
            $selectedvalue = $option['selectedvalue'];
            $selectedqty = $option['selectedqty'];
            if (!isset($configoptions[$id])) {
                if ($optiontype == "3" || $optiontype == "4") {
                    $selectedvalue = $selectedqty;
                }
                $configoptions[$id] = $selectedvalue;
                continue;
            }
        }
        $upgrades = SumUpConfigOptionsOrder($serviceid, $configoptions, $promocode, $paymentmethod, $checkout);
        foreach ($upgrades as $i => $vals) {
            foreach ($vals as $k => $v) {
                $apiresults[$k . ($i + 1)] = $v;
            }
        }
        $subtotal = $GLOBALS['subtotal'];
        $discount = $GLOBALS['discount'];
        $apiresults['subtotal'] = formatCurrency($subtotal);
        $apiresults['discount'] = formatCurrency($discount);
        $apiresults['total'] = formatCurrency($subtotal - $discount);
    } else {
        $apiresults = array("result" => "error", "message" => "Invalid Upgrade Type");
        return null;
    }
}
コード例 #2
0
ファイル: clientsupgrade.php プロジェクト: billyprice1/whmcs
                 echo $aInt->lang("fields", "discount") . ": " . formatCurrency($GLOBALS['discount']) . "<br />";
             }
             echo $aInt->lang("services", "upgradedue") . ": <span style=\"font-size:16px;\">" . $total . "</span>";
         }
     }
     unset($_SESSION['uid']);
     exit;
 } else {
     if ($action == "order") {
         check_token("WHMCS.admin.default");
         $_SESSION['uid'] = $userid;
         if ($type == "product") {
             $upgrades = SumUpPackageUpgradeOrder($id, $newproductid, $billingcycle, $promocode, $service_paymentmethod, true);
         } else {
             if ($type == "configoptions") {
                 $upgrades = SumUpConfigOptionsOrder($id, $configoption, $promocode, $service_paymentmethod, true);
             }
         }
         $upgradedata = createUpgradeOrder($id, "", $promocode, $service_paymentmethod);
         $orderid = $upgradedata['orderid'];
         unset($_SESSION['uid']);
         echo "<s";
         echo "cript language=\"javascript\">\nwindow.opener.location.href = \"orders.php?action=view&id=";
         echo $orderid;
         echo "\";\nwindow.close();\n</script>\n";
         exit;
     } else {
         if (!$action) {
             if (!$type) {
                 $type = "product";
             }