Example #1
0
    $registrar = $data['registrar'];
    $registrationperiod = $data['registrationperiod'];
    $expirydate = $data['expirydate'];
    $nextduedate = $data['nextduedate'];
    $status = $data['status'];
    $subscriptionid = $data['subscriptionid'];
    $additionalnotes = $data['additionalnotes'];
    $paymentmethod = $data['paymentmethod'];
    $paymentmethodname = $data['paymentmethodname'];
    $dnsmanagement = $data['dnsmanagement'];
    $emailforwarding = $data['emailforwarding'];
    $idprotection = $data['idprotection'];
    $donotrenew = $data['donotrenew'];
    $nameservers = array();
    if ($getnameservers) {
        if (!function_exists("RegGetNameservers")) {
            require ROOTDIR . "/includes/registrarfunctions.php";
        }
        $domainparts = explode(".", $domain, 2);
        $params = array();
        $params['domainid'] = $id;
        $params['sld'] = $domainparts[0];
        $params['tld'] = $domainparts[1];
        $params['regperiod'] = $registrationperiod;
        $params['registrar'] = $registrar;
        $nameservers = RegGetNameservers($params);
        $nameservers['nameservers'] = true;
    }
    $apiresults['domains']['domain'][] = array_merge(array("id" => $id, "userid" => $userid, "orderid" => $orderid, "regtype" => $type, "domainname" => $domain, "registrar" => $registrar, "regperiod" => $registrationperiod, "firstpaymentamount" => $firstpaymentamount, "recurringamount" => $recurringamount, "paymentmethod" => $paymentmethod, "paymentmethodname" => $paymentmethodname, "regdate" => $registrationdate, "expirydate" => $expirydate, "nextduedate" => $nextduedate, "status" => $status, "subscriptionid" => $subscriptionid, "dnsmanagement" => $dnsmanagement, "emailforwarding" => $emailforwarding, "idprotection" => $idprotection, "donotrenew" => $donotrenew, "notes" => $additionalnotes), $nameservers);
}
$responsetype = "xml";
 *
 **/
if (!defined("WHMCS")) {
    exit("This file cannot be accessed directly");
}
if (!function_exists("RegGetNameservers")) {
    require ROOTDIR . "/includes/registrarfunctions.php";
}
$result = select_query("tbldomains", "id,domain,registrar,registrationperiod", array("id" => $domainid));
$data = mysql_fetch_array($result);
$domainid = $data[0];
if (!$domainid) {
    $apiresults = array("result" => "error", "message" => "Domain ID Not Found");
    return false;
}
$domain = $data['domain'];
$registrar = $data['registrar'];
$regperiod = $data['registrationperiod'];
$domainparts = explode(".", $domain, 2);
$params = array();
$params['domainid'] = $domainid;
$params['sld'] = $domainparts[0];
$params['tld'] = $domainparts[1];
$params['regperiod'] = $regperiod;
$params['registrar'] = $registrar;
$values = RegGetNameservers($params);
if ($values['error']) {
    $apiresults = array("result" => "error", "message" => "Registrar Error Message", "error" => $values['error']);
    return false;
}
$apiresults = array_merge(array("result" => "success"), $values);