Look this error message: (Invalid argument supplied for foreach() in Web\do\admin\modules\PIREPAdmin\PIREPAdmin.php on line 130)
When I click on "Approve All" I recieve this error message end the pilots on the list of "approve all", lost all hours of flight.
123 public function approveall()
124 {
125 echo '<h3>Approve All</h3>';
126
127 $allpireps = PIREPData::findPIREPS(array('p.accepted'=>PIREP_PENDING));
128 $total = count($allpireps);
129 $count = 0;
130 foreach($allpireps as $pirep_details)
131 {
132 if($pirep_details->aircraft == '')
133 {
134 continue;
135 }
136
137 # Update pilot stats
138 SchedulesData::IncrementFlownCount($pirep_details->code, $pirep_details->flightnum);
139 PIREPData::ChangePIREPStatus($pirep_details->pirepid, PIREP_ACCEPTED); // 1 is accepted
140 //PilotData::UpdateFlightData($pirep_details->pilotid, $pirep_details->flighttime, 1);
141 PilotData::UpdatePilotStats($pirep_details->pilotid);
142 PilotData::UpdatePilotPay($pirep_details->pilotid, $pirep_details->flighttime);
143
144 RanksData::CalculateUpdatePilotRank($pirep_details->pilotid);
145 RanksData::CalculatePilotRanks();
146 PilotData::GenerateSignature($pirep_details->pilotid);
147 StatsData::UpdateTotalHours();
148
149 $count++;
150 }
151
152 $skipped = $total - $count;
153 echo "$count of $total were approved ({$skipped} has errors)";
154 }