Jump to content

Help BookingSystem


carlosuc99

Recommended Posts

Hi;

I have FlightBookingSystem by parko. And I have to do two modifications.

In the schedule_resoults.tpl I have this code:

<table width="100%" cellspacing="0" cellpadding="0" border="0">
<?php
if(!$allroutes)
{
echo '<tr><td align="center">No routes have been found!</td></tr>';
return;
}
?>
<script src="http://skyvector.com/linkchart.js"></script>
<thead>
<tr style="height:12px; font-size:14px; font-weight:normal">
<th width="20%" align="center">N° de Vuelo</th>
<th width="20%" align="center">Origen</th>
<th width="20%" align="center">Destino</th>
<th width="20%" align="center">Avión</th>
<th width="20%" colspan="2" align="center">Opciones</th>
</tr>
<tr>
<td width="20%" align="center">------------</td>
<td width="20%" align="center">------------</td>
<td width="20%" align="center">------------</td>
<td width="20%" align="center">------------</td>
<td width="20%" colspan="2" align="center">------------</td>
</tr>
</thead>
<tbody>

<?php
foreach($allroutes as $route)
{
if(Config::Get('DISABLE_SCHED_ON_BID') == true && $route->bidid != 0)
{
continue;
}
if(Config::Get('RESTRICT_AIRCRAFT_RANKS') === true && Auth::LoggedIn())
{
if($route->aircraftlevel > Auth::$userinfo->ranklevel)
{
continue;
}
}
?>
<tr style="height:12px; font-size:14px; font-weight:normal;">
<td width="20%" align="center" valign="middle"><?php echo $route->code . $route->flightnum?></td>
<td width="20%" align="center" valign="middle"><?php echo $route->depicao;?></td>
<td width="20%" align="center" valign="middle"><?php echo $route->arricao;?></td>
<td width="20%" align="center" valign="middle"><?php echo $route->aircraft;?></td>
<td width="20%" align="center" valign="middle"><img onmouseover="document.body.style.cursor='pointer';" onmouseout="document.body.style.cursor='default';" class="{button:{icons:{primary:'ui-icon-arrowthick-1-s'}}}" href="#" onclick="$('#details_dialog_<?php echo $route->flightnum;?>').toggle()" src="http://alvandair.com/lib/skins/aqua/images/BookingButt/Preview.png" border="0">

<?php
if($route->bidid != 0)
 {
 ?>
 <img src="http://alvandair.com/lib/skins/aqua/images/BookingButt/SwissBook.png" border="0">
 <?php
}
 else
{
?>
 <a id="<?php echo $route->id; ?>" class="addbid" href="<?php echo url('/schedules/addbid');?>"><img src="http://alvandair.com/lib/skins/aqua/images/BookingButt/BlueBook.png" border="0"></a>
 <?php				
 }
 ?>
</td>
</tr>
 <td colspan="5">

<table cellspacing="0" cellpadding="0" border="1" id="details_dialog_<?php echo $route->flightnum;?>" style="display:none" bgcolor="#ADDFFF" width="100%">

<tr>
<th align="center" bgcolor="#153E7E" colspan="4"><font color="white">Flight Briefing</font></th>
</tr>
<tr>
<td align="left">Origen:</td>
<td colspan="0" align="left" bgcolor="#ADDFFF"><b><?php echo "{$route->depname} ($route->depicao)"?></b></td>
<td align="left">Destino:</td>
<td colspan="0" align="left" bgcolor="#ADDFFF"><b><?php echo "{$route->arrname} ($route->arricao)"?></b></td>
</tr>
<tr>
<td align="left">Avión:</td>
<td colspan="0" align="left" bgcolor="#ADDFFF"><b><?php echo $route->aircraft; ?></b></td>
<td align="left">Distancia:</td>
<td colspan="0" align="left" bgcolor="#ADDFFF"><b><?php echo $route->distance . Config::Get('UNITS') ;?></b></td>
</tr>
<tr>
<td align="left">Hora de Salida:</td>
<td colspan="0" align="left" bgcolor="#ADDFFF"><b><?php echo $route->deptime?> GMT</b></td>
<td align="left">Hora de Llegada:</td>
<td colspan="0" align="left" bgcolor="#ADDFFF"><b><?php echo $route->arrtime?> GMT</b></td>
</tr>
<tr>
<td align="left">Altitud:</td>
<td colspan="0" align="left" bgcolor="#ADDFFF"><b><?php echo $route->flightlevel; ?> ft</b></td>
<td align="left">Duración:</td>
<td colspan="0" align="left" bgcolor="#ADDFFF"><b><?php echo $route->flighttime ;?> h</b></td>
</tr>
<tr>
<td align="left">Ruta:</td>
<td colspan="0" align="left" bgcolor="#ADDFFF"><b><?php echo $route->route; ?></b></td>
<td align="left">Precio del Billete:</td>
<td colspan="0" align="left" bgcolor="#ADDFFF"><b> $ <?php echo $route->price ;?>.00</b></td>
</tr>

<tr>
<th align="center" bgcolor="#153E7E" colspan="4"><font color="white">Cálculo del Combustible para el <?php echo $route->aircraft ;?></font></th>
</tr>
<?php
	 $fuelflowATR72 = 800;
$fuelhrATR72 = 2000;
$flholdingATR72 = 1000;
$fldiversionATR72 = 1500;
$flcontingencyATR72 = 200;
$fltaxiATR72= 500;







 if($route->aircraft == 'ATR 72-212')
	 {
	 $fuelflow = $fuelflowATR72;
	 $fuelhr = $fuelhrATR72;
$fltaxi = $fltaxiATR72;
$flholding = $flholdingATR72;
$fldiversion = $fldiversionATR72;
$flcontingency = $flcontingencyATR72;
	 }
	 elseif($route->aircraft == 'ATR 72-202')
	 {
	 $fuelflow = $fuelflowATR72;
	 $fuelhr = $fuelhrATR72;
$fltaxi = $fltaxiATR72;
$flholding = $flholdingATR72;
$fldiversion = $fldiversionATR72;
$flcontingency = $flcontingencyATR72;
	 }

 $fldis = $route->distance / 100;
$fuelnm = $fuelflow * $fldis;
$flndg = $fuelhr * 3/4;
$result = $fuelnm + $fltaxi + $flholding + $fldiversion;
 ?>
 <tr>
		 <td align="left" colspan="2">Combustible Requerido hasta el Destino:</td>
 <td align="left" colspan="2"><b><?php echo $fuelnm ;?> lbs</b></td>
 </tr>
 <tr>
 <td align="left" colspan="2">Combustible para el taxi y uso en tierra:</td>
 <td align="left" colspan="2"><b><?php echo $fltaxi ;?> lbs</b></td>
 </tr>
 <tr>
 <td align="left" colspan="2">Esperas:</td>
 <td align="left" colspan="2"><b><?php echo $flholding ;?> lbs</b></td>
 <tr>
 <td align="left" colspan="2">Desvíos:</td>
 <td align="left" colspan="2"><b><?php echo $fldiversion ;?> lbs</b></td>
 </tr>
 </tr>
 <tr>
 <td align="center" colspan="4"><font color="blue" size="4">Combustible para la Ruta:   <?php echo $result ;?> lbs</font></td>
 </tr>

</td>
</tr>
<tr>
<th align="center" bgcolor="#153E7E" colspan="4"><font color="white">Mapa del Vuelo</font></th>
</tr>
<tr>
<td width="100%" colspan="4">
<?php
$string = "";
				 $string = $string.$route->depicao.'+-+'.$route->arricao.',+';
				 ?>
				 <img width="100%" src="http://www.gcmap.com/map?P=<?php echo $string ?>&MS=bm&MR=240&MX=680x200&PM=pemr:diamond7:red%2b%22%25I%22:red&PC=%230000ff" />
</tr>
</td>
</table>
 </td>
</tr>

<?php
/* END OF ONE TABLE ROW */
}
?>
</tbody>
</table>

I want to see only planes there are in my current location and if I book a flight with the aircraft N5666 I can´t book a flight other flight with this plane.

I fought this code. It is realschedulite_index in the Aircrafts column the code what you can see the planes in this location.

$aircrafts = OperationsData::getAllAircraft('true');
$count = 0;
if(!$aircrafts)
{
 echo 'La aerolínea no tiene aviones!';
}
else
{
 foreach ($aircrafts as $aircraft)
 {
	 $location = RealScheduleLiteData::get_aircraft_location->arricao;
	 if(!$location)
	 {
		 $location = RealScheduleLiteData::get_aircraft_start($aircraft->id);
		 $airfield = $location->depicao;
	 }
	 else
	 {
		 $airfield = $location->arricao;
	 }
	 if ($airfield == $airport->icao)
	 {
		 if ($count == 0)
		 {
			 echo '| ';
		 }
		 echo ''.$aircraft->registration.' | ';
		 $count++;
	 }
 }
 if ($count == 0)
 {
	 echo '<font color="#6D7B8D"><i>No hay aviones disponibles</i></font>';
 }
 echo '</td>';
}

Any Ideas???

Please help me.

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