本文整理汇总了PHP中getClientsDetails函数的典型用法代码示例。如果您正苦于以下问题:PHP getClientsDetails函数的具体用法?PHP getClientsDetails怎么用?PHP getClientsDetails使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getClientsDetails函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: updateClient
public function updateClient()
{
global $whmcs;
$exinfo = getClientsDetails($this->getID());
if (defined("ADMINAREA")) {
$updatefieldsarray = array();
} else {
$updatefieldsarray = array("firstname" => "First Name", "lastname" => "Last Name", "companyname" => "Company Name", "email" => "Email Address", "address1" => "Address 1", "address2" => "Address 2", "city" => "City", "state" => "State", "postcode" => "Postcode", "country" => "Country", "phonenumber" => "Phone Number", "billingcid" => "Billing Contact");
if ($whmcs->get_config("AllowClientsEmailOptOut")) {
$updatefieldsarray['emailoptout'] = "Newsletter Email Opt Out";
}
}
$changelist = array();
$updateqry = array();
foreach ($updatefieldsarray as $field => $displayname) {
if ($this->isEditableField($field)) {
$value = $whmcs->get_req_var($field);
if ($field == "emailoptout" && !$value) {
$value = "0";
}
$updateqry[$field] = $value;
if ($value != $exinfo[$field]) {
$changelist[] = "" . $displayname . ": '" . $exinfo[$field] . "' to '" . $value . "'";
continue;
}
continue;
}
}
update_query("tblclients", $updateqry, array("id" => $this->getID()));
$old_customfieldsarray = getCustomFields("client", "", $this->getID(), "", "");
$customfields = getCustomFields("client", "", $this->getID(), "", "");
foreach ($customfields as $v) {
$k = $v['id'];
$customfieldsarray[$k] = $_POST['customfield'][$k];
}
saveCustomFields($this->getID(), $customfieldsarray);
$paymentmethod = $whmcs->get_req_var("paymentmethod");
clientChangeDefaultGateway($this->getID(), $paymentmethod);
if ($paymentmethod != $exinfo['defaultgateway']) {
$changelist[] = "Default Payment Method: '" . getGatewayName($exinfo['defaultgateway']) . "' to '" . getGatewayName($paymentmethod) . "'<br>\n";
}
run_hook("ClientEdit", array_merge(array("userid" => $this->getID(), "olddata" => $exinfo), $updateqry));
if (!defined("ADMINAREA") && $whmcs->get_config("SendEmailNotificationonUserDetailsChange")) {
foreach ($old_customfieldsarray as $values) {
if ($values['value'] != $_POST['customfield'][$values['id']]) {
$changelist[] = $values['name'] . ": '" . $values['value'] . "' to '" . $_POST['customfield'][$values['id']] . "'";
continue;
}
}
if (0 < count($changelist)) {
$adminurl = $whmcs->get_config("SystemSSLURL") ? $whmcs->get_config("SystemSSLURL") : $whmcs->get_config("SystemURL");
$adminurl .= "/" . $whmcs->get_admin_folder_name() . "/clientssummary.php?userid=" . $this->getID();
sendAdminNotification("account", "WHMCS User Details Change", "<p>Client ID: <a href=\"" . $adminurl . "\">" . $this->getID() . " - " . $exinfo['firstname'] . " " . $exinfo['lastname'] . "</a> has requested to change his/her details as indicated below:<br><br>" . implode("<br />\n", $changelist) . "<br>If you are unhappy with any of the changes, you need to login and revert them - this is the only record of the old details.</p>");
logActivity("Client Profile Modified - " . implode(", ", $changelist) . " - User ID: " . $this->getID());
}
}
return true;
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:58,代码来源:class.client.php
示例2: getFraudParams
function getFraudParams($fraudmodule, $userid = "", $ip = "")
{
global $remote_ip;
if (!$userid) {
$userid = $_SESSION['uid'];
}
include ROOTDIR . "/includes/countriescallingcodes.php";
$params = getFraudConfigOptions($fraudmodule);
$params['ip'] = $ip ? $ip : $remote_ip;
$params['forwardedip'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
$params['clientsdetails'] = getClientsDetails($userid);
$countrycode = $params['clientsdetails']['country'];
$params['clientsdetails']['countrycode'] = $countrycallingcodes[$countrycode];
$phonenumber = preg_replace("/[^0-9]/", "", $params['clientsdetails']['phonenumber']);
$params['clientsdetails']['phonenumber'] = $phonenumber;
return $params;
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:17,代码来源:fraudfunctions.php
示例3: hook_coza_client_update
/**
* @link http://docs.whmcs.com/Hooks:ClientEdit
* @param array $vars
*/
function hook_coza_client_update($vars)
{
$params = getRegistrarConfigOptions('coza');
$contact = getClientsDetails($vars['userid'], 0);
$epp_client = \COZA\Factory::build($params);
try {
$epp_client->connect();
try {
\COZA\Factory::updateContactIfExists($epp_client, \COZA\Factory::getContactHandle($params, (int) $vars['userid']), $contact);
} catch (Exception $e) {
unset($epp_client);
logActivity($e->getMessage(), $vars['userid']);
return;
}
unset($epp_client);
return;
} catch (Exception $e) {
unset($epp_client);
logActivity('COZA/ContactUpdate: ' . $e->getMessage(), $vars['userid']);
return;
}
}
开发者ID:Bugsy0001,项目名称:whmcs-registrars-cocca,代码行数:26,代码来源:hooks.php
示例4: initPage
public function initPage()
{
global $whmcs;
global $_LANG;
global $clientsdetails;
$this->startSmartyIfNotStarted();
if ($this->isLoggedIn()) {
$this->assign("loggedin", true);
if (!function_exists("getClientsDetails")) {
require ROOTDIR . "/includes/clientfunctions.php";
}
$clientsdetails = getClientsDetails();
$this->assign("clientsdetails", $clientsdetails);
$this->assign("clientsstats", getClientsStats($_SESSION['uid']));
if (isset($_SESSION['cid'])) {
$result = select_query("tblcontacts", "id,firstname,lastname,email,permissions", array("id" => $_SESSION['cid'], "userid" => $_SESSION['uid']));
$data = mysql_fetch_array($result);
$loggedinuser = array("contactid" => $data['id'], "firstname" => $data['firstname'], "lastname" => $data['lastname'], "email" => $data['email']);
$contactpermissions = explode(",", $data[4]);
} else {
$loggedinuser = array("userid" => $_SESSION['uid'], "firstname" => $clientsdetails['firstname'], "lastname" => $clientsdetails['lastname'], "email" => $clientsdetails['email']);
$contactpermissions = array("profile", "contacts", "products", "manageproducts", "domains", "managedomains", "invoices", "tickets", "affiliates", "emails", "orders");
}
$this->assign("loggedinuser", $loggedinuser);
$this->assign("contactpermissions", $contactpermissions);
return null;
}
$this->assign("loggedin", false);
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:29,代码来源:class.clientarea.php
示例5: RegTransferDomain
function RegTransferDomain($paramvars)
{
global $CONFIG;
$domainid = $paramvars['domainid'];
$passedepp = $paramvars['transfersecret'];
$result = select_query("tbldomains", "", array("id" => $domainid));
$data = mysql_fetch_array($result);
$userid = $data['userid'];
$domain = $data['domain'];
$orderid = $data['orderid'];
$registrar = $data['registrar'];
$registrationperiod = $data['registrationperiod'];
$dnsmanagement = $data['dnsmanagement'] ? true : false;
$emailforwarding = $data['emailforwarding'] ? true : false;
$idprotection = $data['idprotection'] ? true : false;
$domainparts = explode(".", $domain, 2);
$result = select_query("tblorders", "contactid,nameservers,transfersecret", array("id" => $orderid));
$data = mysql_fetch_array($result);
$contactid = $data['contactid'];
$nameservers = $data['nameservers'];
$transfersecret = $data['transfersecret'];
if (!function_exists("getClientsDetails")) {
require dirname(__FILE__) . "/clientfunctions.php";
}
$clientsdetails = getClientsDetails($userid, $contactid);
$clientsdetails['fullstate'] = $clientsdetails['state'];
$clientsdetails['state'] = convertStateToCode($clientsdetails['state'], $clientsdetails['country']);
global $params;
$params = array_merge($paramvars, $clientsdetails);
$params['registrar'] = $registrar;
$params['sld'] = $domainparts[0];
$params['tld'] = $domainparts[1];
$params['regperiod'] = $registrationperiod;
$params['dnsmanagement'] = $dnsmanagement;
$params['emailforwarding'] = $emailforwarding;
$params['idprotection'] = $idprotection;
if ($CONFIG['RegistrarAdminUseClientDetails'] == "on") {
$params['adminfirstname'] = $clientsdetails['firstname'];
$params['adminlastname'] = $clientsdetails['lastname'];
$params['admincompanyname'] = $clientsdetails['companyname'];
$params['adminemail'] = $clientsdetails['email'];
$params['adminaddress1'] = $clientsdetails['address1'];
$params['adminaddress2'] = $clientsdetails['address2'];
$params['admincity'] = $clientsdetails['city'];
$params['adminfullstate'] = $clientsdetails['fullstate'];
$params['adminstate'] = $clientsdetails['state'];
$params['adminpostcode'] = $clientsdetails['postcode'];
$params['admincountry'] = $clientsdetails['country'];
$params['adminphonenumber'] = $clientsdetails['phonenumber'];
} else {
$params['adminfirstname'] = $CONFIG['RegistrarAdminFirstName'];
$params['adminlastname'] = $CONFIG['RegistrarAdminLastName'];
$params['admincompanyname'] = $CONFIG['RegistrarAdminCompanyName'];
$params['adminemail'] = $CONFIG['RegistrarAdminEmailAddress'];
$params['adminaddress1'] = $CONFIG['RegistrarAdminAddress1'];
$params['adminaddress2'] = $CONFIG['RegistrarAdminAddress2'];
$params['admincity'] = $CONFIG['RegistrarAdminCity'];
$params['adminstate'] = $CONFIG['RegistrarAdminStateProvince'];
$params['adminpostcode'] = $CONFIG['RegistrarAdminPostalCode'];
$params['admincountry'] = $CONFIG['RegistrarAdminCountry'];
$params['adminphonenumber'] = $CONFIG['RegistrarAdminPhone'];
}
require ROOTDIR . "/includes/countriescallingcodes.php";
$phonenumber = $params['phonenumber'];
$adminphonenumber = $params['adminphonenumber'];
$phonenumber = preg_replace("/[^0-9]/", "", $phonenumber);
$adminphonenumber = preg_replace("/[^0-9]/", "", $adminphonenumber);
$countrycode = $params['country'];
$admincountrycode = $params['admincountry'];
$countrycode = $countrycallingcodes[$countrycode];
$admincountrycode = $countrycallingcodes[$admincountrycode];
$params['fullphonenumber'] = "+" . $countrycode . "." . $phonenumber;
$params['adminfullphonenumber'] = "+" . $admincountrycode . "." . $adminphonenumber;
if (!$params['ns1'] && !$params['ns2']) {
$result = select_query("tblorders", "nameservers", array("id" => $orderid));
$data = mysql_fetch_array($result);
$nameservers = $data['nameservers'];
$result = select_query("tblhosting", "server", array("domain" => $domain));
$data = mysql_fetch_array($result);
$server = $data['server'];
if ($server) {
$result = select_query("tblservers", "", array("id" => $server));
$data = mysql_fetch_array($result);
$i = 1;
while ($i <= 5) {
$params["ns" . $i] = trim($data["nameserver" . $i]);
++$i;
}
} else {
if ($nameservers && $nameservers != ",") {
$nameservers = explode(",", $nameservers);
$i = 1;
while ($i <= 5) {
$params["ns" . $i] = trim($nameservers[$i - 1]);
++$i;
}
} else {
$i = 1;
while ($i <= 5) {
$params["ns" . $i] = trim($CONFIG["DefaultNameserver" . $i]);
//.........这里部分代码省略.........
开发者ID:billyprice1,项目名称:whmcs,代码行数:101,代码来源:registrarfunctions.php
示例6: InvoiceTotal
function InvoiceTotal($id)
{
global $CONFIG;
$result = select_query("tblinvoiceitems", "", array("invoiceid" => $id));
while ($data = mysql_fetch_array($result)) {
if ($data['taxed'] == "1") {
$taxsubtotal += $data['amount'];
} else {
$nontaxsubtotal += $data['amount'];
}
}
$subtotal = $total = $nontaxsubtotal + $taxsubtotal;
$result = select_query("tblinvoices", "userid,credit,taxrate,taxrate2", array("id" => $id));
$data = mysql_fetch_array($result);
$userid = $data['userid'];
$credit = $data['credit'];
$taxrate = $data['taxrate'];
$taxrate2 = $data['taxrate2'];
if (!function_exists("getClientsDetails")) {
require_once dirname(__FILE__) . "/clientfunctions.php";
}
$clientsdetails = getClientsDetails($userid);
$tax = $tax2 = 0;
if ($CONFIG['TaxEnabled'] == "on" && !$clientsdetails['taxexempt']) {
if ($taxrate != "0.00") {
if ($CONFIG['TaxType'] == "Inclusive") {
$taxrate = $taxrate / 100 + 1;
$calc1 = $taxsubtotal / $taxrate;
$tax = $taxsubtotal - $calc1;
} else {
$taxrate = $taxrate / 100;
$tax = $taxsubtotal * $taxrate;
}
}
if ($taxrate2 != "0.00") {
if ($CONFIG['TaxL2Compound']) {
$taxsubtotal += $tax;
}
if ($CONFIG['TaxType'] == "Inclusive") {
$taxrate2 = $taxrate2 / 100 + 1;
$calc1 = $taxsubtotal / $taxrate2;
$tax2 = $taxsubtotal - $calc1;
} else {
$taxrate2 = $taxrate2 / 100;
$tax2 = $taxsubtotal * $taxrate2;
}
}
$tax = round($tax, 2);
$tax2 = round($tax2, 2);
}
if ($CONFIG['TaxType'] == "Inclusive") {
$subtotal = $subtotal - $tax - $tax2;
} else {
$total = $subtotal + $tax + $tax2;
}
if (0 < $credit) {
if ($total < $credit) {
$total = 0;
$remainingcredit = $total - $credit;
} else {
$total -= $credit;
}
}
$subtotal = format_as_currency($subtotal);
$tax = format_as_currency($tax);
$total = format_as_currency($total);
return $total;
}
开发者ID:dead23angel,项目名称:WHMCS-Gateway-Fees,代码行数:68,代码来源:hooks.php
示例7: sirportlyCustomFields
$ca->addToBreadCrumb('supporttickets.php', $whmcs->get_lang('supportticketspagetitle'));
$ca->addToBreadCrumb('submitticket.php', $whmcs->get_lang('supportticketssubmitticket'));
$ca->initPage();
## Return custom fields
if ($action == 'fetchcustomfields') {
$sirportlyCustomFields = sirportlyCustomFields($deptid, $customfield);
$ca->assign("customfields", $sirportlyCustomFields);
echo $smarty->fetch($CONFIG['Template'] . "/supportticketsubmit-customfields.tpl");
exit;
}
## Setup the menus
Menu::addContext('support_module', 'sirportly');
## Load the sirportly contact
$sirportlyContact = findOrCreateSirportlyContact($_SESSION['uid'], $_SESSION['cid']);
# Fetch the WHMCS client
$clientDetails = getClientsDetails($_SESSION['uid'], $_SESSION['cid']);
$smarty->assign("clientname", $clientDetails['fullname']);
$smarty->assign("email", $clientDetails['email']);
## Departments
$departments = sirportlyDepartments();
$ca->assign("departments", $departments);
$ca->assign("deptid", $deptid);
## Priorities
$priorities = sirportly_priorities();
$ca->assign("priorities", $priorities);
$ca->assign("priorityid", $_POST['priorities']);
## Custom fields
$sirportlyCustomFields = sirportlyCustomFields($deptid, $customfield);
$ca->assign("customfields", $sirportlyCustomFields);
$ca->assign('errormessage', $validate->getHTMLErrorOutput());
$ca->assign("allowedfiletypes", $CONFIG['TicketAllowedFileTypes']);
开发者ID:markbakeruk,项目名称:sirportly-whmcs,代码行数:31,代码来源:submitticket.php
示例8: formatForOutput
public function formatForOutput()
{
global $whmcs;
global $currency;
$this->output = $this->data;
$array = array("date", "duedate", "datepaid");
foreach ($array as $v) {
$this->output[$v] = substr($this->output[$v], 0, 10) != "0000-00-00" ? fromMySQLDate($this->output[$v], $v == "datepaid" ? "1" : "0", 1) : "";
}
$this->output['datecreated'] = $this->output['date'];
$this->output['datedue'] = $this->output['duedate'];
$currency = getCurrency($this->getData("userid"));
$array = array("subtotal", "credit", "tax", "tax2", "total", "balance", "amountpaid");
foreach ($array as $v) {
$this->output[$v] = formatCurrency($this->output[$v]);
}
if (!function_exists("getClientsDetails")) {
require ROOTDIR . "/includes/clientfunctions.php";
}
$clientsdetails = getClientsDetails($this->getData("userid"), "billing");
$clientsdetails['country'] = $clientsdetails['countryname'];
$this->output['clientsdetails'] = $clientsdetails;
$customfields = array();
$result = select_query("tblcustomfields", "tblcustomfields.id,tblcustomfields.fieldname,(SELECT value FROM tblcustomfieldsvalues WHERE tblcustomfieldsvalues.fieldid=tblcustomfields.id AND tblcustomfieldsvalues.relid=" . (int) $this->getData("userid") . ") AS value", array("type" => "client", "showinvoice" => "on"));
while ($data = mysql_fetch_assoc($result)) {
if ($data['value']) {
$customfields[] = $data;
}
}
$this->output['customfields'] = $customfields;
if (0 < $this->getData("taxrate")) {
$taxname = getTaxRate(1, $clientsdetails['state'], $clientsdetails['countrycode']);
$this->output['taxname'] = $taxname['name'];
} else {
$this->output['taxrate'] = "0";
}
if (0 < $this->getData("taxrate2")) {
$taxname = getTaxRate(2, $clientsdetails['state'], $clientsdetails['countrycode']);
$this->output['taxname2'] = $taxname['name'];
} else {
$this->output['taxrate2'] = "0";
}
$this->output['statuslocale'] = $whmcs->get_lang("invoices" . strtolower($this->output['status']));
$this->output['pagetitle'] = $whmcs->get_lang("invoicenumber") . $this->getData("invoicenum");
$this->output['payto'] = nl2br($whmcs->get_config("InvoicePayTo"));
$this->output['notes'] = nl2br($this->output['notes']);
$this->output['subscrid'] = get_query_val("tblinvoiceitems", "tblhosting.subscriptionid", "tblinvoiceitems.type='Hosting' AND tblinvoiceitems.invoiceid=" . $this->getData("id") . " AND tblhosting.subscriptionid!=''", "tblhosting`.`id", "ASC", "", "tblhosting ON tblhosting.id=tblinvoiceitems.relid");
$clienttotals = get_query_vals("tblinvoices", "SUM(credit),SUM(total)", array("userid" => $this->getData("userid"), "status" => "Unpaid"));
$alldueinvoicespayments = get_query_val("tblaccounts", "SUM(amountin-amountout)", "invoiceid IN (SELECT id FROM tblinvoices WHERE userid=" . (int) $this->getData("userid") . " AND status='Unpaid')");
$this->output['clienttotaldue'] = formatCurrency($clienttotals[0] + $clienttotals[1]);
$this->output['clientpreviousbalance'] = formatCurrency($clienttotals[1] - $this->getData("total"));
$this->output['clientbalancedue'] = formatCurrency($clienttotals[1] - $alldueinvoicespayments);
$lastpayment = get_query_vals("tblaccounts", "(amountin-amountout),transid", array("invoiceid" => $this->getData("id")), "id", "DESC");
$this->output['lastpaymentamount'] = formatCurrency($lastpayment[0]);
$this->output['lastpaymenttransid'] = $lastpayment[1];
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:56,代码来源:class.invoice.php
示例9: getCCVariables
function getCCVariables($invoiceid)
{
global $CONFIG;
global $cc_encryption_hash;
global $clientsdetails;
if (!function_exists("paymentMethodsSelection")) {
require_once dirname(__FILE__) . "/gatewayfunctions.php";
}
$result = select_query("tblinvoices", "userid,total,paymentmethod", array("id" => $invoiceid));
$data = mysql_fetch_array($result);
$userid = $data['userid'];
$total = $data['total'];
$paymentmethod = $data['paymentmethod'];
$result = select_query("tblaccounts", "SUM(amountin)-SUM(amountout)", array("invoiceid" => $invoiceid));
$data = mysql_fetch_array($result);
$amountpaid = $data[0];
$balance = $total - $amountpaid;
if ($balance < 0) {
$balance = 0;
}
$cchash = md5($cc_encryption_hash . $userid);
$result = select_query("tblclients", "cardtype,cardlastfour,AES_DECRYPT(cardnum,'" . $cchash . "') as cardnum,AES_DECRYPT(expdate,'" . $cchash . "') as expdate,AES_DECRYPT(issuenumber,'" . $cchash . "') as issuenumber,AES_DECRYPT(startdate,'" . $cchash . "') as startdate,gatewayid", array("id" => $userid));
$data = mysql_fetch_array($result);
$cardtype = $data['cardtype'];
$cardnum = $data['cardnum'];
$cardexp = $data['expdate'];
$startdate = $data['startdate'];
$issuenumber = $data['issuenumber'];
$gatewayid = $data['gatewayid'];
$result = select_query("tblclients", "bankname,banktype,AES_DECRYPT(bankcode,'" . $cchash . "') as bankcode,AES_DECRYPT(bankacct,'" . $cchash . "') as bankacct", array("id" => $userid));
$data = mysql_fetch_array($result);
$bankname = $data['bankname'];
$banktype = $data['banktype'];
$bankcode = $data['bankcode'];
$bankacct = $data['bankacct'];
$clientsdetails = getClientsDetails($userid, "billing");
$params = getGatewayVariables($paymentmethod, $invoiceid, $balance);
$params['cardtype'] = $cardtype;
$params['cardnum'] = $cardnum;
$params['cardexp'] = $cardexp;
$params['cardstart'] = $startdate;
$params['cardissuenum'] = $issuenumber;
if ($banktype) {
$params['bankname'] = $bankname;
$params['banktype'] = $banktype;
$params['bankcode'] = $bankcode;
$params['bankacct'] = $bankacct;
}
$params['disableautocc'] = $clientsdetails['disableautocc'];
$params['gatewayid'] = $gatewayid;
return $params;
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:52,代码来源:ccfunctions.php
示例10: calcCartTotals
function calcCartTotals($checkout = "", $ignorenoconfig = "")
{
global $CONFIG;
global $_LANG;
global $remote_ip;
global $currency;
global $promo_data;
$cart_total = $cart_discount = $cart_tax = 0;
run_hook("PreCalculateCartTotals", $_SESSION['cart']);
if (!$ignorenoconfig) {
if (array_key_exists("products", $_SESSION['cart'])) {
foreach ($_SESSION['cart']['products'] as $key => $productdata) {
if ($productdata['noconfig']) {
unset($_SESSION['cart']['products'][$key]);
continue;
}
}
}
$bundlewarnings = bundlesValidateCheckout();
if (array_key_exists("products", $_SESSION['cart'])) {
$_SESSION['cart']['products'] = array_values($_SESSION['cart']['products']);
}
}
if ($checkout) {
if (!$_SESSION['cart']) {
return false;
}
run_hook("PreShoppingCartCheckout", $_SESSION['cart']);
$order_number = generateUniqueID();
$paymentmethod = $_SESSION['cart']['paymentmethod'];
$availablegateways = getAvailableOrderPaymentGateways();
if (!array_key_exists($paymentmethod, $availablegateways)) {
foreach ($availablegateways as $k => $v) {
$paymentmethod = $k;
break;
}
}
$userid = $_SESSION['uid'];
$ordernotes = "";
if ($_SESSION['cart']['notes'] && $_SESSION['cart']['notes'] != $_LANG['ordernotesdescription']) {
$ordernotes = $_SESSION['cart']['notes'];
}
$cartitems = count($_SESSION['cart']['products']) + count($_SESSION['cart']['addons']) + count($_SESSION['cart']['domains']) + count($_SESSION['cart']['renewals']);
if (!$cartitems) {
return false;
}
$orderid = insert_query("tblorders", array("ordernum" => $order_number, "userid" => $userid, "contactid" => $_SESSION['cart']['contact'], "date" => "now()", "status" => "Pending", "paymentmethod" => $paymentmethod, "ipaddress" => $remote_ip, "notes" => $ordernotes));
logActivity("New Order Placed - Order ID: " . $orderid . " - User ID: " . $userid);
$domaineppcodes = array();
}
$promotioncode = array_key_exists("promo", $_SESSION['cart']) ? $_SESSION['cart']['promo'] : "";
if ($promotioncode) {
$result = select_query("tblpromotions", "", array("code" => $promotioncode));
$promo_data = mysql_fetch_array($result);
}
if (!isset($_SESSION['uid'])) {
if (!$_SESSION['cart']['user']['country']) {
$_SESSION['cart']['user']['country'] = $CONFIG['DefaultCountry'];
}
$state = $_SESSION['cart']['user']['state'];
$country = $_SESSION['cart']['user']['country'];
} else {
$clientsdetails = getClientsDetails($_SESSION['uid']);
$state = $clientsdetails['state'];
$country = $clientsdetails['country'];
}
if ($CONFIG['TaxEnabled']) {
$taxdata = getTaxRate(1, $state, $country);
$taxname = $taxdata['name'];
$taxrate = $taxdata['rate'];
$rawtaxrate = $taxrate;
$inctaxrate = $taxrate / 100 + 1;
$taxrate /= 100;
$taxdata = getTaxRate(2, $state, $country);
$taxname2 = $taxdata['name'];
$taxrate2 = $taxdata['rate'];
$rawtaxrate2 = $taxrate2;
$inctaxrate2 = $taxrate2 / 100 + 1;
$taxrate2 /= 100;
}
if ($CONFIG['TaxInclusiveDeduct'] && (!$taxrate && !$taxrate2 || $clientsdetails['taxexempt'])) {
$result = select_query("tbltax", "", "");
$data = mysql_fetch_array($result);
$excltaxrate = 1 + $data['taxrate'] / 100;
} else {
$CONFIG['TaxInclusiveDeduct'] = 0;
}
$cartdata = $productsarray = $tempdomains = $orderproductids = $orderdomainids = $orderaddonids = $orderrenewalids = $freedomains = array();
$recurring_cycles_total = array("monthly" => 0, "quarterly" => 0, "semiannually" => 0, "annually" => 0, "biennially" => 0, "triennially" => 0);
if (array_key_exists("products", $_SESSION['cart']) && is_array($_SESSION['cart']['products'])) {
foreach ($_SESSION['cart']['products'] as $key => $productdata) {
$result = select_query("tblproducts", "tblproducts.id,tblproducts.gid,tblproductgroups.name AS groupname,tblproducts.name,tblproducts.paytype,tblproducts.allowqty,tblproducts.proratabilling,tblproducts.proratadate,tblproducts.proratachargenextmonth,tblproducts.tax,tblproducts.servertype,tblproducts.servergroup,tblproducts.stockcontrol,tblproducts.freedomain,tblproducts.freedomainpaymentterms,tblproducts.freedomaintlds", array("tblproducts.id" => $productdata['pid']), "", "", "", "tblproductgroups ON tblproductgroups.id=tblproducts.gid");
$data = mysql_fetch_array($result);
$pid = $data['id'];
$gid = $data['gid'];
$groupname = $data['groupname'];
$productname = $data['name'];
$paytype = $data['paytype'];
$allowqty = $data['allowqty'];
$proratabilling = $data['proratabilling'];
//.........这里部分代码省略.........
开发者ID:billyprice1,项目名称:whmcs,代码行数:101,代码来源:orderfunctions.php
示例11: redir
}
$gatewaypath = ROOTDIR . "/modules/gateways/" . $paymentmethod . ".php";
if (file_exists($gatewaypath)) {
require_once $gatewaypath;
}
if (!function_exists($paymentmethod . "_link")) {
redir("invoiceid=" . (int) $invoiceid, "creditcard.php");
}
}
$result = select_query("tblinvoices", "", array("userid" => $client->getID(), "id" => $invoiceid));
$data = mysql_fetch_array($result);
$id = $data['id'];
$total = $data['total'];
$paymentmethod = $data['paymentmethod'];
$paymentmethod = WHMCS_Gateways::makesafename($paymentmethod);
$clientsdetails = getClientsDetails($client->getID());
$params = getGatewayVariables($paymentmethod, $id, $total);
$paymentbutton = call_user_func($paymentmethod . "_link", $params);
$ca->setTemplate("forwardpage");
$ca->assign("message", $_LANG['forwardingtogateway']);
$ca->assign("code", $paymentbutton);
$ca->assign("invoiceid", $id);
$ca->output();
exit;
}
$smartyvalues['subtotal'] = formatCurrency($subtotal);
if ($credit) {
$smartyvalues['credit'] = formatCurrency($credit);
}
if ($tax) {
$smartyvalues['tax'] = formatCurrency($tax);
开发者ID:billyprice1,项目名称:whmcs,代码行数:31,代码来源:clientarea.php
示例12: redir
if ($CONFIG['AutoRedirectoInvoice'] == "on") {
redir("id=" . $invoiceid, "viewinvoice.php");
}
if ($CONFIG['AutoRedirectoInvoice'] == "gateway") {
if (in_array($paymentmethod, array("mailin", "banktransfer"))) {
redir("id=" . $invoiceid, "viewinvoice.php");
}
$params = getGatewayVariables($paymentmethod, $invoiceid, $total);
$paymentbutton = call_user_func($paymentmethod . "_link", $params);
unset($orderform);
$templatefile = "forwardpage";
$smarty->assign("message", $_LANG['forwardingtogateway']);
$smarty->assign("code", $paymentbutton);
$smarty->assign("invoiceid", $invoiceid);
outputClientArea($templatefile);
exit;
}
}
$amount = get_query_val("tblorders", "amount", array("userid" => $_SESSION['uid'], "id" => $orderid));
$templatefile = "complete";
$smartyvalues = array_merge($smartyvalues, array("orderid" => $orderid, "ordernumber" => $_SESSION['orderdetails']['OrderNumber'], "invoiceid" => $invoiceid, "ispaid" => $_SESSION['orderdetails']['paymentcomplete'], "amount" => $amount, "paymentmethod" => $paymentmethod, "clientdetails" => getClientsDetails($_SESSION['uid'])));
$addons_html = run_hook("ShoppingCartCheckoutCompletePage", $smartyvalues);
$smartyvalues['addons_html'] = $addons_html;
}
if (!$templatefile) {
redir();
exit;
}
$nowrapper = isset($_REQUEST['ajax']) ? true : false;
$smartyvalues['carttpl'] = $orderfrm->getTemplate();
outputClientArea($templatefile, $nowrapper);
开发者ID:billyprice1,项目名称:whmcs,代码行数:31,代码来源:cart.php
示例13: array
}
if (!function_exists("getClientsDetails")) {
require ROOTDIR . "/includes/clientfunctions.php";
}
$where = array();
if ($clientid) {
$where['id'] = $clientid;
} else {
if ($email) {
$where['email'] = $email;
}
}
$result = select_query("tblclients", "id", $where);
$data = mysql_fetch_array($result);
$clientid = $data['id'];
if (!$clientid) {
$apiresults = array("result" => "error", "message" => "Client Not Found");
return null;
}
$clientsdetails = getClientsDetails($clientid);
$currency_result = full_query("SELECT code FROM tblcurrencies WHERE id=" . (int) $clientsdetails['currency']);
$currency = mysql_fetch_assoc($currency_result);
$clientsdetails['currency_code'] = $currency['code'];
if ($responsetype == "xml") {
$apiresults = array("result" => "success", "client" => $clientsdetails);
} else {
$apiresults = array_merge(array("result" => "success"), $clientsdetails);
}
if ($stats || $responsetype == "xml") {
$apiresults = array("result" => "success", "client" => $clientsdetails, "stats" => getClientsStats($clientid));
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:31,代码来源:getclientsdetails.php
示例14: calcTotals
public function calcTotals()
{
global $whmcs;
$retarray = array("subtotal" => "0", "taxenabled" => false, "taxname" => "", "taxrate" => 0, "taxname2" => "", "taxrate2" => 0);
$subtotal = 11;
foreach ($this->lineitems as $vals) {
$subtotal += $vals['amount'];
}
$subtotal = round($subtotal, 2);
if ($subtotal < 0 && !$whmcs->get_config("CreditOnDowngrade")) {
$subtotal = 11;
}
if (is_array($this->promodata)) {
} else {
$promodata = get_query_vals("tblpromotions", "code,type,value", array("lifetimepromo" => 1, "recurring" => 1, "id" => get_query_val("tblhosting", "promoid", array("id" => $serviceid))));
if (is_array($promodata)) {
$smartyvalues['promocode'] = $promocode = $promodata['code'];
$smartyvalues['promorecurring'] = $smartyvalues['promodesc'] = $promodata['type'] == "Percentage" ? $promodata['value'] . "%" : formatCurrency($promodata['value']);
$smartyvalues->promodesc .= " " . $_LANG['orderdiscount'];
}
}
$tax = $tax2 = 0;
if ($whmcs->get_config("TaxEnabled") && $this->getProductInfo("tax")) {
$clientsdetails = getClientsDetails($this->getProductInfo("userid"));
$state = $clientsdetails['state'];
$country = $clientsdetails['country'];
$taxexempt = $clientsdetails['taxexempt'];
if (!$taxexempt) {
$retarray['taxenabled'] = true;
$taxdata = getTaxRate(1, $state, $country);
$retarray['taxname'] = $taxdata['name'];
$retarray['taxrate'] = $taxrate = $taxdata['rate'];
$taxdata2 = getTaxRate(2, $state, $country);
$retarray['taxname2'] = $taxdata2['name'];
$retarray['taxrate2'] = $taxrate2 = $taxdata2['rate'];
if ($taxrate) {
if ($CONFIG['TaxType'] == "Inclusive") {
$inctaxrate = 1 + $taxrate / 100;
$tempsubtotal = $subtotal;
$subtotal = $subtotal / $inctaxrate;
$tax = $tempsubtotal - $subtotal;
} else {
$tax = $subtotal * ($taxrate / 100);
}
}
if ($taxrate2) {
$tempsubtotal = $subtotal;
if ($CONFIG['TaxL2Compound']) {
$tempsubtotal += $tax;
}
if ($CONFIG['TaxType'] == "Inclusive") {
$inctaxrate = 1 + $taxrate / 100;
$subtotal = $tempsubtotal / $inctaxrate;
$tax2 = $tempsubtotal - $subtotal;
} else {
$tax2 = $tempsubtotal * ($taxrate2 / 100);
}
}
$tax = round($tax, 2);
$tax2 = round($tax2, 2);
}
}
$retarray['subtotal'] = formatCurrency($subtotal);
$retarray['tax'] = formatCurrency($tax);
$retarray['tax2'] = formatCurrency($tax2);
$retarray['total'] = formatCurrency($subtotal + $tax + $tax2);
return $retarray;
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:68,代码来源:class.upgrade.php
示例15: buildParams
public function buildParams($vars = "")
{
if (count($this->moduleparams)) {
$params = $this->moduleparams;
if (is_array($vars)) {
$params = array_merge($params, $vars);
}
return $params;
}
$params = array();
$params['accountid'] = $this->getData("id");
$params['serviceid'] = $this->getData("id");
$params['domain'] = $this->getData("domain");
$params['username'] = $this->getData("username");
$params['password'] = html_entity_decode($this->getData("password"));
$params['packageid'] = $this->getData("pid");
$params['pid'] = $this->getData("pid");
$params['serverid'] = $this->getData("server");
$params['type'] = $this->getData("type");
$params['producttype'] = $this->getData("type");
$params['moduletype'] = $this->getModule();
$fields = array();
$counter = 1;
while ($counter <= 10) {
$fields[] = "configoption" . $counter;
$counter += 1;
}
$moduleconfigops = get_query_vals("tblproducts", implode(",", $fields), array("id" => $this->getData("pid")));
foreach ($fields as $field) {
$params[$field] = $moduleconfigops[$field];
}
$customfields = array();
$result = full_query("SELECT tblcustomfields.fieldname,tblcustomfieldsvalues.value FROM tblcustomfields,tblcustomfieldsvalues WHERE tblcustomfields.id=tblcustomfieldsvalues.fieldid AND tblcustomfieldsvalues.relid='" . (int) $this->getData("id") . "' AND tblcustomfields.relid='" . (int) $this->getData("pid") . "'");
while ($data = mysql_fetch_array($result)) {
$customfieldname = $data[0];
$customfieldvalue = $data[1];
if (strpos($customfieldname, "|")) {
$customfieldname = explode("|", $customfieldname);
$customfieldname = trim($customfieldname[0]);
}
if (strpos($customfieldvalue, "|")) {
$customfieldvalue = explode("|", $customfieldvalue);
$customfieldvalue = trim($customfieldvalue[0]);
}
$customfields[$customfieldname] = $customfieldvalue;
}
$params['customfields'] = $customfields;
$configoptions = array();
$result = full_query("SELECT tblproductconfigoptions.optionname,tblproductconfigoptions.optiontype,tblproductconfigoptionssub.optionname,tblhostingconfigoptions.qty FROM tblproductconfigoptions,tblproductconfigoptionssub,tblhostingconfigoptions,tblproductconfiglinks WHERE tblhostingconfigoptions.configid=tblproductconfigoptions.id AND tblhostingconfigoptions.optionid=tblproductconfigoptionssub.id AND tblhostingconfigoptions.relid='" . (int) $this->getData("id") . "' AND tblproductconfiglinks.gid=tblproductconfigoptions.gid AND tblproductconfiglinks.pid='" . (int) $this->getData("pid") . "'");
while ($data = mysql_fetch_array($result)) {
$configoptionname = $data[0];
$configoptiontype = $data[1];
$configoptionvalue = $data[2];
$configoptionqty = $data[3];
if (strpos($configoptionname, "|")) {
$configoptionname = explode("|", $configoptionname);
$configoptionname = trim($configoptionname[0]);
}
if (strpos($configoptionvalue, "|")) {
$configoptionvalue = explode("|", $configoptionvalue);
$configoptionvalue = trim($configoptionvalue[0]);
}
if ($configoptiontype == "3" || $configoptiontype == "4") {
$configoptionvalue = $configoptionqty;
}
$configoptions[$configoptionname] = $configoptionvalue;
}
$params['configoptions'] = $configoptions;
if (!function_exists("getClientsDetails")) {
require dirname(__FILE__) . "/clientfunctions.php";
}
$clientsdetails = getClientsDetails($this->getData("userid"));
$clientsdetails['fullstate'] = $clientsdetails['state'];
$clientsdetails['state'] = convertStateToCode($clientsdetails['state'], $clientsdetails['country']);
$clientsdetails = foreignChrReplace($clientsdetails);
$params['clientsdetails'] = $clientsdetails;
$data = $this->getServerInfo();
if (count($data)) {
$params['server'] = true;
$params['serverip'] = $data['ipaddress'];
$params['serverhostname'] = $data['hostname'];
$params['serverusername'] = html_entity_decode($data['username']);
$params['serverpassword'] = html_entity_decode(decrypt($data['password']));
$params['serveraccesshash'] = html_entity_decode($dat
|
请发表评论