Jump to content

AFVA | Mitchell

Members
  • Posts

    143
  • Joined

  • Last visited

Posts posted by AFVA | Mitchell

  1. Thanks! Now I got it working,

    Next Question (sorry)

    Is it possible to get the last flight flown by that aircraft's PIREP id? Then I can just use GetReportDetails($pirepid) to get some more information.

    ^^

    What i mean is that can i get the last filed PIREP for that aircraft? Then get the PIREP id for it?

    Thanks in advance,

    Mitch

  2. This is my problem:

    I am working on my Fleet Table 1.1, I need total hours and flights etc. which is located in StatsData, and I need all the other aircraft info (registration, total pax, etc.) which is located in AircraftData to be in one. So I can use data from both in one single array.

    So eventually it should end up like this though, with it working

    $sql = Aircraft Data:Getallaircraft SQL stuff

    StatsData:AircraftUsage stuff

  3. Can anyone give me a quick explanation on how to combine 2 SQL codes together? I'm fine with HTML and PHP though I'm hopeless with SQL.

    What I'm Trying to Do:

    Combine:

    	public static function GetAllAircraft($onlyenabled=false)
    {
    	$sql = 'SELECT * 
    				FROM ' . TABLE_PREFIX .'aircraft';
    
    	if($onlyenabled == true)
    	{
    		$sql .= ' WHERE `enabled`=1 ';
    	}
    
    	$sql .= ' ORDER BY icao ASC';
    
    	return DB::get_results($sql);
    }

    and:

    	public static function AircraftUsage()
    {
    	$sql = 'SELECT a.name AS aircraft, a.registration, 
    				SEC_TO_TIME(SUM(TIME_TO_SEC(p.flighttime))) AS hours, 
    				COUNT(p.distance) AS distance
    			FROM '.TABLE_PREFIX.'pireps p
    				INNER JOIN '.TABLE_PREFIX.'aircraft a ON p.aircraft = a.id
    			GROUP BY p.aircraft';
    
    	return DB::get_results($sql);
    	return $ret;
    }

    And call it FleetInfo

    Can anyone help me?

    Thanks,

    Mitch

  4. "Powered by phpVMS":

    <p>Powered by <a href="http://phpvms.net">phpVMS></a></p>

    The navigation....seems a bit confusing but try this where the 'null' is:

       	[null, 'Home', './index.php', '_self', 'Home']
       	<?php 
    	if(Auth::LoggedIn() == true)
    	{ ?>
    	[null, 'Pilot Center', '.<?php echo url('profile');?>, '_self', 'Pilot Center']
    	} ?>
    	<?php 
    	if(Auth::LoggedIn() == false)
    	{ ?>
    	[null, 'Log In', '.<?php echo url('login');?>', '_self', 'Log In']
    	[null, 'Register', '.<?php echo url('registration');?>', '_self', 'Register']
    	<?php } ?>
    	[null, 'Pilots', '.<?php echo url('pilots');?>', '_self', 'Pilots']
    	[null, 'Live Map', '.<?php echo url('acars');?>', '_self', 'Live Map']
    	<?php
    	if(Auth::LoggedIn())
    	{
    	if(PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN))
    	{ ?>
    	[null, 'Admin Panel', '.<?php echo fileurl('/admin');?>', '_self', 'Admin Panel']	
    	<?php 
    	}
                    }
    	?>
    

    Good luck!

  5. How can I exactly implement the code?

    booking_form.tpl(yes thats 175 lines):

    <h1>Book a Flight</h1>
    <form name="booking_search" id="booking_search" action="<?php echo SITE_URL?>/index.php/booking/search">
    <br>
    <table>
    <thead>
    <th><p><b>Departing From: </b></p></th><th><p><b>Arriving At:</b></p></th>
    <thead>
    <tbody>
    <td>
    <select id="depicao" name="depicao">
    <option value="">--ORIGIN</option>
    <?php
    if(!$depairports) $depairports = array();
    foreach($depairports as $airport)
    {
    echo '<option value="'.$airport->icao.'">'.$airport->icao
    .' ('.$airport->name.')</option>';
    }
    ?>
    </select>
    </td>
    <td>
    	<select id="arricao" name="arricao">
    		<option value="">--DESTINATION</option>
    	<?php
    	if(!$depairports) $depairports = array();
    		foreach($depairports as $airport)
    		{
    			echo '<option value="'.$airport->icao.'">'.$airport->icao
    					.' ('.$airport->name.')</option>';
    		}
    	?>
    
    	</select>
    	</td>
    	</thead>
    	</table>
    	<hr>
    	<table border="1">
    	<thead>
    	<th><b>Adults (13+)</b></th><th><b>Children (2-12)</b></th><th><b><b><a href="#" onclick="showhide('policy'); return(false);">Under 2 Policy</a></b></th>
    	</thead>
    	<tbody>
    	<td>
    	<center>
    	<select id="adults" name="adults">
    	<option value="1">1</option>
    	<option value="2">2</option>
    	<option value="3">3</option>
    	<option value="4">4</option>
    	<option value="5">5</option>
    	<option value="6">6</option>
    	<option value="7">7</option>
    	<option value="8">8</option>
    	</select>
    	</center>
    	</td>
    	<td>
    	<center>
    	<select name="children" id="children">
        <option value="0">0</option>
    	<option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
        <option value="4">4</option>
        <option value="5">5</option>
        <option value="6">6</option>
        <option value="7">7</option>
        <option value="8">8</option>
        </select>
        </center>
        </td>
        <td>
        <div style="display: none;" id="policy">
        <p>When flying on our airline with a baby under the age of two, we ask you bring a Baby Car Seat.<br>
    	Please Contact Booking Staff at admin@vhmrw.site90.com for Further Information.
    	</p>
        </div>
        </td>
        </tbody>
        </table>
    	<hr>
    	<table>
    	<thead>
    	<th><p><b>Departure Date:</b></p></th><th><p><b>Arrival Date(Only If Return Flight):</b></p></th>
    	</thead>
    	<tbody>
    	<td>
    	<select id="depmonth" name="depmonth">
    	<option value="dec09">December 2009</option>
    	<option value="jan10">January 2010</option>
    	<option value="feb10">Febuary 2010</option>
    	<option value="mar10">March 2010</option>
    	</select>
    	<select id="depday" name="depday">
    <option value="01">01</option>
    <option value="02">02</option>
    <option value="03">03</option>
    <option value="04">04</option>
    <option value="05">05</option>
    <option value="06">06</option>
    <option value="07">07</option>
    <option value="08">08</option>
    <option value="09">09</option>
    <option value="10">10</option>
    <option value="11">11</option>
    <option value="12">12</option>
    <option value="13">13</option>
    <option value="14">14</option>
    <option value="15">15</option>
    <option value="16">16</option>
    <option value="17">17</option>
    <option value="18">18</option>
    <option value="19">19</option>
    <option value="20">20</option>
    <option value="21">21</option>
    <option value="22">22</option>
    <option value="23">23</option>
    <option value="24">24</option>
    <option value="25">25</option>
    <option value="26">26</option>
    <option value="27">27</option>
    <option value="28">28</option>
    <option value="29">29</option>
    <option value="30">30</option>
    <option value="31">31</option>
      </select>
      		</td>
    			<td>
    	<select id="arrmonth" name="arrmonth">
    	<option value="dec09">December 2009</option>
    	<option value="jan10">January 2010</option>
    	<option value="feb10">Febuary 2010</option>
    	<option value="mar10">March 2010</option>
    	</select>
    	<select id="arrday" name="arrday">
    <option value="01">01</option>
    <option value="02">02</option>
    <option value="03">03</option>
    <option value="04">04</option>
    <option value="05">05</option>
    <option value="06">06</option>
    <option value="07">07</option>
    <option value="08">08</option>
    <option value="09">09</option>
    <option value="10">10</option>
    <option value="11">11</option>
    <option value="12">12</option>
    <option value="13">13</option>
    <option value="14">14</option>
    <option value="15">15</option>
    <option value="16">16</option>
    <option value="17">17</option>
    <option value="18">18</option>
    <option value="19">19</option>
    <option value="20">20</option>
    <option value="21">21</option>
    <option value="22">22</option>
    <option value="23">23</option>
    <option value="24">24</option>
    <option value="25">25</option>
    <option value="26">26</option>
    <option value="27">27</option>
    <option value="28">28</option>
    <option value="29">29</option>
    <option value="30">30</option>
    <option value="31">31</option>
      </select>
      </td>
    	</tbody>
    	</table>
    	<hr>
    	<input type="submit" name="submit" value="GO!">
    
    	</form>
    

    Booking.php:

    <?php
    
    class Booking extends CodonModule
    
    {
    
    	public function index()
    	{
    	$depapts = OperationsData::GetAllAirports();
    
    	Template::Set('depairports', $depapts);
    	Template::Show('booking_form.tpl');
    
    	}
    	public function search()
    	{
    
    	$params = array(
    	's.depicao' => array ('$this->post->depicao'),
    	's.arricao' => array ('$this->post->arricao'),
    	's.enabled' => 1,
    	);
    
    	$schedules = SchedulesData::findSchedules($params);
    
    
    	Template::Set('allresults', $schedules);
    	Template::Show('booking_results.tpl');
    
    	}
    	public function results()
    	{
    	                       
    	Template::Set('allresults', $schedules);
    	Template::Show('booking_results.tpl');
    
    	}
    	public function confirm()
    	{
    
    	Template::Show('booking_confirm.tpl');
    
    	}
    
    }
    
    ?>
    

    When I search it gives me this error:

    Warning: Invalid argument supplied for foreach() in /home/a5059087/public_html/core/templates/booking_results.tpl on line 13

    Can anyone help me?

  6. I am currently working on a passenger flight booking feature.

    How can I make a search which has a function to search by both departure and arrival airports, and not just one like the one in schedule search.

    Pages(under construction):

    Search: http://www.vhmrw.site90.com/index.php/booking

    Results of Search: http://www.vhmrw.site90.com/index.php/booking/results

    Confirmation: http://www.vhmrw.site90.com/index.php/booking/confirm

    Also I need to know how to send values (like the amount of adults/children) a user added to the confirm and results page.

    Thanks,

    Mitchell Williamson

  7. Version 1.0 Outdated

    A table which contains your full fleet information.

    Preview: http://www.vhmrw.site90.com/index.php/fleet

    1. Add the folder 'Fleet' to your core/modules folder

    2. Add fleet_main.tpl to your coretemplate folder

    3. Go to: www.yourvmssite.com/index.php/fleet

    (Replacing www.yourvmssite.com with your site URL of course)

    Download Link: http://downloads.vhmrw.site90.com/Fleet%20Module.zip

    (only download link as earlier version)

    ------------------------------------------------------------------------------------------

    Version 1.1  Released

    1.1 Features:

    All previous 1.0 information

    Total Hours

    Total Flights

    Custom SQL (FleetInfo)

    1.1 Will come with a very large table. To things you don't want:

    1. Go to the thead section

    2. Find the name of the thing you want to delete

    3. Delete this: <td><b>Whatever</b></td>

    4. Go to the tbody section

    5. Do the same

    Preview of 1.1: http://vhmrw.site90.com/index.php/fleetta

    Download attached.

    ------------------------------------------------------------------------------------------

    Feedback appreciated,

    Mitchell Williamson

    FleetTable1.1FIXED.zip

    • Like 3
  8. The module tutorial I would hold off and re-do it with the new format for the next version.

    Made it private.

    $data = ACARSData::GetACARSData($cutofftime=120);
    
    // it's just:
    $data = ACARSData::GetACARSData(120);
    

    That's in line with the PHP standards, it would be best to stay with that. There's alot of beginners too, wouldn't want them learning the wrong thing at first :)

    Fixed up in annotation :)

×
×
  • Create New...