Jump to content
Juan

Showing Stats on Home [SOLVED]

Recommended Posts

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

Edited by Juan

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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

 

 

Share this post


Link to post
Share on other sites
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

Edited by Juan

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

×