Jump to content

schedule_searchform addition help


Toby

Recommended Posts

Good Evening,

I am very new to phpVMS and trying to figure this section part out. I am not new to PHP but my skill level is just below an intermediate level. I have developed web_apps before but this is the first time I've tried to take something a existing system and add something to it.

Anyways, I am trying to add a new filter to the original schedule_searchform.tpl file that comes with phpvms right from the download.

Below are the two parts of code that I have added. When I go to the Schedules page then click on "By Airline" tab, no Airlines show up in the drop down. Tried searching the Documentation for the correct values but have no success in order to try and keep the below format the same

<li><a href="#airlinetab"><span>By Airline</span></a></li>

<div id="airlinetab">
<p>Select Airline:</p>
<select id="airlines" name="airlines">
<option value="">Select Airline</option>
<?php

if(!$airlines) $airlines = array();
foreach($airlines as $airline)
{
echo '<option value="'.$airline->name.'">'.$airline->name.'</option>';
}

?>
</select>
<input type="submit" name="submit" value="Find Flights" />
</div>

edit for above code: I have tried different values for $airline-> but no success.

Below is the original schedule_searchform.tpl file. Any assistance would be helpful

<h3>Search Schedules</h3>
<form id="form" action="<?php echo actionurl('/schedules/view');?>" method="post">
<div id="tabcontainer">
<ul>
<li><a href="#depapttab"><span>By Departure Airport</span></a></li>
<li><a href="#arrapttab"><span>By Arrival Airport</span></a></li>
<li><a href="#aircrafttab"><span>By Aircraft Type</span></a></li>
<li><a href="#distance"><span>By Distance</span></a></li>
</ul>
<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>
<div id="aircrafttab">
<p>Select aircraft:</p>
<select id="equipment" name="equipment">
<option value="">Select equipment</option>
<?php

if(!$equipment) $equipment = array();
foreach($equipment as $equip)
{
echo '<option value="'.$equip->name.'">'.$equip->name.'</option>';
}

?>
</select>
<input type="submit" name="submit" value="Find Flights" />
</div>
<div id="distance">
<p>Select Distance:</p>
<select id="type" name="type">
<option value="greater">Greater Than</option>
<option value="less">Less Than</option>
</select>
<input type="text" name="distance" value="" />
<input type="submit" name="submit" value="Find Flights" />
</div>
</div>
<p>
<input type="hidden" name="action" value="findflight" />
</p>
</form>
<script type="text/javascript">
</script>
<hr>

Link to comment
Share on other sites

Sir,

Thank you for the response. Currently we are using FrontSchedule, its a nice script but we are having issues with it in regards to restricting aircrafts to rank although all other settings are correct for restricting aircraft by rank.

Personally, it came down to that the VA Staff likes the default schedule page but wants the addition of search by Airline.

Our VA, CaribbeanSky Alliance primarily has 5 airlines in one with 20 codeshare airlines for routes throughout South America, Central America, North America and Europe.

Any assistance anyone could give on adding a search tab for search by Airline on the default Schedule_searchform.tpl file would be appreciated

Link to comment
Share on other sites

on the default search page ( schedule_searchform.tpl ), Addition of search by Airline

http://tobyinc.org/i...-by-airline.png <- image

I have the tab in there, just no results in the drop down.

On schedule_searchform.tpl

<!-- Create the tab -->
<li><a href="#allairlines"><span>By Airline</span></a></li>
<!-- Code for Airline Drop Down -->
<div id="allairlines">
<p>Select Airline:</p>
<select id="allairlines" name="allairlines">
<option value="">Select Airline</option>
<?php

if(!$allairlines) $allairlines = array();
foreach($allairlines as $airline)
{
echo '<option value="'.$airline->name.'">'.$airline->name.'</option>';
}

?>
</select>
<input type="submit" name="submit" value="Find Flights" />

From the above code, I've been looking for the correct values for the past couple days or how to get the results on this page for airlines.. I did find the Schedules Modual in the /Core directory but don't know what would go in there.

edit: vader21: easy answer you were probably looking for.

using the default phpVMS schedule tpl file;

you can search by;

By Departure

By Arrival

By Aircraft

By Distance

What I'm trying to do is create a 5th option to search by Airline. I did try to find another post in a couple forums spots in this phpvms forum but any I did find referred to FrontSchedule which our airline is wanting to drop that and go back to the default schedule page with adding the 5th option to search by airline.

What I am ultimately looking for is a code snippet to add in this 5th option or a direct location on how I can add this option in and which files to edit ( if edit needs to be done on other files besides schedule_searchform.tpl )

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...