Jump to content
Limestone de cara nova! ×
Portal do Host

Listagem externa de domínios


msaulohenrique
 Share

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


  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.



×
×
  • Create New...

Important Information