Jump to content

web541

Members
  • Posts

    700
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by web541

  1. Add this <?php # Aircraft has already been bidded by another pilot $acbidded = OperationsData::getBidByAircraft($schedule->aircraftid); if($acbidded) { echo 'Aircraft Free!'; } else { echo 'Aircraft Booked!'; } ?> Change $schedule->aircraftid on the first line to the variable of your fleet page.
  2. Try installing this version https://github.com/DavidJClark/phpvms_5.5.x and make sure you are not on free hosting (that causes issues) and a link to your web page is also appreciated.
  3. Forgot a { <?php $airports = OperationsData::getAllAirports(){ /* Above <td> You have to put it */ foreach($airports as $airport) { /* On <td> You can use it to show Name, ICAO and anothers thing from PhpMyAdmin */ echo $airport->name; echo $airport->icao; } ?>
  4. Add the code from my above post in schedule_results and then add this in the confirmbid <?php $allaircraft = FltbookData::getAllAircraftFltbook($airline, $aicao); foreach($allaircraft as $aircraft) { $bidded = OperationsData::getBidByAircraft($aircraft->id); if($aircraft->enabled != 1) { continue; } if($bidded) { continue; } $icaoairline = "{$aircraft->icao}{$airline}"; if($aircraft->registration == $icaoairline) { echo ''; } else { $sel = ($_POST['aircraft'] == $aircraft->name || $bid->registration == $aircraft->registration)?'selected':''; echo '<option value="'.$aircraft->id.'" '.$sel.'>'.$aircraft->registration.' - '.$aircraft->icao.' - '.$aircraft->name.' ('.(AircraftMarketData::getaccond($aircraft->id)).'%)</option>'; } } ?>
  5. Try this (should be able to just replace $schedule with $route
  6. You stated your other post that you were using the default schedules module, have you added anything to restrict the pilot from flying only from their 'last location'?
  7. Add this to your OperationsData.class.php public static function getBidByAircraft($aircraftid) { $aircraftid = DB::escape($aircraftid); $sql = 'SELECT s.*, b.bidid, a.name as aircraft, a.id as aircraftid, a.registration FROM ' . TABLE_PREFIX . 'schedules s, ' . TABLE_PREFIX . 'bids b, ' . TABLE_PREFIX . 'aircraft a WHERE b.routeid = s.id AND s.aircraft='.$aircraftid; return DB::get_row($sql); } And Add/Replace this in your schedule_results.php file <?php # If aircraft is disabled $aircraft = OperationsData::getAircraftInfo($schedule->aircraftid); # Aircraft has already been bidded by another pilot $acbidded = OperationsData::getBidByAircraft($schedule->aircraftid); if($aircraft->enabled != 1) { echo 'Unable to Bid! Aircraft is disabled!'; } elseif($acbidded) { echo 'Unable to Bid! Aircraft already bidded!'; } elseif(Config::Get('DISABLE_SCHED_ON_BID') == true && $schedule->bidid != 0) { echo '<a id="'.$schedule->id.'" class="addbid" href="'.SITE_URL.'/action.php/schedules/addbid/?id='.$schedule->id.'">Add to Bid</a>'; } else { if(Auth::LoggedIn()) { echo '<a id="'.$schedule->id.'" class="addbid" href="'.SITE_URL.'/index.php/schedules/addbid/?id='.$schedule->id.'">Add to Bid</a>'; } } ?>
  8. Hmm ok, try this (it won't calculate the code just yet but it will allow us to see what is being carried across) Dear <?php echo $pilot->code.''.$pilot->pilotid.' - '.$pilot->firstname.' '.$pilot->lastname ?>,
  9. Sorry about the delay, been caught up in stuff. Yeah, I took a look and it seems to work for me (mostly, got to work out my ledger values) so I'd consider this solved for now. As for v3 development, I don't think it will be this difficult to calculate as everything should be streamlined to the one spot. As for the help in this topic, not a problem
  10. In that case, try this Dear <?php echo PilotData::getPilotCode($pilot->code, $pilot->pilotid).' - '.$pilot->firstname.' '.$pilot->lastname ?>, And that should work.
  11. Are you using a separate module or just the default schedules?
  12. Onto which email? (email_registered, email_registrationaccepted, email_registrationdenied) Try calling it like this $pilot->code; or PilotData::getPilotCode($pilot->code, $pilot->pilotid); It will work with two of the emails, otherwise you will need an extra step.
  13. It should be pulling the data from the pireps table as this is the table you are using when you edit the payrate in the "Edit PIREP" section, or am I mistaken? I haven't touched anything to do with the Ledger table, I don't think.
  14. Uh, yeah. PayChecker was taking the pilot's payrate out of it, check the github link again and there should be another indication on the paychecker page called the "Final Revenue" calculated using the PIREP table's pilotpay instead of the pilot's payrate (or in some cases, the value from the ledger table). Also, what other issues are there currently, has the internal ones been fixed and it's only the PayChecker? It's getting confusing with so many posts lol. Btw, the Paychecker only calculates it on the page, so trust the PIREP Revenue for the moment. If everything else is good, then let us know.
  15. Have you changed the contents of your core_htmlhead? If so, can you post the contents. It is definitely a jQuery conflict issue, and I'm not picking up any errors on your site, so please post that file and possibly your layout file to determine what's going on.
  16. Yeah, this is basically useless, can't see a point where this would be used, but it's probably there for a reason, so I'd leave it alone. And yeah, your right, I made the script earlier to get the pilot's payrate instead of the pilotpay from the pireps table in case that field needed to be used in the future, but you should be able to go and change your PIREPData.class.php function from before to this
  17. By pilot pay, you mean a new rate per hour? And does this only occur when you edit a PIREP?
  18. PIREPData.class.php Around line 855, find this (in the updateFlightReport function at the bottom) self::calculatePIREPPayment($pirepid); And replace it with this self::calculatePIREPPayment($pirepid, true); See if that fixes anything, pretty sure it has something to do with this in the updateFlightReport function # Recalculate finances if these fields are set... if($recalc_finances === true) { $data = array( 'price' => $pirepdata['price'], 'load' => $pirepdata['load'], 'expenses' => $pirepdata['expenses'], 'fuelprice' => $pirepdata['fuelprice'], 'pilotpay' => $pirepdata['pilotpay'], 'flighttime' => $pirepdata['flighttime'], ); $gross = floatval($pirepdata['load']) * floatval($pirepdata['price']); $revenue = self::getPIREPRevenue($data, $pirepinfo->paytype); $pirepdata = array_merge($pirepdata, array( 'flighttime_stamp' => $flighttime_stamp, 'gross' => $gross, 'revenue' => $revenue, ) ); } Don't have time now to look at it though.
  19. I'm gonna guess that datatables uses an updated version of jQuery here, and the tabs for the schedule results uses an older version with deprecated functions, therefore the two don't like each other. Few fixes for this, use jQuery.noConflict on the tabs, try and update the tabs to the newer version of jQuery, use or make a schedule search option yourself thus removing the tabs altogether or making your own compatible with the latest versions.
  20. Noted. Should be able to leave it in, but it shouldn't matter as you are just replacing the function here and it should override whatever you've already got. Edit: Literally just got what you meant, updated the post, it should work.
  21. Ok, it shouldn't change how everything works behind the scenes as it's just using a function to place zeros on the left of the pilotid until the length of it reaches what you've defined, purely for display, however the original number should remain the same across the board.
  22. I don't think so, what function are you using to keep it as 4 digits? As long as the original number in the DB is the same, then you should be all good.
  23. No, not the default number sorry, the ordering, because it looks for number then length (I think), 0 comes before 1, so theoretically is you have these 10 20 1000 It will become like this currently 10 1000 20 By if you re-route a zero in front of it, it should become like this 0010 0020 1000 etc, so the id matches the length while still keeping the number there, might look silly, but it works.
  24. Another option would be to make a json response from the 'Pilot Module' and check the length of the pilotid, if it's shorter than four, append a zero to it before the number so 996 would be 0996, then 1000, not ideal, but it should work. Then you can re-route datatables to read this.
×
×
  • Create New...