how can this modified to work with latest beta which I need to use because of aircraft buy mod
the function is splitted into two instead of one in the beta
public static function incrementFlownCount($code, $flightnum) {
return self::changeFlownCount($code, $flightnum, '+1');
}
/**
* SchedulesData::changeFlownCount()
*
* @param mixed $code
* @param mixed $flightnum
* @param mixed $amount
* @return void
*/
public static function changeFlownCount($code, $flightnum, $amount) {
$schedid = intval($schedid);
$code = strtoupper($code);
$flightnum = strtoupper($flightnum);
if(substr_count($amount, '+') == 0) {
$amount = '+'.$amount;
}
$sql = 'UPDATE ' . TABLE_PREFIX . "schedules
SET timesflown=timesflown {$amount}
WHERE code='{$code}' AND flightnum='{$flightnum}'";
$res = DB::query($sql);
if (DB::errno() != 0) return false;
return true;
}