Coder Social home page Coder Social logo

smartcars-3-phpvms5-api's Introduction

smartCARS 3 phpVMS 5 API

Web Script Files for smartCARS 3 in phpVMS 5

Introduction

smartCARS 3 is a web-based flight tracking system for virtual airlines. It is a complete rewrite of the original smartCARS system, and is designed to be more flexible and easier to use. This repository contains the web script files for smartCARS 3 in phpVMS 5.

Requirements

  • phpVMS 5.X
  • PHP 5.6 or higher
  • MySQL 5.6 or higher
  • PHP Database Objects (PDO) Extension
  • A webserver that accepts the Authorization header (Apache, nginx, etc.)
    • If you are using a shared hosting provider, you may need to contact them to enable this feature.

Installation

The smartCARS 3 phpVMS 5 API uses "handlers", which represent the platforms it is communicating with. We support phpVMS 5 in this repository, but custom handlers can be written for other platforms.

For phpVMS 7 support, please go to the phpVMS 7 repository instead.

Step 1

Download the latest release from the releases page.

Step 2

Extract the contents of the release zip file to an empty folder which is in the same directory as your installation (a core folder should exist in this directory).

Step 3 (nginx only)

If you are using nginx as your webserver, you will need to serve the smartCARS API as a seperate location. An example configuration is below:

location /smartcars/api {
    try_files $uri $uri/ /smartcars/api.php?$query_string;
}

You will need to modify this configuration to fit your needs and to point to the correct location.

Step 4

Verify that the installation was successful by visiting the handler file in your browser. You should see a JSON response with the version number of the API and the name of your handler.

Assuming you have placed phpVMS 5 in your public_html folder and your API folder is called smartcars: http://yourdomain.com/smartcars/api/phpvms5/

This URL will be the "Script URL" option in smartCARS 3 Central when managing your community.

smartcars-3-phpvms5-api's People

Contributors

genericnerd avatar thien42 avatar turbofandude avatar jordanhavard avatar bossofgames avatar alex6511 avatar walkerairtrans avatar

Stargazers

 avatar  avatar Mario Fehr avatar  avatar  avatar  avatar  avatar

Watchers

Brett Buchanan avatar  avatar Mario Fehr avatar Kostas Georgiou avatar Darlan Fernandes avatar Steven P avatar Nicola Podda avatar

smartcars-3-phpvms5-api's Issues

[BUG] - Changing your pilotId removes access to pilot's data

Describe the bug

The SC3 API uses the user's pilot_id field to link the different tables (pireps, sessions, bids, etc ...).
However phpvms uses the user_id field to link the different tables.
If your user_id and pilot_id are not the same value, the data will look fine in SC3, but not when using the phpvms UI or vice-versa.

I would also expect to be able to change my pilot_id whenever I want and keep the behaviour consistant between phpvms7 and SC3, since this is something the phpvms7 UI offers.

How do you reproduce this bug?

  1. Have a different value for pilot_id and user_id for a given pilot in the users table.
  2. Fly a flight and submit a pirep it using SC3
  3. The pirep will be available in the user's logbook in SC3, but not in the phpvms UI

Expected behavior

The usage of ids to link the various tables should be consistant between the SC3 API and phpvms.

Screenshots

No response

API Version

0.3.3

PHP Version

8

Database & version

Mysql

Webserver version

Apache 2

Browser

Any

Handler

phpvms7

Additional context

No response

[BUG] - Failed to call local API

Describe the bug
When trying to find your bids it knows something is in there but does not populate - see error below.

To Reproduce
Steps to reproduce the behavior:

  1. Go to flights on v7 handler
  2. Click on refresh
  3. Nothing is shown
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
https://prnt.sc/-AbR2MOJLRKQ

System Information (please complete the following information):

  • Version 0.2.4
  • PHP version: 8.0.11
  • Database version: 10.6.12-MariaDB-0ubuntu0.22.04.1 - Ubuntu 22.04
  • Webserver version: PHP Version 8.0.28
  • Browser: NA
  • Handler: phpvms7

Additional context
FROM THE LOG FILE

error: Failed to call local API {"endpoint":"api/credentials/retrieve/tfdidesign","error":{"code":"ERR_BAD_REQUEST","config":{"adapter":["xhr","http"],"data":"{}","env":{},"headers":{"Accept":"application/json, text/plain, /","Content-Type":"application/json"},"maxBodyLength":-1,"maxContentLength":-1,"method":"post","params":{},"timeout":0,"transformRequest":[null],"transformResponse":[null],"transitional":{"clarifyTimeoutError":false,"forcedJSONParsing":true,"silentJSONParsing":true},"url":"http://localhost:7172/api/credentials/retrieve/tfdidesign","xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN"},"message":"Request failed with status code 404","name":"AxiosError","stack":"AxiosError: Request failed with status code 404\n at http://localhost:7172/app/static/js/main.18976a09.js:2:365420\n at XMLHttpRequest.d (http://localhost:7172/app/static/js/main.18976a09.js:2:365568)","status":404}}

[BUG] - Flight Center - User Created Flights Do Not Append Airline Code

Describe the bug

If a flight is created using the "Create Flight" option, it will create the flight with an invalid airline code if the airline code was not entered as part of the callsign.

If you look at the admin panel in phpVMS, the airline code is the the first 3 characters of the entered callsign and the flight number is either blank of the callsign characters starting at the 4th character.

image

This causes multiple "charter" airlines to show in the admin panel.

image

How do you reproduce this bug?

  1. Go to Flight Center and click "Create Flight".
  2. For the callsign just enter a number, like 927.
  3. Enter the other required flight information and click create.
  4. Go into phpVMS admin and can see the flight added to the schedule and also the multiple charter airlines that appear in the airlines list.

Expected behavior

The airline code should be appended to the front of the callsign when a new flight is created. So if the airline code of the user session is "NBL" then if they entered "927" then the callsign would be saved as "NBL927".

I think part of the user confusion with this current behavior is that in SC2 you just entered the flight number portion (not the airline code) when creating a flight.

Screenshots

No response

Operating system

Windows 10 22H2

Community airline

Noble Air

smartCARS Version

0.12.0

Plugins installed

Chat 0.11.0, Flight Center 0.10.1, Flight Tracking 0.12.0, Logbook 0.10.1, Map 0.10.0, SimBrief 0.10.1

Additional context

No response

[BUG] - phpVMS5 Update.php

Describe the bug
update.php in phpVMS5 has a syntax typo that defaults timeremaining to 00:00.

'timeremaining' => sprintf('%02d:%02d', floor($_POST['timeRemaining'] / 60), round(($_POST['timeRemaining'] % 1) * 60)),

should be

'timeremaining' => sprintf('%02d:%02d', floor($_POST['timeRemaining'] / 60), round(($_POST['timeRemaining']) * 60)),

(the % 1 should be removed from the round() operation.

To Reproduce
Steps to reproduce the behavior:
N/A

Expected behavior
N/A

Screenshots
N/A

System Information (please complete the following information):

  • Version 0.2.3
  • PHP version: 7.4
  • Database version: MariaDB 10.5
  • Webserver version: NGINX/Apache
  • Browser: Chrome
  • Handler: phpVMS5/wat-remix

Additional context
N/A

[BUG] - phpvms 7: Create Flight - After creating selected fleet type/sub fleet unavailable

Describe the bug

When using smartcars 3 and doing a "Create Flight", after selecting your fleet type/subfleet, and the required fields after creating the Aircraft changes to No Aircraft Avail.

How do you reproduce this bug?

  1. Click Create Flight
  2. Populate required fields
  3. click create
  4. No Aircraft Avail. now shown

Expected behavior

Selected fleet/sub fleet should be shown.

Screenshots

image

API Version

0.3.4

PHP Version

8.0.11

Database & version

10.5.12 MariaDB

Webserver version

Apache

Browser

Firefox

Handler

phpvms7

Additional context

No response

[BUG] - Default web API configuration includes tfdidev path

Describe the bug
The web API environment.php (in phpVMS handler files) includes a webRoot constant that includes tfdidev.

To Reproduce
Steps to reproduce the behavior:

  1. Install web scripts
  2. Open and view environment.php file

Expected behavior
This should be included elsewhere, properly documented, and/or optimized/removed (if possible).

System Information (please complete the following information):

  • Not system dependent

Additional context
Tested initially on macair on Xenon

[BUG] - Cannot login with Pilot ID

Describe the bug
Cannot login with pilot ID to a virtual airline, either using the single digit, numbers only or with the airline ID (tried 4, 0004, and SCD0004).

To Reproduce
Steps to reproduce the behavior:

  1. Open the application
  2. Log in to TFDi Design account
  3. Select virtual airline
  4. Attempt to log in with the pilot ID

Expected behavior
Login should be allowed with pilot IDs, not just with an email address.

Screenshots
image

System Information (please complete the following information):

  • Version 0.2.3
  • PHP version: 8.0
  • Database version: Unknown
  • Webserver version: Unknown
  • Handler: phpvms7

Additional context
Clone of invernyx/smartcars-3-bugs#8

[BUG] - Flight Center - Schedule Flight Times Not Displayed Correctly

Describe the bug

In the search for a flight result list in Flight Center, the flight times (duration) that are displayed are incorrect.

In phpVMS, the flight time is stored as a decimal number representing HH:MM (ie: 06:14 = 6.14). It looks like SC3 is not treating what is after the decimal as the minutes.

image

For example for a flight time of 06:14, this is stored as 6.14 in phpVMS. In SC2, the flight time display correctly as 6:14. However, SC3 displays this as 06h 08m. It looks like SC3 is multiplying the minutes (what comes after the decimal) by 60. So, ( .14 * 60) gives 8.4... which seems to be what is displayed by SC3.

How do you reproduce this bug?

  1. Open Flight Center.
  2. Click New Bid.
  3. Can enter search criteria or not... as long as a list of flights appears.

Expected behavior

The flight time displayed should match what is on the flight schedule. The flight times display correctly in SC2.

Screenshots

SC2:

image

SC3:

image

Operating system

Windows 10 22H2

Community airline

Noble Air

smartCARS Version

0.12.0

Plugins installed

Chat 0.11.0, Flight Center 0.10.1, Flight Tracking 0.12.0, Logbook 0.10.1, Map 0.10.0, SimBrief 0.10.1

Additional context

No response

[BUG] - Aircraft data sent is wrong for PHpvms 5.7

Describe the bug

Hello we are currently based on vms v5.7 and use smart cars 3 as our acars
the problem we face is it sends wrong or no data to our servers so sometimes in live flights aircraft is blank or it remains stuck on a single registration and aircraft for all the flights for eg if i flew QTR A7-BFB registration it wont change even if i flew a united aircraft
please can we get support on this
as Phpvms 5 is supported by you and mentioned in the requirements and no upgrading to vms7 is not possible for us now
thank you

How do you reproduce this bug?

1.Live flights list on our VA 's website
2-aircraft data wrong

Expected behavior

it should change with change in flights (Registration and aircraft type)
ATTACHED a screenshot where sc3 doesnt send any aircraft data
but sc2 does

Screenshots

image
image
image

API Version

0.3.7

PHP Version

5.7

Database & version

Maria DB

Webserver version

Apache win sql etc

Browser

Chrome /EDGE latest

Handler

phpvms5

Additional context

please help us!!!

[BUG] - phpvms 7 - PIREPS being submitted as manual

Describe the bug

smartcars 3 pireps are being submitted as manual pireps in the phpvms 7 system, this causes the auto processing of pireps to break.

How do you reproduce this bug?

  1. Log a flight with SC3
  2. Submit
  3. View phpvms 7 admin center and youll have a pending "manual (smarcars 3)" PIREP.

Expected behavior

Should have its own class of submitting instead of manual to allow for processing.

Screenshots

image

API Version

0.3.4

PHP Version

8.0.11

Database & version

10.5.12 MariaDB

Webserver version

Apache

Browser

Chrome

Handler

phpvms7

Additional context

No response

[BUG] - phpVMS 7 ACARS Table is not written to in update.php

Describe the bug

When smartCARS sends the position reports via the API's update.php file, it appears to not be writing to the acars table. When a pilot submits the PIREP, the complete.php fails with a 404 error in checking if the flight exists in the acars table.

How do you reproduce this bug?

N/A

Expected behavior

No response

Screenshots

No response

API Version

development branch

PHP Version

8.1

Database & version

MySQL 8

Webserver version

Nginx

Browser

N/A

Handler

phpvms7

Additional context

image

image

[BUG] - Error connecting to script URL - 301 - Redirects Are Not Allowed

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

System Information (please complete the following information):

  • Version [e.g. 0.3.1]
  • PHP version: [e.g. 8.0.11]
  • Database version: [e.g. 10.5.12-MariaDB]
  • Webserver version: [e.g. Apache/2.4.51 (Win64) OpenSSL/1.1.1l PHP/8.0.11]
  • Browser: [e.g. Chrome 96.0.4664.110]
  • Handler: [e.g. phpvms5]

Additional context
Add any other context about the problem here.

[BUG] - 500 error when fetching `airports`, `aircraft` & `bookings`

Describe the bug
500 Error when fetching airports, aircraft & bookings

To Reproduce
Steps to reproduce the behavior:

  1. Login to VA (and open dev tools)
  2. Click first plane icon
  3. See errors in console

Note, all previews in dev tools look the same
image

Expected behavior
Not be a 500 error

Screenshots
image
image
image

System Information (please complete the following information):

  • OS: Win 10 Pro 10.0.19044 Build 19044
  • Community ID: 33
  • Version latest (0.2.3)
  • Plugins used: standard ones on install I think (chat, flight-center, flight-tracking)

Additional context
Doesn't look like a request is firing off to the web script URL

[BUG] - Airport validation does not allow numbers

Describe the bug

Certain airfields (KN66, etc.) have numbers in their ICAO code and this causes smartCARS to break.

How do you reproduce this bug?

Try to use an airport with a numeric (or partially numeric) ICAO.

Expected behavior

No response

Screenshots

No response

API Version

0.3.3

PHP Version

n/a

Database & version

n/a

Webserver version

n/a

Browser

n/a

Handler

n/a

Additional context

No response

Questions about smartCARS 3

For smartCARS to work for us, we had to make several adjustments, since our fleet of aircraft is not linked to routes, we provide routes according to the current location of each aircraft. So far everything perfect, we managed to make it work. But we have some doubts:

1ª - The smartCARS 3 is registering in LIBRAS and not Kilograms, even changing the settings;

2ª - We would like to know how it identifies the flight network;

3ª - The flight map does not show VA traffic, it only appears when selecting a flight network;

4ª - We are in doubt about knowing when the total flight time count starts and when it ends.

5ª - And where we find all the possible items that smartCARS manages to register during the flight, so that we can assign them as needed.

If there are any places we can check for corrections, please let us know. Thank you and congratulations for the excellent work.

[BUG] - Cancelling an ongoing flight should remove the relevant data from the smartCARS3_OngoingFlights

Describe the bug

When a user cancels a flight, the entries in the smartCARS3_OngoingFlights table are still there.
This can lead to a wrong pilot report in case the user decides to fly the same bid at a later time.

How do you reproduce this bug?

  1. Submit a bid
  2. Start a flight with SC3
  3. Cancel the flight after starting it
  4. There is still data left in the the smartCARS3_OngoingFlights table

Expected behavior

When a user cancels a flight from SC3, the relevant entries from the smartCARS3_OngoingFlights table are removed.
The same thing should happen when a user unbooks the flight, to prevent unnecessary data usage.
We should consider creating a new endpoint flight/cancel that would remove that data.

Screenshots

No response

API Version

0.3.3

PHP Version

8.0.11

Database & version

8.0.33

Webserver version

Apache 2

Browser

Any

Handler

Any

Additional context

No response

[BUG] - Charter flights stay, even when a bid is removed on one

Describe the bug
A charter flight remains in the database, even once the bid is removed from the pilot who chartered it.

To Reproduce
Steps to reproduce the behavior:

  1. Charter a flight
  2. Remove a bid

Expected behavior
The charter flight should be removed from the database once the bid is removed.

System Information (please complete the following information):

  • Version [e.g. 0.2.4]
  • PHP version: [e.g. 8.0.11]
  • Database version: [e.g. 10.5.12-MariaDB]
  • Webserver version: [e.g. Apache/2.4.51 (Win64) OpenSSL/1.1.1l PHP/8.0.11]
  • Browser: [e.g. Chrome 96.0.4664.110]
  • Handler: phpvms5

[BUG] - phpVMS5 cancel.php file has incorrect statement.

Describe the bug

if($database->fetch('SELECT id FROM ' . dbPrefix . 'bids WHERE id=? AND user_id=?', array($_POST['bidID'], $pilotID)) === array())
{
    error(404, 'There is no ongoing flight');
}

should be this

if($database->fetch('SELECT id FROM ' . dbPrefix . 'bids WHERE bidid=? AND pilotid=?', array($_POST['bidID'], $pilotID)) === array())
{
    error(404, 'There is no ongoing flight');
}

id and user_id are not valid columns in the phpVMS5 database structure.

How do you reproduce this bug?

Check the logs of the server -- you will see this called out in the php handler when trying to call the DB query.

Expected behavior

Shown above.

Screenshots

No response

API Version

0.3.7

PHP Version

7.4

Database & version

10.5 MariaDB

Webserver version

Apache

Browser

Chrome

Handler

phpvms5

Additional context

No response

[BUG] - Cancelling a flight leaves an unfinished pirep in phpvms which breaks the logbook

Describe the bug

In phpvms7, ongoing flights seem to create an incomplete pirep object with status pending which doesn't get deleted on cancellation.
This pirep also had a missing aircraft_id which breaks the logbook.

How do you reproduce this bug?

  1. Bid on a flight in a phpvms7 instance
  2. Start the flight
  3. Cancel mid-flight
  4. Observe a stale pirep object still being present in the database

Expected behavior

The pirep object gets deleted on flight cancellation by the user

Screenshots

No response

API Version

0.3.3

PHP Version

8

Database & version

Mysql

Webserver version

Apache 2

Browser

Any

Handler

Any

Additional context

No response

[BUG] - Aircraft Type, Registration and ICAO are not shown on the live map

Describe the bug

Good day,

since one of the recents updates oour live map does not show the aircraft registration and ICAO anymore. We did not make any code changes, just updated from API version 0.3.5 to version 0.3.7.

We followed the suggested changes from invernyx/smartcars-3-bugs#184 to make it work in the past.

Suddenly, this stopped working. Any ideas why?

How do you reproduce this bug?

  1. Navigate to the livemap of phpVMS 5

Expected behavior

The aircraft type, registration and ICAO is not being exported to the hphVMS anymore.

Screenshots

error

Operating system

Windows 10 Pro 22H2

Community airline

LH Virtual Group

smartCARS Version

3.0.0

Plugins installed

Chat, Flight Center, Flight Tracking, Logbook, Map, SimBrief

Additional context

The aircraft type, registration and ICAO is not being exported to the hphVMS anymore.

[BUG] -

Describe the bug

PHP Warning: file_get_contents(../../env.php): Failed to open stream: No such file or directory in /home/uavirtual/domains/vms.uavirtual.org/public_html/cars/0.3.6/handlers/phpvms7/environment.php on line 6
PHP Warning: Undefined array key 1 in /home/uavirtual/domains/vms.uavirtual.org/public_html/cars/0.3.6/handlers/phpvms7/environment.php on line 9
PHP Warning: Undefined array key 1 in /home/uavirtual/domains/vms.uavirtual.org/public_html/cars/0.3.6/handlers/phpvms7/environment.php on line 10
PHP Warning: Undefined array key 1 in /home/uavirtual/domains/vms.uavirtual.org/public_html/cars/0.3.6/handlers/phpvms7/environment.php on line 11
PHP Warning: Undefined array key 1 in /home/uavirtual/domains/vms.uavirtual.org/public_html/cars/0.3.6/handlers/phpvms7/environment.php on line 12
PHP Warning: Undefined array key 1 in /home/uavirtual/domains/vms.uavirtual.org/public_html/cars/0.3.6/handlers/phpvms7/environment.php on line 13

How do you reproduce this bug?

Attempt to make use of SmartCars 3 to login as pilot
API preview call (ie .../api/phpvms7)

Expected behavior

Allow SmartCars 3 to login

Screenshots

No response

API Version

0.3.6

PHP Version

8.1.23

Database & version

MariaDB version 10.6.12

Webserver version

Apache version 2.4.52 ubuntu 22.04

Browser

Vivaldi 6.2 & Chrome 117.0.5

Handler

phpvms7

Additional context

No response

[BUG] - News Page Showing First rather than most recent

Describe the bug
The home screen for SC3 has a place to display our news feed. Currently, the newsfeed is showing the first ever news "article" we posted on our site rather than the latest.

To Reproduce
Steps to reproduce the behavior:
Open SmartCARS and there it is.

Expected behavior
The display should show our latest news release only.

Screenshots
N/A

System Information (please complete the following information):

  • OS: Windows 10
  • Community ID:
  • Version beta release
  • Plugins used: [chat, flight-breakdown, flight-center, flight-tracking, map-plugin, pilot-center, simbrief]

Additional context
Add any other context about the problem here.

[BUG] - Aircraft Are Not Sorting Correctly In The Aircraft Dropdown

Describe the bug

After selecting a flight in the Flight Center tab and you wish to change the aircraft the dropdown does not sort the list correctly.

Not Sorting Correctly

When Selecting an aircraft via Create Flight that dropdown sorts correctly. Just need to add the sorting code for already bid flights.

How do you reproduce this bug?

  1. Go to the flight center tab.
  2. Select a flight in your list, or, bid a new flight
  3. Use the dropdown for aircraft selection.

Expected behavior

The create flight aircraft selection sorts correctly. It should look as it does in the pic below.
Sorted Correctly

Screenshots

No response

API Version

0.4.4

PHP Version

7.2

Database & version

MySQL 5.7.44-log

Webserver version

CentOS v7.9.2009

Browser

Version 124.0.6367.119 (Official Build) (64-bit)

Additional context

No response

[FEATURE] - Make return pirepID as string for both phpvms5 & 7

Describe the bug

pirepID are numbers in phpvms 5 and are either number and string in phpvm7

How do you reproduce this bug?

Submit a pirep in phpvm7 and you can get a UUID type so string or numbers.

Expected behavior

Make both phpvms 5 and phpvms 7 send a string

Screenshots

No response

API Version

0.8.3

PHP Version

8.0.11

Database & version

MariaDB

Webserver version

Apache

Browser

Chrome

Handler

phpvms5 & phpvms7

Additional context

No response

[BUG] - Charter flights show up for all pilots

Describe the bug
Charter flights show up during searches for all pilots.

To Reproduce
Steps to reproduce the behavior:

  1. Charter a flight
  2. Remove the bid
  3. Go to search for a flight

Expected behavior
The charter flight should not be searchable, and should only exist when the bid is set.

System Information (please complete the following information):

  • Version [e.g. 0.2.4]
  • PHP version: [e.g. 8.0.11]
  • Database version: [e.g. 10.5.12-MariaDB]
  • Webserver version: [e.g. Apache/2.4.51 (Win64) OpenSSL/1.1.1l PHP/8.0.11]
  • Browser: [e.g. Chrome 96.0.4664.110]
  • Handler: phpvms5

[BUG] - flight/complete.php calls database incorrectly

Describe the bug
The database query for the schedule information doesn't appear to function with an =? in the string. This causes the PIREP to not be filed, even though the application says that it was.

To Reproduce
Steps to reproduce the behavior:

  1. Fly
  2. Click End Flight
  3. Check logbook and see no flight

Expected behavior
Flight should be submitted to the database.

Screenshots
N/A

System Information (please complete the following information):

  • OS: Windows 11
  • Community ID: N/A
  • Version: Webscripts 0.2.3
  • Plugins used: N/A

Additional context
Line 26 in phpvms5/flights/complete.php
$route = $database->fetch('SELECT code, flightnum, depicao, arricao, route, aircraft FROM ' . dbPrefix . 'schedules WHERE id=?', $bids[0]['routeid']);

Works if changed to:
$route = $database->fetch('SELECT code, flightnum, depicao, arricao, route, aircraft FROM ' . dbPrefix . 'schedules WHERE id=', $bids[0]['routeid']);

[Bug] smartCARS Charter Flights Delete Airlines Causing Database Corruption

The following code, as implemented, will cause database corruption as airlines that are referenced in the pireps table now fail to be found correctly in certain setups. Consider refactoring this code.

if($route['notes'] === 'smartCARS Charter Flight') {
$database->execute('DELETE FROM ' . dbPrefix . 'schedules WHERE id=?', array($bids[0]['routeid']));
$charterFlights = $database->fetch('SELECT id FROM ' . dbPrefix . 'schedules WHERE code=? AND notes="smartCARS Charter Flight"', array($route['code']));
if($charterFlights === array())
{
$database->execute('DELETE FROM ' . dbPrefix . 'airlines WHERE code=? AND name="Charter" AND enabled=0', array($route['code']));
}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.