Jump to content

Error when clik on "approve all Pireps"


Anderson

Recommended Posts

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 }

Link to comment
Share on other sites

  • Administrators

Yes, my VA is KAFLY, we have 5,830 pireps and 13,368 hours in PHPvms.

This error only occurs when we click in "Accept All" (Boom! The pilots on the list of "approve all", lost all hours of flight)

Could be that your server is dying while processing all of it

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...