Showing Stats on Home [SOLVED]

Hi all, grettings from Spain.

I´m customizing a VA with phpVMS and I´m having some problems showing  VA STATS on Home page which it is not made with phpVMS. DB is pointing to a subdomain where phpVMS CrewCenter is allocated. Can I call this DB to html home? I need some lines as TotalHours, TotalFlights etc…like shown at ADMIN side on Dashboard.

Thanks in advance.

Juan

You can call the phpVMS functions from your HTML homepage. Just add the code below:

\<?php include './core/codon.config.php'; ?\>

and after that, you can call add the phpVMS functions you need. For example:

\<?php include './core/codon.config.php'; $totalHours = StatsData::TotalHours(); echo $totalHours; ?\>

Bare in mind that the include should include the relative path of your phpVMS codon.config.php file.

I will test your code Servetas. I’ll tell you. 

Thanx

I will test your Core Servetas. I’ll tell you. 

Thanx

6 hours ago, servetas said:

You can call the phpVMS functions from your HTML homepage. Just add the code below:

<?php include ‘./core/codon.config.php’; ?>

and after that, you can call add the phpVMS functions you need. For example:

<?php include ‘./core/codon.config.php’; $totalHours = StatsData::TotalHours(); echo $totalHours; ?>

Bare in mind that the include should include the relative path of your phpVMS codon.config.php file.

Hi servetas, I have tried your code but doen´t work .

I think that I can´t use a relative path because codon.config.php is in subdomain at  phpVMS crew.center installation. Is possible?

Can I use a absolute path?

THX

 

 

On 2017-5-8 at 9:54 AM, servetas said:

 

Hi servetas.

My stats aready works at Home Web. I used this include code on top :

\<?php include("./../../crew.domain.com/core/codon.config.php"); ?\>

Using relive path but with this dots.

An this other to call function:

\<?php $totalHours = StatsData::TotalHours(); ?\> \<?php echo $totalHours;?\>

 I have change from index.html to index.php and the server settings to call .php files as “index”

All stats works fine. Thanks by your help.

Best regards

On 14/05/2017 at 4:13 PM, Juan said:

Hi servetas.

My stats aready works at Home Web. I used this include code on top :

<?php include(“./../../crew.domain.com/core/codon.config.php”); ?>

Using relive path but with this dots.

An this other to call function:

<?php $totalHours = StatsData::TotalHours(); ?> <?php echo $totalHours;?>

 I have change from index.html to index.php and the server settings to call .php files as “index”

All stats works fine. Thanks by your help.

Best regards

I seem to have ran into a problem using this method. I’ve included the code on top, and I can confirm it works as I’ve managed to iFrame the live map. However, when attempting to call the phpVMS functions, any content below that line disappears and the stats don’t show. It’s probably something small that I’m missing. Any ideas? Thanks

Update: I didn’t have the top line correct and was receiving errors from my error_log all along. However, with that now fixed, I get the following error where the call function is placed:

Fatal error : Class ‘StatsData’ not found in /home/mydomain/public_html/v1/test.php on line 209