本文整理汇总了PHP中full_query函数的典型用法代码示例。如果您正苦于以下问题:PHP full_query函数的具体用法?PHP full_query怎么用?PHP full_query使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了full_query函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: whmcsreseller_CreateAccount
function whmcsreseller_CreateAccount($params)
{
$clientid = $params['clientsdetails']['userid'];
$serviceid = $params['serviceid'];
$pid = $params['pid'];
switch ($params['configoption1']) {
case "Branding":
$lic_type = "branding";
break;
case "No Branding":
$lic_type = "nobranding";
break;
}
$query = "SELECT id, license FROM whmcsresellerlicenses WHERE user_id IS NULL AND type='{$lic_type}' LIMIT 1";
$data = full_query($query);
if (!mysql_num_rows($data)) {
return "No licenses available to assign";
}
$r = mysql_fetch_array($data);
$lic_id = $r[0];
$lic_str = $r[1];
$res = select_query("tblcustomfields", "*", array("relid" => $pid, "fieldname" => "License"));
if (!mysql_num_rows($res)) {
return "License field not created for product";
} else {
$row = mysql_fetch_assoc($res);
$customfield = $row['id'];
}
update_query("whmcsresellerlicenses", array("user_id" => $clientid, "prod_id" => $serviceid), "id='{$lic_id}'");
full_query("UPDATE tblcustomfieldsvalues SET value='{$lic_str}' WHERE fieldid='{$customfield}' AND relid='{$serviceid}'");
return "success";
}
开发者ID:shalintripathi,项目名称:WHMCS-Modules,代码行数:32,代码来源:whmcsreseller.php
示例2: vpsnet_ConfigOptions
/**
*
* @ WHMCS FULL DECODED & NULLED
*
* @ Version : 5.2.15
* @ Author : MTIMER
* @ Release on : 2013-12-24
* @ Website : http://www.mtimer.cn
*
**/
function vpsnet_ConfigOptions()
{
if (!mysql_num_rows(full_query("SHOW TABLES LIKE 'mod_vpsnet'"))) {
$query = "CREATE TABLE `mod_vpsnet` (`relid` INTEGER UNSIGNED NOT NULL,`setting` VARCHAR(45) NOT NULL,`value` VARCHAR(45) NOT NULL,PRIMARY KEY (`relid`,`setting`));";
full_query($query);
}
$creds = vpsnet_GetCredentials();
if (!$creds['id']) {
return array("Error" => array("Type" => "x", "Description" => "No VPS.Net Server Config found in Setup > Servers"));
}
$verifyauth = vpsnet_call($params, "", "", "GET", "profile");
if ($verifyauth['success'] != "1") {
foreach ($verifyauth['errors'] as $errormsg) {
$verifyautherror .= $errormsg;
}
if ($verifyautherror) {
return array("Error" => array("Type" => "x", "Description" => $verifyautherror));
}
return array("Error" => array("Type" => "FailedAuth", "Description" => "Unable to authenticate with Username and Access Hash. Please check Server Config found in Setup > Servers"));
}
$resources = vpsnet_call($params, $action, $id, $reqtype = "", $type = "available_clouds");
$cloudtemplate = ",";
foreach ($resources['response'] as $resource) {
$cloudid = $resource['cloud']['id'];
$cloudlabel = $resource['cloud']['label'];
foreach ($resource['cloud']['system_templates'] as $system_template) {
$templateid = $system_template['id'];
$templatelabel = $system_template['label'];
$cloudtemplate .= "" . $cloudid . "+" . $templateid . "|" . $cloudlabel . ":" . $templatelabel . ",";
}
}
$cloudtemplate = substr($cloudtemplate, 0, 0 - 1);
$configarray = array("Number of Nodes" => array("Type" => "text", "Size" => "5"), "Cloud/Template" => array("Type" => "dropdown", "Options" => $cloudtemplate), "Enable Backups" => array("Type" => "yesno", "Description" => "Tick to enable backups"), "Rsync Backups" => array("Type" => "yesno", "Description" => "Tick to enable"), "R1Soft Backups" => array("Type" => "yesno", "Description" => "Tick to enable"), "" => array("Type" => "x", "Description" => ""));
return $configarray;
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:45,代码来源:vpsnet.php
示例3: onlinenic_getConfigArray
/**
*
* @ WHMCS FULL DECODED & NULLED
*
* @ Version : 5.2.15
* @ Author : MTIMER
* @ Release on : 2013-12-24
* @ Website : http://www.mtimer.cn
*
* */
function onlinenic_getConfigArray()
{
$query = "CREATE TABLE IF NOT EXISTS `mod_onlinenic` (`id` int(10) NOT NULL auto_increment,`domain` VARCHAR(255) NOT NULL,`lockstatus` BOOL NOT NULL DEFAULT '0',PRIMARY KEY (`id`),KEY `domainid` (`domain`))";
$result = full_query($query);
$configarray = array("FriendlyName" => array("Type" => "System", "Value" => "OnlineNIC"), "Username" => array("Type" => "text", "Size" => "20", "Description" => "Onlinenic ID"), "Password" => array("Type" => "password", "Size" => "20", "Description" => "Password"), "TestMode" => array("Type" => "yesno"), "SyncNextDueDate" => array("Type" => "yesno", "Description", "Tick this box if you want the expiry date sync script to update the expiry and next due dates (cron must be configured)"));
return $configarray;
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:17,代码来源:onlinenic.php
示例4: getAvailableGateways
public function getAvailableGateways($invoiceid = "")
{
$validgateways = array();
$result = full_query("SELECT DISTINCT gateway, (SELECT value FROM tblpaymentgateways g2 WHERE g1.gateway=g2.gateway AND setting='name' LIMIT 1) AS `name`, (SELECT `order` FROM tblpaymentgateways g2 WHERE g1.gateway=g2.gateway AND setting='name' LIMIT 1) AS `order` FROM `tblpaymentgateways` g1 WHERE setting='visible' AND value='on' ORDER BY `order` ASC");
while ($data = mysql_fetch_array($result)) {
$validgateways[$data[0]] = $data[1];
}
if ($invoiceid) {
$disabledgateways = array();
$result = select_query("tblinvoiceitems", "", array("type" => "Hosting", "invoiceid" => $invoiceid));
while ($data = mysql_fetch_assoc($result)) {
$relid = $data['relid'];
if ($relid) {
$result2 = full_query("SELECT pg.disabledgateways AS disabled FROM tblhosting h LEFT JOIN tblproducts p on h.packageid = p.id LEFT JOIN tblproductgroups pg on p.gid = pg.id where h.id = " . (int) $relid);
$data2 = mysql_fetch_assoc($result2);
$gateways = explode(",", $data2['disabled']);
foreach ($gateways as $gateway) {
if (array_key_exists($gateway, $validgateways)) {
unset($validgateways[$gateway]);
continue;
}
}
}
}
}
return $validgateways;
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:27,代码来源:class.gateways.php
示例5: getClients
public function getClients($criteria = array())
{
$filters = $this->buildCriteria($criteria);
$where = count($filters) ? " WHERE " . implode(" AND ", $filters) : "";
$result = full_query("SELECT COUNT(*) FROM tbldomains t " . $where);
$data = mysql_fetch_array($result);
$this->getPageObj()->setNumResults($data[0]);
$clients = array();
$query = "\n\t\t\tSELECT \tt.*, i.subtotal, i.tax, i.status, o.nameservers, o.transfersecret,\n \t\t\tm.domain AS coza_domain, m.id_doc_storage_name, m.id_doc_type, m.le_doc_storage_name, \n \t\t\tm.le_doc_type, m.su_doc_storage_name, m.su_doc_type, m.domain_approval_date, m.domain_status\n \t\tFROM tbldomains t \n \t\tLEFT JOIN mod_domaincloudregistrar m ON t.domain = m.domain \n \t\tLEFT JOIN tblorders o ON t.orderid = o.id\n LEFT JOIN tblinvoices i ON o.invoiceid = i.id" . $where . " ORDER BY " . $this->getPageObj()->getOrderBy() . " " . $this->getPageObj()->getSortDirection() . " LIMIT " . $this->getQueryLimit();
$result = full_query($query);
while ($data = mysql_fetch_array($result)) {
$id = $data['id'];
$userid = $data['userid'];
$domain = $data['domain'];
$id_doc_storage_name = $data['id_doc_storage_name'];
$le_doc_storage_name = $data['le_doc_storage_name'];
$su_doc_storage_name = $data['su_doc_storage_name'];
$registrationdate = $data['registrationdate'];
$domain_approval_date = $data['domain_approval_date'];
$status = $data['status'];
$domain_status = $data['domain_status'];
$clients[] = array("id" => $id, "userid" => $userid, "domain" => $domain, "id_doc_storage_name" => $id_doc_storage_name, "le_doc_storage_name" => $le_doc_storage_name, "su_doc_storage_name" => $su_doc_storage_name, "registrationdate" => $registrationdate, "domain_approval_date" => $domain_approval_date, "domain_status" => $domain_status, "status" => $status);
}
return $clients;
}
开发者ID:nightkidz,项目名称:whmcs-reseller-modules,代码行数:25,代码来源:DomainDocuments.php
示例6: purchaseorder_get_custom_fields
function purchaseorder_get_custom_fields()
{
$options = '';
$request = full_query("SELECT GROUP_CONCAT(fieldname) FROM tblcustomfields where type='client' GROUP BY type");
$values = mysql_fetch_array($request);
return $values[0];
}
开发者ID:carriercomm,项目名称:whmcs-purchaseorder,代码行数:7,代码来源:purchaseorder.php
示例7: getClients
public function getClients($criteria = array())
{
global $disable_clients_list_services_summary;
$clientgroups = $this->getGroups();
$filters = $this->buildCriteria($criteria);
$where = count($filters) ? " WHERE " . implode(" AND ", $filters) : "";
$customfieldjoin = $this->customfieldsfilter ? " INNER JOIN tblcustomfieldsvalues ON tblcustomfieldsvalues.relid=tblclients.id" : "";
$result = full_query("SELECT COUNT(*) FROM tblclients" . $customfieldjoin . $where);
$data = mysql_fetch_array($result);
$this->getPageObj()->setNumResults($data[0]);
$clients = array();
$query = "SELECT id,firstname,lastname,companyname,email,datecreated,groupid,status FROM tblclients" . $customfieldjoin . $where . " ORDER BY " . $this->getPageObj()->getOrderBy() . " " . $this->getPageObj()->getSortDirection() . " LIMIT " . $this->getQueryLimit();
$result = full_query($query);
while ($data = mysql_fetch_array($result)) {
$id = $data['id'];
$firstname = $data['firstname'];
$lastname = $data['lastname'];
$companyname = $data['companyname'];
$email = $data['email'];
$datecreated = $data['datecreated'];
$groupid = $data['groupid'];
$status = $data['status'];
$datecreated = fromMySQLDate($datecreated);
$groupcolor = isset($clientgroups[$groupid]['colour']) ? $clientgroups[$groupid]['colour'] . "\"" : "";
$services = $totalservices = "-";
if (!$disable_clients_list_services_summary) {
$result2 = full_query("SELECT (SELECT COUNT(*) FROM tblhosting WHERE userid=tblclients.id AND domainstatus IN ('Active','Suspended'))+(SELECT COUNT(*) FROM tblhostingaddons WHERE hostingid IN (SELECT id FROM tblhosting WHERE userid=tblclients.id) AND status IN ('Active','Suspended'))+(SELECT COUNT(*) FROM tbldomains WHERE userid=tblclients.id AND status IN ('Active')) AS services,(SELECT COUNT(*) FROM tblhosting WHERE userid=tblclients.id)+(SELECT COUNT(*) FROM tblhostingaddons WHERE hostingid IN (SELECT id FROM tblhosting WHERE userid=tblclients.id))+(SELECT COUNT(*) FROM tbldomains WHERE userid=tblclients.id) AS totalservices FROM tblclients WHERE tblclients.id=" . (int) $id . " LIMIT 1");
$data = mysql_fetch_array($result2);
$services = $data['services'];
$totalservices = $data['totalservices'];
}
$clients[] = array("id" => $id, "firstname" => $firstname, "lastname" => $lastname, "companyname" => $companyname, "groupid" => $groupid, "groupcolor" => $groupcolor, "email" => $email, "services" => $services, "totalservices" => $totalservices, "datecreated" => $datecreated, "status" => $status);
}
return $clients;
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:35,代码来源:class.clients.php
示例8: adminipwhitelist_activate
function adminipwhitelist_activate()
{
$query = array();
$query[0] = "CREATE TABLE `tbladminwhitelist` (\r\n\t\t\t`id` int(11) NOT NULL auto_increment,\r\n\t\t\t`label` varchar(64) NOT NULL,\r\n\t\t\t`ip` varchar(16) NOT NULL,\r\n\t\t\t`timestamp` datetime NOT NULL,\r\n\t\t\tPRIMARY KEY (`id`));";
foreach ($query as $q) {
$r = full_query($q);
}
}
开发者ID:shalintripathi,项目名称:WHMCS-Modules,代码行数:8,代码来源:adminipwhitelist.php
示例9: pushover_deactivate
function pushover_deactivate()
{
# Remove Custom DB Table
$query = "DROP TABLE `mod_pushover`";
$result = full_query($query);
# Return Result
return array('status' => 'success', 'description' => 'WHMCS Pushover Notifications Deactivated.');
}
开发者ID:eunarede,项目名称:whmcs-pushover,代码行数:8,代码来源:pushover.php
示例10: licensing_deactivate
function licensing_deactivate()
{
$query = "DROP TABLE `mod_licensing`";
full_query($query);
$query = "DROP TABLE `mod_licensinglog`";
full_query($query);
$query = "DROP TABLE `mod_licensingbans`";
full_query($query);
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:9,代码来源:licensing.php
示例11: mailchimp_activate
function mailchimp_activate()
{
$query = array();
$query[0] = "CREATE TABLE `tblmailchimpconf` (\r\n\t\t\t`id` int(11) NOT NULL auto_increment,\r\n\t\t\t`name` varchar(32) NOT NULL,\r\n\t\t\t`value` varchar(1024) default NULL,\r\n\t\t\tPRIMARY KEY (`id`));";
$query[1] = "INSERT INTO `tblmailchimpconf` (`id`, `name`, `value`) VALUES\r\n\t\t\t(1, 'apikey', NULL),\r\n\t\t\t(3, 'clientfield', NULL)";
foreach ($query as $q) {
$r = full_query($q);
}
}
开发者ID:shalintripathi,项目名称:WHMCS-Modules,代码行数:9,代码来源:mailchimp.php
示例12: hook_licensing_addon_log_prune
/**
*
* @ WHMCS FULL DECODED & NULLED
*
* @ Version : 5.2.15
* @ Author : MTIMER
* @ Release on : 2013-12-24
* @ Website : http://www.mtimer.cn
*
* */
function hook_licensing_addon_log_prune($vars)
{
$logprune = get_query_val("tbladdonmodules", "value", array("module" => "licensing", "setting" => "logprune"));
if (is_numeric($logprune)) {
full_query("DELETE FROM mod_licensinglog WHERE datetime<='" . date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - $logprune, date("Y"))) . "'");
}
full_query("DELETE FROM mod_licensing WHERE serviceid NOT IN (SELECT id FROM tblhosting)");
full_query("OPTIMIZE TABLE mod_licensinglog");
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:19,代码来源:hooks.php
示例13: mcs_deactivate
function mcs_deactivate()
{
# Remove Custom DB Table
$query = "DROP TABLE `tblmcsapikey`";
$result = full_query($query);
# Return Result
return array('status' => 'success', 'description' => 'If successful, you can return a message to show the user here');
return array('status' => 'error', 'description' => 'If an error occurs you can return an error message for display here');
return array('status' => 'info', 'description' => 'If you want to give an info message to a user you can return it here');
}
开发者ID:MCSDevTeam,项目名称:MCS-Server-Module,代码行数:10,代码来源:mcs.php
示例14: websitepanel_sync_upgrade
/**
* Returns the WebsitePanel Sync configuration options
*
* @param $vars array WHMCS parameters
* @access public
* @return array
*/
function websitepanel_sync_upgrade($vars)
{
// Module version
$version = $vars['version'];
// Remove the WebsitePanel credentials
if ($version < 1.2) {
full_query("DELETE FROM `tbladdonmodules` WHERE `module` = 'websitepanel_sync' AND `setting` = 'username'");
full_query("DELETE FROM `tbladdonmodules` WHERE `module` = 'websitepanel_sync' AND `setting` = 'password'");
}
}
开发者ID:lfrauseo,项目名称:Websitepanel,代码行数:17,代码来源:websitepanel_sync.php
示例15: customercreatedby_deactivate
function customercreatedby_deactivate()
{
# Remove Custom DB Table
$query = "ALTER TABLE `tblclients` DROP `created_by_admin_id`";
$result = full_query($query);
# Return Result
return array('status' => 'success', 'description' => 'Successfully deactivated this add-on');
return array('status' => 'error', 'description' => 'Something went wrong!');
return array('status' => 'info', 'description' => 'Removing this addon');
}
开发者ID:previewict,项目名称:whmcs_customercreatedby_addon,代码行数:10,代码来源:customercreatedby.php
示例16: sso_login
function sso_login($vars)
{
if (!isset($_SESSION['adminid']) && isset($vars['userid']) && ($userId = $vars['userid'])) {
$sql = "SELECT * FROM `tblclients` WHERE `id`='" . $userId . "'";
if (($result = full_query($sql)) && ($data = mysql_fetch_array($result))) {
$sso = new sso_connect();
$result = $sso->connect('login', array('firstname' => $data['firstname'], 'lastname' => $data['lastname'], 'email' => $data['email']));
}
}
}
开发者ID:carriercomm,项目名称:sso-whmcs,代码行数:10,代码来源:hooks.php
示例17: globalsignssl_ConfigOptions
/**
*
* @ WHMCS FULL DECODED & NULLED
*
* @ Version : 5.2.15
* @ Author : MTIMER
* @ Release on : 2013-12-24
* @ Website : http://www.mtimer.cn
*
* */
function globalsignssl_ConfigOptions()
{
$result = select_query("tblemailtemplates", "COUNT(*)", array("name" => "SSL Certificate Configuration Required"));
$data = mysql_fetch_array($result);
if (!$data[0]) {
full_query("INSERT INTO `tblemailtemplates` (`type` ,`name` ,`subject` ,`message` ,`fromname` ,`fromemail` ,`disabled` ,`custom` ,`language` ,`copyto` ,`plaintext` )VALUES ('product', 'SSL Certificate Configuration Required', 'SSL Certificate Configuration Required', '<p>Dear {\$client_name},</p><p>Thank you for your order for an SSL Certificate. Before you can use your certificate, it requires configuration which can be done at the URL below.</p><p>{\$ssl_configuration_link}</p><p>Instructions are provided throughout the process but if you experience any problems or have any questions, please open a ticket for assistance.</p><p>{\$signature}</p>', '', '', '', '', '', '', '0')");
}
$configarray = array("Username" => array("Type" => "text", "Size" => "25"), "Password" => array("Type" => "password", "Size" => "25", "Description" => "Do not have a GlobalSign SSL account? Visit www.globalsign.com/partners/ssl-resell/ to get an account"), "SSL Certificate Type" => array("Type" => "dropdown", "Options" => "AlphaSSL,DomainSSL,OrganizationSSL,ExtendedSSL"), "Base Option" => array("Type" => "dropdown", "Options" => "Standard SSL,Wildcard SSL"), "Validity Period" => array("Type" => "dropdown", "Options" => "1,2,3,4,5", "Description" => "Years"), "Test Mode" => array("Type" => "yesno"), "" => array("Type" => "na", "Description" => "Don't have a GlobalSign SSL account? Visit <a href=\"http://www.globalsign.com/partners/whmcs/\" target=\"_blank\">www.globalsign.com/partners/whmcs/</a> to signup free."));
return $configarray;
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:20,代码来源:globalsignssl.php
示例18: twilio_activate
function twilio_activate()
{
$query[0] = "CREATE TABLE IF NOT EXISTS `mod_twilio_numbers` (\n\t\t\t\t\t`id` int(11) NOT NULL auto_increment,\n\t\t\t\t\t`number` varchar(32) NOT NULL,\n\t\t\t\t\t`timeout` int(11) NOT NULL,\n\t\t\t\t\t`order` int(11) NOT NULL,\n\t\t\t\t\tPRIMARY KEY (`id`))";
$query[1] = "CREATE TABLE IF NOT EXISTS `mod_twilio_config` (\n\t\t\t\t\t`id` INT NOT NULL auto_increment,\n\t\t\t\t\t`setting` VARCHAR( 64 ) NOT NULL,\n\t\t\t\t\t`val` TEXT default NULL,\n\t\t\t\t\tPRIMARY KEY (`id`))";
$query[2] = "INSERT INTO `mod_twilio_config` (`id`, `setting`, `val`) VALUES\n\t\t\t\t\t(1, 'intro_mode', 'text'),\n\t\t\t\t\t(2, 'intro_text', 'Please press 1 to speak with a representative regarding an existing ticket, press 2 for all other inquiries.'),\n\t\t\t\t\t(3, 'intro_file', ''),\n\t\t\t\t\t(4, 'step1_client_mode', 'text'),\n\t\t\t\t\t(5, 'step1_client_text', 'Please enter your client ID number, followed by the pound sign.'),\n\t\t\t\t\t(6, 'step1_client_file', ''),\n\t\t\t\t\t(7, 'step1_ticket_mode', 'text'),\n\t\t\t\t\t(8, 'step1_ticket_text', 'Please enter your ticket ID number, followed by the pound sign.'),\n\t\t\t\t\t(9, 'step1_ticket_file', ''),\n\t\t\t\t\t(10, 'step2_client_mode', 'text'),\n\t\t\t\t\t(11, 'step2_client_text', 'Hello, %FIRSTNAME% %LASTNAME%. You will be connected with one of our operators shortly.'),\n\t\t\t\t\t(12, 'step2_client_file', ''),\n\t\t\t\t\t(13, 'step2_client_sorry_mode', 'text'),\n\t\t\t\t\t(14, 'step2_client_sorry_text', 'Sorry, I could not locate your account.'),\n\t\t\t\t\t(15, 'step2_client_sorry_file', ''),\n\t\t\t\t\t(16, 'step2_ticket_mode', 'text'),\n\t\t\t\t\t(17, 'step2_ticket_text', 'Hello, %FIRSTNAME% %LASTNAME%. You will be connected with one of our operators shortly.'),\n\t\t\t\t\t(18, 'step2_ticket_file', ''),\n\t\t\t\t\t(19, 'step2_ticket_sorry_mode', 'text'),\n\t\t\t\t\t(20, 'step2_ticket_sorry_text', 'Sorry, I could not locate the ticket you requested.'),\n\t\t\t\t\t(21, 'step2_ticket_sorry_file', ''),\n\t\t\t\t\t(22, 'invalid_request_mode', 'text'),\n\t\t\t\t\t(23, 'invalid_request_text', 'Sorry, I did not understand your request.'),\n\t\t\t\t\t(24, 'invalid_request_file', ''),\n\t\t\t\t\t(25, 'voicemail_email', ''),\n\t\t\t\t\t(26, 'voicemail_mode', 'text'),\n\t\t\t\t\t(27, 'voicemail_text', 'Please leave a message after the beep.'),\n\t\t\t\t\t(28, 'voicemail_file', ''),\n\t\t\t\t\t(29, 'gather_timeout', '30'),\n\t\t\t\t\t(30, 'client_port', '9090'),\n\t\t\t\t\t(31, 'server_port', '9999');";
foreach ($query as $q) {
full_query($q);
}
return array('status' => 'success');
}
开发者ID:shalintripathi,项目名称:WHMCS-Modules,代码行数:10,代码来源:twilio.php
示例19: websitepanel_addons_AddonActivation
/**
* Handles activating and adding client addons to WebsitePanel
*
* @access public
* @param array $params WHMCS parameters
* @throws Exception
*/
function websitepanel_addons_AddonActivation($params)
{
// WHMCS server parameters & package parameters
$userId = $params['userid'];
$serviceId = $params['serviceid'];
$addonId = $params['addonid'];
$result = full_query("SELECT h.username AS username, s.ipaddress AS serverip, s.hostname AS serverhostname, s.secure AS serversecure, s.username AS serverusername, s.password AS serverpassword, p.configoption6 AS configoption6, h.id AS serviceid FROM `tblhosting` AS h, `tblservers` AS s, `tblproducts` AS p, `mod_wspaddons` AS w WHERE h.packageid = p.id AND w.whmcs_id = {$addonId} AND h.id = {$serviceId} AND h.server = s.id AND s.type = 'websitepanel'");
if (mysql_num_rows($result) > 0) {
// Get the results of the query
$row = mysql_fetch_assoc($result);
// Start processing the users addon
$username = $row['username'];
$serverUsername = $row['serverusername'];
$serverPassword = decrypt($row['serverpassword']);
$serverPort = $row['configoption6'];
$serverHost = empty($row['serverhostname']) ? $row['serverip'] : $row['serverhostname'];
$serverSecure = $row['serversecure'] == 'on' ? TRUE : FALSE;
try {
// Create the WebsitePanel Enterprise Server Client object instance
$wsp = new websitepanel_EnterpriseServer($serverUsername, $serverPassword, $serverHost, $serverPort, $serverSecure);
// Get the user's details from WebsitePanel - We need the UserId
$user = $wsp->getUserByUsername($username);
if (empty($user)) {
throw new Exception("User {$username} does not exist - Cannot allocate addon for unknown user");
}
// Get the user's package details from WebsitePanel - We need the PackageId
$package = $wsp->getUserPackages($user['UserId']);
$packageId = $package['PackageId'];
// Get the associated WebsitePanel addon id
$results = select_query('mod_wspaddons', 'wsp_id,is_ipaddress', array('whmcs_id' => $addonId));
$addon = mysql_fetch_array($results);
$addonPlanId = $addon['wsp_id'];
$addonIsIpAddress = $addon['is_ipaddress'];
// Add the Addon Plan to the customer's WebsitePanel package / hosting space
$results = $wsp->addPackageAddonById($packageId, $addonPlanId);
// Check the results to verify that the addon has been successfully allocated
if ($results['Result'] > 0) {
// If this addon is an IP address addon - attempt to randomly allocate an IP address to the customer's hosting space
if ($addonIsIpAddress) {
$wsp->allocatePackageIPAddresses($packageId);
}
// Add log entry to client log
logactivity("WebsitePanel Addon - Account {$username} addon successfully completed - Addon ID: {$addonId}", $userId);
} else {
// Add log entry to client log
throw new Exception("Unknown", $results['Result']);
}
} catch (Exception $e) {
// Error message to log / return
$errorMessage = "websitepanel_addons_AddonActivation Fault: (Code: {$e->getCode()}, Message: {$e->getMessage()}, Service ID: {$serviceId})";
// Log to WHMCS
logactivity($errorMessage, $userId);
}
}
}
开发者ID:lfrauseo,项目名称:Websitepanel,代码行数:62,代码来源:hooks.php
示例20: csv_output
function csv_output($query)
{
global $fields;
$result = full_query($query);
while ($data = mysql_fetch_array($result)) {
foreach ($fields as $field) {
echo csv_clean($data[$field]) . ",";
}
echo "\r\n";
}
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:11,代码来源:csvdownload.php
注:本文中的full_query函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论