Anderson Posted July 2, 2010 Report Posted July 2, 2010 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 } Quote
Administrators Nabeel Posted July 2, 2010 Administrators Report Posted July 2, 2010 Do you have any pireps/ That's why Quote
Anderson Posted July 3, 2010 Author Report Posted July 3, 2010 Do you have any pireps/ That's why 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) Quote
Administrators Nabeel Posted July 3, 2010 Administrators Report Posted July 3, 2010 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 Quote
Anderson Posted July 4, 2010 Author Report Posted July 4, 2010 Could be that your server is dying while processing all of it I'm not sure but the maximum pireps on page is no more than 40 pireps when we use ("Accept All"). Quote
Jeff Posted July 4, 2010 Report Posted July 4, 2010 In your case, if you are just approving all, then you might want to look at the "Auto Approve All Pireps" located in the forum. Quote
Moderators mark1million Posted July 4, 2010 Moderators Report Posted July 4, 2010 Does the auto approve actually work? i tried it way back and it just messed up. Quote
Jeff Posted July 4, 2010 Report Posted July 4, 2010 I believe that there were some fixes, but not sure since I don't use it. You can always try it and find out. Quote
m5industries Posted July 5, 2010 Report Posted July 5, 2010 The auto reply thing worked for me. That's what I would recommend to you. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.