Jump to content

Alex

Members
  • Posts

    145
  • Joined

  • Last visited

Everything posted by Alex

  1. Thanks Dave, I entered that into schdules.php but got a syntax error, i changed it slightly and now have the form popluated with all the airlines, so thats sorted, however when selecting an individual airline, it just returns ALL flights from ALL airlines, so the actual search funtion for each airline isn't working. Heres what i changed the schedules.php to. public function showSchedules() { $depapts = OperationsData::GetAllAirports(); $equip = OperationsData::GetAllAircraftSearchList(true); $airline = OperationsData::GetAllAirlines(); $this->set('allairlines', $airline); $this->set('depairports', $depapts); $this->set('equipment', $equip); $this->render('schedule_searchform.tpl'); and heres what i have in search_schedules.tpl <div id="airlinetab"> <p>Select Required 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->code.'" '.$sel.'>'.$airline->code.' - '.$airline->name.'</option>'; } ?> </select> <input type="submit" name="submit" value="Find Flights" /> </div> do i need to add something like this into the public function findflight() if($this->post->s.code != '') { $params = array('s.code' => $this->post->airline); } or Do i need to add anything to scheduledata.class.php ?
  2. Out of my depth i think. i looked into the module/schedules/shedules.php which gives this. PASTEBIN AND IN THE SCHEDULESDATA.CLASS.PHP PASTEBIN apols for quoting all the codes, im assuming that the schedules search uses these templates etc.
  3. thanks Nabeel. i tried this. <div id="airlinetab"> <p>Select Required Airline:</p> <select id="allairlines" name="airline"> <option value="">Select Airline</option> <?php if (!$airline) $airline = array(); foreach($allairlines as $airline) { echo '<option value="'.$airline.'">'.$airline .' ('.$airline->name.')</option>'; } ?> </select> <input type="submit" name="submit" value="Find Flights" /> </div > but it doesnt grab any of my airlines at all. All i get in the drop down is "select Airline". I tried to copy the same way that is used to select departure airport etc.
  4. I have three airlines in my VA, AVA,AVC and AVE, i'm trying to search for only schedules by each of them using this code, but i cant get it to work and i'm kinda tying myself up losing where i'm at. I know its fairly simple but i'm passed that stage. i'm editing the schedule_search.tpl <div id="airlinetab"> <p>Select Required Airline:</p> <select id="allairlines" name="airline"> <option value="">Select Airline</option> <?php if (!$allairlines) $allairlines = array(); foreach($allairlines as $allairlines) { echo '<option value="'.$allairlines.'">'.$allairlines .' ('.$allairlines->name.')</option>'; } ?> </select> <input type="submit" name="submit" value="Find Flights" /> </div> I have seen daves add on, however i could not get it to display the aircraft selection properly. i just kept getting Airport Icao's when i tried to search by aircraft. (i changed in frontscheduledata.class line 38 $query = "SELECT DISTINCT icao to $query = "SELECT DISTINCT name but now i get an error poining to this line in the frontschedlue.php of daves addon foreach($aircrafts as $aircraft) ) any pointers to where i'm going wrong? Thanks Alex
  5. Dave, i have had the exams running succesfully for several months now, however it appears that pilots who have insufficient funds to pay for the exams are still able to make the request for an exam they cannot afford? looking at exam_purchase_confirm.tpl shows this. <?php //simpilotgroup addon module for phpVMS virtual airline system // //simpilotgroup addon modules are licenced under the following license: //Creative Commons Attribution Non-commercial Share Alike (by-nc-sa) //To view full icense text visit http://creativecommons.org/licenses/by-nc-sa/3.0/ // //@author David Clark (simpilot) //@copyright Copyright (c) 2009-2010, David Clark //@license http://creativecommons.org/licenses/by-nc-sa/3.0/ ?> <style type="text/css"> <!-- .style1 {color: #FF0000} --> </style> <center> <div id="error"> <p>You currently have <b>$<?php echo $pilotmoney ?></b> in your account.<br /> Purchasing the <b><?php echo $examdescription ?></b> exam will deduct <b>$<?php echo $examcost ?></b> from your account.<br /> If you do not pass the test you will have to re-purchase the exam again</p> <p><span class="style1">(Do not click yes more than once or refresh or you will be charged twice!!)</span><br /> Continue - <a href="<?php echo SITE_URL ?>/index.php/Exams"><b>NO</b></a> | <a href="<?php echo SITE_URL ?>/index.php/Exams/purchase_exam?id=<?php echo $examid ?>"><b>YES</b></a> </p> </div> exam_purchase_confirm.tpl </center> Is this a bug, or have i missed checking something? If possible could i have a snippet to display "you have insufficient funds to purchase this exam" Thanks Alex
  6. here is the flight board i'm using.I am using obsessblue skin, you may need to add the font colour to you stylesheet.css in this example. the code in frontpage.tpl placed where you want the table to show. <?php # # $query = "SELECT * FROM phpvms_schedules ORDER BY deptime + 0 ASC"; # $list = DB::get_results($query); # echo '<h3>Expected Departures - Current Time is '.date('G:i').'</h3>'; # echo '<table width="90%" border="1" bgcolor="#030A0A" >'; # echo '<tr><td><b>Flight Number</b></td><td><b>Departure</b></td><td><b>Arrival</b></td><td><b>Departure Time</b></td><td><b>Aircraft</b></td><td><b>Status</b></td></tr>'; # $count = 0; # foreach($list as $flight) { # if(date('G:i') >= '23') { # $time = '0'; # } # else { # $time = date('G:i'); # } # if(($flight->deptime + 0) >= $time) { # if($count < 5) { # $aircraft = OperationsData::getAircraftInfo($flight->aircraft); $depname = OperationsData::RetrieveAirportInfo($flight->depicao); $arrname = OperationsData::RetrieveAirportInfo($flight->arricao); # echo '<tr><td>'.$flight->flightnum.'</td><td>'.$depname->name.'</td><td>'.$arrname->name.'</td><td>'.$flight->deptime.'</td><td>'.$aircraft->fullname.'</td>'; # echo '<td>'; # $minutes = explode(':', $flight->deptime); # if($minutes['0'] <= date('G')) { # if(($minutes['1'] - date('i')) <= 0) { # echo 'Departed'; # } # elseif(($minutes['1'] - date('i')) <= 15 && ($minutes['1'] - date('i')) >= 1) { # echo 'Final Call'; # } # elseif(($minutes['1'] - date('i')) >= 30 && ($minutes['1'] - date('i')) <= 20) { # echo 'Proceed to Gate'; # } # else { # echo 'Scheduled Departure'; # } # } # else { # echo 'Scheduled Departure'; # } # echo '</td></tr>'; # $count++; # } # } # } # echo '</table>'; # # echo '<h3>Expected Arrivals - Current Time is '.date('G:i').'</h3>'; # echo '<table width="90%" border="1" bgcolor="#030A0A" >'; # echo '<tr><td><b>Flight Number</b></td><td><b>Departure</b></td><td><b>Arrival</b></td><td><b>Arrival Time</b></td><td><b>Aircraft</b></td><td><b>Status</b></td></tr>'; # $count = 0; # foreach($list as $flight) { # if(date('G:i') >= '23') { # $time = '0'; # } # else { # $time = date('G:i'); # } # if(($flight->arrtime + 0) >= $time) { # if($count < 5) { # $aircraft = OperationsData::getAircraftInfo($flight->aircraft); $depname = OperationsData::RetrieveAirportInfo($flight->depicao); $arrname = OperationsData::RetrieveAirportInfo($flight->arricao); # echo '<tr><td>'.$flight->flightnum.'</td><td>'.$depname->name.'</td><td>'.$arrname->name.'</td><td>'.$flight->arrtime.'</td><td>'.$aircraft->fullname.'</td>'; # echo '<td>'; # $minutes2 = explode(':', $flight->arrtime); # if($minutes2['0'] <= date('G')) { # if($minutes2['1'] - (date('i')) >= 30) { # echo 'On Time'; # } # elseif(($minutes2['1'] - date('i')) >= 1 && ($minutes2['1'] - date('i')) <= 30) { # echo 'On Approach'; # } # else { # echo 'Landed'; # } # # } # else { # echo 'On Time'; # } # echo '</td></tr>'; # $count++; # } # } # } # echo '</table>'; $flights = PIREPData::getRecentReportsByCount(10); $string = ""; foreach($flights as $flight) { $string = $string.$flight->depicao.'+-+'.$flight->arricao.',+'; } ?> the text color change in stylesheet.css .mc020301 { font-size: 12px; color: #FFC600; line-height: 18px; letter-spacing: -0.1px; width: 700px; ideally i always set up a duplicate site for development purposes.
  7. For some reason it appears i can only have two airlines. i have had two for some time now, when i go to add another airline, i enable it and it states "airline added succesfully" however it does not display the new airline. if i look for the airline when wanting to add a schedule to it, the airline i just added isnt there either. checking the database DOES show the new airline has been added to it. I tried clearing the cache but to no avail. running v930 any ideas??????
  8. i seem to be able to even get delayed flights for some reason?? check the top and bottom rows!!
  9. THANKS DAVE. looks like we were a million miles away and needed rescueing!!! Works a treat.
  10. Maybe the time actually need to be decimalized, so that 15 mins would be 0.25 rather than 1/60*15. I'll try later. Its bloody annoying this isn't it.
  11. I'm not at my normal PC at the moment but after doing some searching i will try something like this later when i get home. if(($flight->deptime - date('G:i')) <= 1 / 60 * 15) { echo 'Final Call'; } if(($flight->deptime - date('G:i')) >= 1/60*15 && $flight->deptime - date('G:i') <=1) { echo 'Proceed to Gate'; } if(($flight->deptime - date('G:i')) >= 1) { echo 'Scheduled to Depart On time'; } If anyone has any comments before i try it feel free.
  12. Just wondering if the "elseif" command would work to get the exra "landed" or "holding" string?
  13. heres "some" progress but you can see the error from the image. heres my relevant code. $query = "SELECT * FROM phpvms_schedules ORDER BY deptime + 0 ASC"; $list = DB::get_results($query); echo '<h3>Expected Departures - Current Time is '.date('G:i').'</h3>'; echo '<table width="90%" border="1">'; echo '<tr><td><b>Flight Number</b></td><td><b>Departure</b></td><td><b>Arrival</b></td><td><b>Departure Time</b></td><td><b>Aircraft</b></td><td><b>Status</b></td></tr>'; $count = 0; foreach($list as $flight) { if(date('G:i') >= '23') {$time = '0';} else {$time = date('G:i');} if(($flight->deptime + 0) > $time) { if($count < 5) { $aircraft = OperationsData::getAircraftInfo($flight->aircraft); echo '<tr><td>'.$flight->flightnum.'</td><td>'.$flight->depicao.'</td><td>'.$flight->arricao.'</td><td>'.$flight->deptime.'</td><td>'.$aircraft->fullname.'</td>'; echo '<td>'; if(($flight->deptime - date('G:i')) <= 1 / 60 * 15) { echo 'Final Call'; } if(($flight->deptime - date('G:i')) <= 1) { echo 'Proceed to Gate'; } else { echo 'Scheduled Departure'; } echo '</td></tr>'; $count++; } } } echo '</table>'; echo '<h3>Expected Arrivals - Current Time is '.date('G:i').'</h3>'; echo '<table width="90%" border="1">'; echo '<tr><td><b>Flight Number</b></td><td><b>Departure</b></td><td><b>Arrival</b></td><td><b>Arrival Time</b></td><td><b>Aircraft</b></td><td><b>Status</b></td></tr>'; $count = 0; foreach($list as $flight) { if(date('G:i') >= '23') {$time = '0';} else {$time = date('G:i');} if(($flight->arrtime + 0) > $time) { if($count < 5) { $aircraft = OperationsData::getAircraftInfo($flight->aircraft); echo '<tr><td>'.$flight->flightnum.'</td><td>'.$flight->depicao.'</td><td>'.$flight->arricao.'</td><td>'.$flight->arrtime.'</td><td>'.$aircraft->fullname.'</td>'; echo '<td>'; if(($flight->arrtime - date('G:i')) <= 1 / 60 * 1) { echo 'Landed'; } if(($flight->arrtime - date('G:i')) <= 1 / 60 * 15) { echo 'On Approach'; } else { echo 'On Time'; } echo '</td></tr>'; $count++; } } } echo '</table>'; you can see that the final call and proceed to gate messages are displayed at the same time as does landed and on approach?
  14. I wonder if Nabeel or Simpilot could provide some pointers as to what the correct code should be?
  15. Just in relation to the Flight Board. Would it be possible to have a column showing if that particular departure was bid on and by whom,If it has not been bid on then a simple "add to bids" link.That way if a pilot has a limited time schedule he can instantly see if within say the next hour any flights are available?
  16. This one, just added the <=1/60*15 bits $query = "SELECT * FROM phpvms_schedules ORDER BY deptime + 0 ASC"; $list = DB::get_results($query); echo '<h3>Upcoming Departures - Current Time is '.date('G:i').'</h3>'; echo '<table width="80%" border="0">'; echo '<tr><td><b>Flight Number</b></td><td><b>Departure</b></td><td><b>Arrival</b></td><td><b>Departure Time</b></td><td><b>Aircraft</b></td><td><b>Status</b></td></tr>'; $count = 0; foreach($list as $flight) { if(date('G:i') >= '23') {$time = '0';} else {$time = date('G:i');} if(($flight->deptime + 0) > $time) { if($count < 10) { $aircraft = OperationsData::getAircraftInfo($flight->aircraft); echo '<tr><td>'.$flight->flightnum.'</td><td>'.$flight->depicao.'</td><td>'.$flight->arricao.'</td><td>'.$flight->deptime.'</td><td>'.$aircraft->fullname.'</td>'; echo '<td>'; if(($flight->deptime - date('G:i')) <= 1) { echo 'Now Boarding'; } else { echo 'Scheduled Departure'; } echo '</td></tr>'; $count++; } } } echo '</table>'; echo '<h3>Upcoming Arrivals - Current Time is '.date('G:i').'</h3>'; echo '<table width="80%" border="0">'; echo '<tr><td><b>Flight Number</b></td><td><b>Departure</b></td><td><b>Arrival</b></td><td><b>Arrival Time</b></td><td><b>Aircraft</b></td><td><b>Status</b></td></tr>'; $count = 0; foreach($list as $flight) { if(date('G:i') >= '23') {$time = '0';} else {$time = date('G:i');} if(($flight->arrtime + 0) > $time) { if($count < 10) { $aircraft = OperationsData::getAircraftInfo($flight->aircraft); echo '<tr><td>'.$flight->flightnum.'</td><td>'.$flight->depicao.'</td><td>'.$flight->arricao.'</td><td>'.$flight->arrtime.'</td><td>'.$aircraft->fullname.'</td>'; echo '<td>'; if(($flight->arrtime - date('G:i')) <= 1) { echo 'Arriving Soon'; } else { echo 'On Time'; } echo '</td></tr>'; $count++; } } } echo '</table>';
  17. hmmm, looking at this, it seems that whenever my clock reaches the hour mark the flight board automatically shows the next hour. eg. time = 1800hrs the board shows all schedules in the 1900 - 2000hrs bracket. time = 1900hrs the board shows all schedules in the 2000 - 2100hrs bracket. so my code from above does not appear to be working. apologies. maybe simpilot can provide the correct coding?
  18. You need to contact your host administrator who will set your php time clock to your time zone. my host is in the US but i'm in the UK so initially i was +5hrs now im set to GMT on my host server. to break it down into minutes i used: if(($flight->arrtime - date('G:i')) <= 1 / 60 * 15) { echo 'On Long Finals'; It seems to work fine displaying "on Long finals" when 15 minutes out HTH Alex
  19. I have a simple custom pirep field, a drop down yes/no box which asks if the flight is a charter rather than a scheduled flight. I was wondering how i could add some code to find the ratio between the the accepted pireps to display in the flight stats admin side? ie 60% scheduled, 40% charter.
  20. That did the trick, thanks Jeff.
  21. after some gremlins in my system i'm trying to get the arrival and departure airport plans to display on the schedules briefing template. I'm using this code, (as from this topic, but all i can get displayed is the link to the chart,(which works fine). I actually want the image to display rather than the link. I know the chart link in the admin side of things is filled correctly, but does this need to be left blank? <table width="98%" align="center"> <tr style="background-color: #333; color: #FFF;"> <td>Charts for <?php echo $schedule->depicao?></td> <td>Charts for <?php echo $schedule->arricao?></td> </tr> <tr align="center"> <td width="50%" valign="top"> <a href="<?php $data = OperationsData::GetAirportInfo($schedule->depicao); echo $data->chartlink; ?>" target="_blank"> <img border="0" src="http://www.atlasvirtualairlines.com/images/charts/<?php echo $schedule->depicao?>.png" width="387px" height="594px" alt="View Charts" /></a> </td> <td width="50%" valign="top"> <a href="<?php $data = OperationsData::GetAirportInfo($schedule->arricao); echo $data->chartlink; ?>" target="_blank"> <img border="0" src="http://www.atlasvirtualairlines.com/images/charts/<?php echo $schedule->arricao?>.png" width="387px" height="594px" alt="View Charts" /></a>
  22. Ah, right i'll have a look at upgrading. I'm just frightened of doing it as i had a nightmare last time, mainly of my own doing not copying templates from core to skins really. Was there a specific template that had the bug?
  23. I have been trying to add a custom pirep field from the admin side. I can create the field with a text area. The field is called Tracker URL with a blank text area to insert a url. I already have one custom field called "unscheduled flight" which is a simple drop down box with yes,no. Once i have added the second "tracker URL" field all looks fine in the admin side, however when i go to the user side and try to file a pirep. I get ONE custom field which is a mix of my two fields ie a field name of "Unscheduled flight" and a text area. I am on .930 I have tried searching on custom pirep fields but have not found anything similar to this yet? Alex
  24. Dave, Would this allow one pilot to do part of the loop, such as KBOS-KATL in your example, and then allow a second pilot to finish the loop, such as KLAX-KATL-KDEN in your example? flight 1 - KBOS - KATL flight 2 - KATL - KDEN flight 3 - KDEN - KORD flight 4 - KORD - KBOS or is the entire loop of flights bid on by the first pilot? Cheers Alex
  25. That did the trick, Thanks Nabeel for your help.
×
×
  • Create New...