Jump to content

Adding division search to schedules


scottjgd

Recommended Posts

So what I am looking to do is add the ability to search the schedules by division. Our VA uses divisions to distinguish flights in the schedule as follows: CCC-NOC001 CCC-EOC001 etc. Where the NOC and EOC are divisions. We currently have 9 divisions and the complaint I'm getting is that with all the schedules its hard find a flight they are looking for. So I want to create a division filter based on the flightnum field which in itself is easy enough to do, but I would wind up with a drop-down list of ever flight in the database. What I need to know is how can I create it so that it only searchs for the division code.

<div id="division">
   	<p>Select Division</p>
       <select id="division" name="division">
	<option value="">Select Division</option>
                       <?php

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

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

this is the code for the table so all I need is the code that would be placed in schedules.php or more to the point what I need to make the code look in the flight num for just the 3 letter division code.

Link to comment
Share on other sites

Sorry But this is not a duplicate post my problem is different, that part I already pretty much knew and would result in a drop down list of about 500 items in length what i need is how to truncate the data field so only the 3 letters of the flight num show up so instead of -NOC001 I get NOC.

Thank You for your input though

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...