Author Topic: Top 5 landing issue  (Read 306 times)

Owenpa28

  • Newbie
  • *
  • Posts: 21
    • View Profile
Top 5 landing issue
« on: March 25, 2018, 06:21:18 PM »
Hi

I have a problem with my stats. The top 5 landing section is not updating. I have only 3 rows that shows on the site. In the database there is an empty row and 4 rows with data. One of the 4 rows does not show as the pilot has been deleted. Take a look at the page.


http://airline.westernairvirtual.co.uk/vam/index.php?page=stats


I hope you can help. Just to add that i cannot delete or remove lines in the database as they are in view only format.


drgullen

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: Top 5 landing issue
« Reply #1 on: March 25, 2018, 06:54:23 PM »
Owen,

Do you not have access to phpmyAdmin or the like to run SQL queries against your database?  Alejandro does mention in the documentation that if your pilot has history with the airline (i.e. has statistics), then it is better to just inactive him rather than delete him.  I think your only recourse to fix this now is to delete that empty row, although I don't know if that would cause issues with other parts of the system.

One way or the other, you will definitely need update privileges on the database to fix this.  Why are you in view-only?  Someone must have been able to write/update to tables in the past, otherwise the entire website wouldn't work.

Owenpa28

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Top 5 landing issue
« Reply #2 on: March 26, 2018, 01:26:59 PM »
Hello. Thank you for your reply. I did read that a pilot is prefered inactive rather than deleted. But they stil show on the roster. However i could have removed her location then i guess they would no longer show.

I have made a small improvement by finding the vam event and pirep in the database and increase the landing rate. This has remove the date from the best landingtable and the table is now showing 4 landings rather than 3. I still have and entry with zero on it but i gues this may update witht the next flight carried out.

As for the database i do have the acces to edit. But the view table are not editable.

drgullen

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: Top 5 landing issue
« Reply #3 on: March 26, 2018, 07:12:11 PM »
There is a fix for this on the pilots_public.php page in one of the SQL statements.  For me, it is on line 20, look for this part of the statement:

and gu.activation <> 0

If you change it to this, then your Pilot Roster page and home page pilot count will only show active pilots:

and gu.activation = 1


In addition to this change, on my VA, I have changed the title on that page from PILOT ROSTER to ACTIVE PILOT ROSTER and also made the same change on the home page.

« Last Edit: March 27, 2018, 06:25:06 PM by drgullen »

Owenpa28

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Top 5 landing issue
« Reply #4 on: March 27, 2018, 09:22:34 AM »
Hi

I have managed to solve the issue with top 5 landings. It turns out that there was a duff pirep. The line was full of zeros. This meant the system considered the landing at zero. I have now deleted this.

For the pilots being inactivated i cant find gg. Activation but i can see a gu.activation.

drgullen

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: Top 5 landing issue
« Reply #5 on: March 27, 2018, 06:25:42 PM »
Hi,

Yeah sorry, that was a typo.  I have updated my post now, it is gu.activation.

Mensen

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Top 5 landing issue
« Reply #6 on: May 11, 2018, 10:10:34 PM »
Hi Guys, Mine is like this:

$sql = "select a.name as airport_name, iso_country, gu.hub_id as hubid,v.gva_hours,transfered_hours,gvauser_id,callsign,surname,activation,vatsimid,ivaovid ,transfered_hours, rank, gu.name as name,hub,location, r.image_url as rank_image, iso2, short_name from country_t c, gvausers gu, ranks r, hubs h, (select 0 + sum(time) as gva_hours, pilot from v_pilot_roster_rejected vv group by pilot) as v , airports a where a.ident=gu.location and gu.rank_id=r.rank_id and h.hub_id=gu.hub_id and gu.activation
= 1 and gu.country=c.iso2 and v.pilot = gu.gvauser_id order by callsign asc";
} else {
   $sql = "select a.name as airport_name, iso_country, gu.hub_id as hubid,v.gva_hours,transfered_hours,gvauser_id,callsign,surname,activation,vatsimid,ivaovid ,transfered_hours, rank, gu.name as name,hub,location, r.image_url as rank_image, iso2, short_name from country_t c, gvausers gu, ranks r, hubs h, (select 0 + sum(time) as gva_hours, pilot from v_pilot_roster vv group by pilot) as v , airports a where a.ident=gu.location and gu.rank_id=r.rank_id and h.hub_id=gu.hub_id and gu.activation
    = 1 and gu.country=c.iso2 and v.pilot = gu.gvauser_id order by callsign asc";

But still get 4 landings in TOP 5 LANDINGS. Did I do something wrong?