Jump to content

Listagem externa de domínios


Recommended Posts

Pessoal, estou tentando montar uma pagina externa ao WHMCS, mas acredito que estou apanhando para a mais besta situação:

Tenho seguinte código:

<?php

// Make a MySQL Connection 
require( 'init.php' ); //index do whmcs

function getDomains() 
{ 
    $query = mysql_query("SELECT d.id, d.extension 'tld', t.type, c.code, c.suffix, t.msetupfee, t.qsetupfee, t.ssetupfee, r.sellingprice, r.promoprice FROM tbldomainpricing AS d 
        INNER JOIN tblpricing AS t ON t.relid = d.id 
        INNER JOIN mod_resellerclubmodspromo AS r ON r.relid = d.id 
        INNER JOIN tblcurrencies AS c ON c.id = t.currency 
        WHERE t.type IN ('domainregister','domaintransfer','domainrenew') ORDER BY d.id ASC"); 
    $dataArray=array(); 
    while($row = @mysql_fetch_array($query, MYSQL_ASSOC)) { 
        $dataArray[$row['tld']][$row['type']]=$row; 
    } 
    return $dataArray; 
} 


$mydata = getDomains(); 
echo "<pre>mydata: " . print_r($mydata,TRUE) . "</pre>";
?>

Porém retorna:

 

Acredito eu que seja erro no select. O que eu quero é listar todos os domínios do banco de dados e apresentar o valor promocional dos domínios que estão cadastrados nas tabela mod_resellerclubmodspromo no qual é do addon RC & LB Tools v2.10.2.

Se eu usar:

<?php

// Make a MySQL Connection 
require( '../init.php' );

function getDomains() 
{ 
    $query = mysql_query("SELECT d.id, d.extension 'tld', t.type, c.code, c.suffix, t.msetupfee, t.qsetupfee, t.ssetupfee FROM tbldomainpricing AS d 
        INNER JOIN tblpricing AS t ON t.relid = d.id 
        INNER JOIN tblcurrencies AS c ON c.id = t.currency 
        WHERE t.type IN ('domainregister','domaintransfer','domainrenew') ORDER BY d.id ASC"); 
    $dataArray=array(); 
    while($row = @mysql_fetch_array($query, MYSQL_ASSOC)) { 
        $dataArray[$row['tld']][$row['type']]=$row; 
    } 
    return $dataArray; 
} 


$mydata = getDomains(); 
echo "<pre>mydata: " . print_r($mydata,TRUE) . "</pre>";
?>

Obtenho todos os domínio porém veja que não há seleção da tabela correspondente as promoções.

Se decodificassem o código do widgets domainpricelist.php que vem com o addon ajudaria tbm: :D

Grato há quem puder ajudar.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...