In the finance module, it’s the total of flights by month wich is mentionned (scheduled flgihts + free flights). But i want to have just scheduled flights to have the right number. How can i do this please ?
Actually it’s like this (here $month->total return all the flights.) :
\<td align="center"\> \<?php $scheduledFlights="SELECT COUNT(pirepid) as totalflights FROM phpvms\_pireps WHERE month(submitdate)=".$month-\>ym." and (code='xxx')"; $resultScheduledFlights=DB::get\_results($scheduledFlights); $totalScheduledFlights=$resultScheduledFlights[0]-\>totalflights; echo $totalScheduledFlights; ?\> \</td\>
In the finance module, it’s the total of flights by month wich is mentionned (scheduled flgihts + free flights). But i want to have just scheduled flights to have the right number. How can i do this please ?
Actually it’s like this (here $month->total return all the flights.) :
<td align=“center”> <?php $scheduledFlights=“SELECT COUNT(pirepid) as totalflights FROM phpvms_pireps WHERE month(submitdate)=”.$month->ym." and (code=‘xxx’)"; $resultScheduledFlights=DB::get_results($scheduledFlights); $totalScheduledFlights=$resultScheduledFlights[0]->totalflights; echo $totalScheduledFlights; ?> </td>
I use a personnal ACARS, created only for my company. But I don’t see the relationship between ACARS and finance. In my opinion, it’s only a problem of database request and PHP.
I use a personnal ACARS, created only for my company. But I don’t see the relationship between ACARS and finance. In my opinion, it’s only a problem of database request and PHP.
Here is what you can do:
First of all add a column to pireps table name it ‘scheduledflight’
Ask the developer of your ACARS to insert a query which checks that the PIREP Filed by Pilot has the same data as in schedules table that has the same Flight Number, Departure ICAO and Arrival ICAO. If it exists then, it should update the ‘scheduledflight’ column of that pirep to ‘1’
Now you need to edit your Finance query like this:
$scheduledFlights="SELECT COUNT(pirepid) as totalflights FROM phpvms\_pireps WHERE scheduledflight = '1' AND month(submitdate)=".$month-\>ym." AND (code='xxx')";
Thanks, but in my opinion there’s no need to add column. code=‘xxx’ is already used to check scheduled flight.
When i test my request in PHPMyAdmin with values instead of $month->ym (ex: month(submitdate)=3) i have the good result. It’s this code wich is wrong, and i don’t know how do this
With the solution of adding a column, i loose all stats before today. The goal is to have all the scheduled flights to have finance sheets for all months since creation of the phpvms website (2016).