# Showing Stats on Home \[SOLVED\]

**URL:** <https://forum.phpvms.net/t/showing-stats-on-home-solved/11767>\
**Category:** Skinning - Legacy phpVMS (v2/v5)\
**Created:** [May 7, 2017, 8:33am UTC](https://forum.phpvms.net/t/showing-stats-on-home-solved/11767 "2017-05-07T08:33:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juan](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/j/a698b9/32.png) [@Juan](https://forum.phpvms.net/u/Juan)\
**Post date:** [May 7, 2017, 8:33am UTC](https://forum.phpvms.net/t/showing-stats-on-home-solved/11767/1 "2017-05-07T08:33:52Z")

</div>

Hi all, grettings from Spain.

I´m customizing a VA with phpVMS and I´m having some problems showing &nbsp;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

---

<div class="post-metadata">

**Author:** ![servetas](https://forum.phpvms.net/user_avatar/forum.phpvms.net/servetas/32/75_2.png) [@servetas](https://forum.phpvms.net/u/servetas)\
**Post date:** [May 8, 2017, 7:54am UTC](https://forum.phpvms.net/t/showing-stats-on-home-solved/11767/2 "2017-05-08T07:54:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Juan](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/j/a698b9/32.png) [@Juan](https://forum.phpvms.net/u/Juan)\
**Post date:** [May 8, 2017, 11:33am UTC](https://forum.phpvms.net/t/showing-stats-on-home-solved/11767/3 "2017-05-08T11:33:51Z")

</div>

I will test your code Servetas. I’ll tell you.&nbsp;

Thanx

---

<div class="post-metadata">

**Author:** ![Juan](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/j/a698b9/32.png) [@Juan](https://forum.phpvms.net/u/Juan)\
**Post date:** [May 8, 2017, 11:35am UTC](https://forum.phpvms.net/t/showing-stats-on-home-solved/11767/4 "2017-05-08T11:35:15Z")

</div>

I will test your Core Servetas. I’ll tell you.&nbsp;

Thanx

---

<div class="post-metadata">

**Author:** ![Juan](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/j/a698b9/32.png) [@Juan](https://forum.phpvms.net/u/Juan)\
**Post date:** [May 8, 2017, 2:21pm UTC](https://forum.phpvms.net/t/showing-stats-on-home-solved/11767/5 "2017-05-08T14:21:40Z")

</div>

> 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 &nbsp;phpVMS crew.center installation. Is possible?

Can I use a absolute path?

THX

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![Juan](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/j/a698b9/32.png) [@Juan](https://forum.phpvms.net/u/Juan)\
**Post date:** [May 14, 2017, 3:13pm UTC](https://forum.phpvms.net/t/showing-stats-on-home-solved/11767/6 "2017-05-14T15:13:49Z")

</div>

> On 2017-5-8 at 9:54 AM, servetas said:
> 
> &nbsp;

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;?\>

```

&nbsp;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

---

<div class="post-metadata">

**Author:** ![Waters10](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/w/3da27b/32.png) [@Waters10](https://forum.phpvms.net/u/Waters10)\
**Post date:** [April 3, 2018, 10:31pm UTC](https://forum.phpvms.net/t/showing-stats-on-home-solved/11767/7 "2018-04-03T22:31:45Z")

</div>

> 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;?\>
> 
> &nbsp;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&nbsp;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

---

<div class="post-metadata">

**Author:** ![Waters10](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/w/3da27b/32.png) [@Waters10](https://forum.phpvms.net/u/Waters10)\
**Post date:** [April 4, 2018, 5:26pm UTC](https://forum.phpvms.net/t/showing-stats-on-home-solved/11767/8 "2018-04-04T17:26:17Z")

</div>

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**
