Jump to content

Extract from schedules the flighnumber comprised between two values


Tato123

Recommended Posts

Hello Guys,

I have a question to ask yourself.

I have these schedules

Flight number

TOU001

TOU002

SOG001

SOG002

SOG003

SOG004

SOG005

I need to extract from the schedule with a query flights between flighnumber SOG001 and SOG003

I try with that query:

<?php
$query="SELECT * FROM  phpvms_schedules
WHERE flightnum  BETWEEN 'SOG00001' And 'SOG00005'";
$list=DB::get_results($query);
foreach ( $list as $ist)
?>

With this query i show only a result.

Can you tell me how to see all flighnumber between SOG0001 and SOG0005?

Link to comment
Share on other sites

Hi Vangeis,

I try but don't work

WHERE flightnum => 'SOG00001' and flightnum <= 'SOG00003' ";

or

WHERE flightnum => 00001 and flightnum <= 00003 ";

in no way works

<table width="750" class="tablevar" id="tabledlist">
<tr>
<td>Volo N</td>
<td>Dep.Air</td>
<td>Arr.Air</td>
<td>Dep.Time</td>
<td>Arr.Time</td>
<td>Aereo</td>
<td>Dist</td>
<td>Day</td>
<td>Route</td>
<td>Note</td>
<td>Options</td>
</tr>
<?php
$query="SELECT * FROM  phpvms_schedules
WHERE flightnum => 00001 and flightnum <= 00003 ";
$list=DB::get_results($query);
foreach ( $list as $ist)
?>
<th><?php echo $ist->flightnum ?></th>
<th><?php echo $ist->depicao ?></th>
<th><?php echo $ist->arricao ?></th>
<th><?php echo $ist->deptime ?></th>
<th><?php echo $ist->arrtime ?></th>
<th><?php echo $ist->aircraft ?></th>
<th><?php echo $ist->distance ?></th>
<th><?php echo Util::GetDaysCompact($ist->daysofweek); ?>
<th><?php echo $ist->route_details ?></th>
<th><?php echo $ist->notes ?></th>
<th nowrap>
 <a href="<?php echo url('/schedules/details/'.$ist->id);?>">View Details</a><br />
 <a href="<?php echo url('/schedules/brief/'.$ist->id);?>">Pilot Brief</a><br />

 <?php
 # Don't allow overlapping bids and a bid exists
 if(Config::Get('DISABLE_SCHED_ON_BID') == true && $ist->bidid != 0)
 {
 ?>
  <a id="<?php echo $ist->id; ?>" class="addbid"
   href="<?php echo actionurl('/schedules/addbid');?>">Add to Bid</a>
 <?php
 }
 else
 {
  if(Auth::LoggedIn())
  {
   ?>
   <a id="<?php echo $ist->id; ?>" class="addbid"
 href="<?php echo url('/schedules/addbid');?>">Add to Bid</a>
  <?php   
  }
 } 
 ?>
</th>
</table>
<br />

Link to comment
Share on other sites

<h3>Addestramento / Trasferimento</h3>
<p>Con questa attivita' il pilota effettua:
<br />
<br />
Addestramento nelle aree previste o da portaerei per carrier qualification (VOAT)
<br />
<br />
Il trasferimento da un aeroporto militare ad un'altro, da portaerei a aereoporto militare e viceversa(VOAT
O IOAT).
<br />
<br />
AEREI: F-14, F-15, F-16, F-18, EUROFIGHTER, AV-8B (HARRIER), TORNADO, GRUMMAN A6 INTRUDER, AIRBUS A319, ATR 72, P180.
<br />
<br />
ELI: A109, B212, B412, CH47, SH3D, MH53, SH60, EH101.
<br />
</p>
<br />
<table width="750" class="tablevar" id="tabledlist">
<tr>
<td>Volo N</td>
<td>Dep.Air</td>
<td>Arr.Air</td>
<td>Dep.Time</td>
<td>Arr.Time</td>
<td>Aereo</td>
<td>Dist</td>
<td>Day</td>
<td>Route</td>
<td>Note</td>
<td>Options</td>
</tr>
<?php
$query="SELECT * FROM  phpvms_schedules
WHERE flightnum >= '00001' and flightnum <= '00003' ";
$list=DB::get_results($query);
foreach ($list as $ist)
?>
<th><?php echo $ist->flightnum ?></th>
<th><?php echo $ist->depicao ?></th>
<th><?php echo $ist->arricao ?></th>
<th><?php echo $ist->deptime ?></th>
<th><?php echo $ist->arrtime ?></th>
<th><?php echo $ist->aircraft ?></th>
<th><?php echo $ist->distance ?></th>
<th><?php echo Util::GetDaysCompact($ist->daysofweek); ?>
<th><?php echo $ist->route_details ?></th>
<th><?php echo $ist->notes ?></th>
<th nowrap>
 <a href="<?php echo url('/schedules/details/'.$ist->id);?>">View Details</a><br />
 <a href="<?php echo url('/schedules/brief/'.$ist->id);?>">Pilot Brief</a><br />

 <?php
 # Don't allow overlapping bids and a bid exists
 if(Config::Get('DISABLE_SCHED_ON_BID') == true && $ist->bidid != 0)
 {
 ?>
  <a id="<?php echo $ist->id; ?>" class="addbid"
   href="<?php echo actionurl('/schedules/addbid');?>">Add to Bid</a>
 <?php
 }
 else
 {
  if(Auth::LoggedIn())
  {
   ?>
   <a id="<?php echo $ist->id; ?>" class="addbid"
 href="<?php echo url('/schedules/addbid');?>">Add to Bid</a>
  <?php   
  }
 } 
 ?>
</th>
</table>
<br />

Link to comment
Share on other sites

The Function in my TOUR Module:

public function get_schedules_sog()
{
$this->set('schedules', TourData::get_sog_schedules());
 $this->show('tour/tour_schedules_sog.tpl');
}

The Query in my TourData.Class

public function get_sog_schedules()
{
 $query = "SELECT * FROM ".TABLE_PREFIX."schedules
		 WHERE flightnum >= '00001' and flightnum <= '00003' ";
 return DB::get_results($query);
}

my tour_schedules_sog.tpl

<h3>Addestramento / Trasferimento</h3>
<table width="750" class="tablevar">
<tr>
<td>Volo N</td>
<td>Dep.Air</td>
<td>Arr.Air</td>
<td>Dep.Time</td>
<td>Arr.Time</td>
<td>Aereo</td>
<td>Dist</td>
<td>Route</td>
</tr>
<?php
$schedules=DB::get_results($query);
foreach ($schedules as $ist)
?>
<th><?php echo $ist->flightnum ?></th>
<th><?php echo $ist->depicao ?></th>
<th><?php echo $ist->arricao ?></th>
<th><?php echo $ist->deptime ?></th>
<th><?php echo $ist->arrtime ?></th>
<th><?php echo $ist->aircraft ?></th>
<th><?php echo $ist->distance ?></th>
<th><?php echo $ist->route_details ?></th>
</table>

with:

WHERE flightnum >= '00001' and flightnum <= '00003' ";

i have an error in foreach,

if i change in the query:

WHERE flightnum >= '00001' and flightnum <= '00003' "; in WHERE flightnum >= 'SOG00001' and flightnum <= 'SOG00003' ";

I see all 1 record, the SOG00003

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