livr517 Posted August 6, 2017 Report Share Posted August 6, 2017 I've looked around for a bit and haven't come across this yet, I apologize in advance if it has already been answered. I need to change the schedule search from the default drop down list, to a search box. Both for the departure and arrival airports. I have a fairly large DB of airports and it heavy lags the site when it attempts to load them all under the drop down options. Any suggestions would be much appreciated. I'm using 5.5.x Quote Link to comment Share on other sites More sharing options...
web541 Posted August 6, 2017 Report Share Posted August 6, 2017 (edited) Try this In the file schedule_searchform.php, find this <div id="depapttab"> <p>Select your departure airport:</p> <select id="depicao" name="depicao"> <option value="">Select All</option> <?php if(!$depairports) $depairports = array(); foreach($depairports as $airport) { echo '<option value="'.$airport->icao.'">'.$airport->icao .' ('.$airport->name.')</option>'; } ?> </select> <input type="submit" name="submit" value="Find Flights" /> </div> <div id="arrapttab"> <p>Select your arrival airport:</p> <select id="arricao" name="arricao"> <option value="">Select All</option> <?php if(!$depairports) $depairports = array(); foreach($depairports as $airport) { echo '<option value="'.$airport->icao.'">'.$airport->icao .' ('.$airport->name.')</option>'; } ?> </select> <input type="submit" name="submit" value="Find Flights" /> </div> Replace it with this <div id="depapttab"> <p>Select your departure airport:</p> <input type="text" name="depicao" /> <input type="submit" name="submit" value="Find Flights" /> </div> <div id="arrapttab"> <p>Select your arrival airport:</p> <input type="text" name="arricao" /> <input type="submit" name="submit" value="Find Flights" /> </div> Edited August 6, 2017 by web541 Quote Link to comment Share on other sites More sharing options...
livr517 Posted August 6, 2017 Author Report Share Posted August 6, 2017 4 hours ago, web541 said: Try this In the file schedule_searchform.php, find this <div id="depapttab"> <p>Select your departure airport:</p> <select id="depicao" name="depicao"> <option value="">Select All</option> <?php if(!$depairports) $depairports = array(); foreach($depairports as $airport) { echo '<option value="'.$airport->icao.'">'.$airport->icao .' ('.$airport->name.')</option>'; } ?> </select> <input type="submit" name="submit" value="Find Flights" /> </div> <div id="arrapttab"> <p>Select your arrival airport:</p> <select id="arricao" name="arricao"> <option value="">Select All</option> <?php if(!$depairports) $depairports = array(); foreach($depairports as $airport) { echo '<option value="'.$airport->icao.'">'.$airport->icao .' ('.$airport->name.')</option>'; } ?> </select> <input type="submit" name="submit" value="Find Flights" /> </div> Replace it with this <div id="depapttab"> <p>Select your departure airport:</p> <input type="text" name="depicao" /> <input type="submit" name="submit" value="Find Flights" /> </div> <div id="arrapttab"> <p>Select your arrival airport:</p> <input type="text" name="arricao" /> <input type="submit" name="submit" value="Find Flights" /> </div> Exactly what, I was looking for. Thanks! for the help. Quote Link to comment Share on other sites More sharing options...
livr517 Posted August 7, 2017 Author Report Share Posted August 7, 2017 If I want to be able to allow for flight number lookup, what should I replace depicao or arricao with? Quote Link to comment Share on other sites More sharing options...
web541 Posted August 11, 2017 Report Share Posted August 11, 2017 There's no default function to do this and it will require editing some of the core files and adding some lines here and there. It would be better to look into a flight search module that does this for you, but it is still possible to do it with the default search. Quote Link to comment Share on other sites More sharing options...
RedKingOne Posted December 23, 2019 Report Share Posted December 23, 2019 I am using this code on my version of crewcenter now. I am wondering if I can limit the search results. At the moment even if I type KJFK as dep airport, results comeback from the whole database. Any help would be appreciated. Thanks Quote Link to comment Share on other sites More sharing options...
Yash Posted December 23, 2019 Report Share Posted December 23, 2019 5 hours ago, Shadesb181 said: I am using this code on my version of crewcenter now. I am wondering if I can limit the search results. At the moment even if I type KJFK as dep airport, results comeback from the whole database. Any help would be appreciated. Thanks Hello there, you may use the datatables to paginate your results into seperate pages of a table. Here it is :https://datatables.net/ Quote Link to comment Share on other sites More sharing options...
Administrators ProAvia Posted December 23, 2019 Administrators Report Share Posted December 23, 2019 14 hours ago, Shadesb181 said: I am using this code on my version of crewcenter now. I am wondering if I can limit the search results. At the moment even if I type KJFK as dep airport, results comeback from the whole database. Any help would be appreciated. Thanks When you select KJFK for the departure airport, does it show only KJFK departures or does it show all departures in your database? If it only shows KJFK departures, you can use pagination to display a smaller number of results per page - as eluded to by Yash. If it displays all schedulesfor your VA when selecting KJFK, you have an error in your coding. Are you using the default schedule search or an addon module to search? Quote Link to comment Share on other sites More sharing options...
RedKingOne Posted December 24, 2019 Report Share Posted December 24, 2019 22 hours ago, ProAvia said: When you select KJFK for the departure airport, does it show only KJFK departures or does it show all departures in your database? If it only shows KJFK departures, you can use pagination to display a smaller number of results per page - as eluded to by Yash. If it displays all schedulesfor your VA when selecting KJFK, you have an error in your coding. Are you using the default schedule search or an addon module to search? They key issue is that it shows all the airports, not only JFK Quote Link to comment Share on other sites More sharing options...
Administrators ProAvia Posted December 24, 2019 Administrators Report Share Posted December 24, 2019 Are you using the default search or an addon module? Quote Link to comment Share on other sites More sharing options...
RedKingOne Posted December 24, 2019 Report Share Posted December 24, 2019 39 minutes ago, ProAvia said: Are you using the default search or an addon module? Yes I am. Quote Link to comment Share on other sites More sharing options...
Administrators ProAvia Posted December 24, 2019 Administrators Report Share Posted December 24, 2019 Default skin or addon skin? Try the search using the default skin and see if it displays only KJFK departures when selecting KJFK in the departure box. What other addon modules do you have installed? Quote Link to comment Share on other sites More sharing options...
RedKingOne Posted December 24, 2019 Report Share Posted December 24, 2019 12 minutes ago, ProAvia said: Default skin or addon skin? Try the search using the default skin and see if it displays only KJFK departures when selecting KJFK in the departure box. What other addon modules do you have installed? I tested the default skin as requested. In the default skin it works exactly like it should. It only shows JFK dep when i hit search. I am using Mark Swans CrewCenter. While this skin is enabled, it throws back all airports instead of just JFK. Quote Link to comment Share on other sites More sharing options...
Administrators ProAvia Posted December 24, 2019 Administrators Report Share Posted December 24, 2019 Hmm, interesting. So something in one of the Crew Center files is probably causing this. Hopefully a member that uses Crew Center has found a fix. Quote Link to comment Share on other sites More sharing options...
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.