Jump to content

Nuclear

Members
  • Posts

    48
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling
  • Location
    Chicago

Nuclear's Achievements

Newbie

Newbie (1/14)

8

Reputation

  1. Nuclear

    Email problem

    Try: <?php echo $pilot->pilotid ?>
  2. I think that's probably good advice. I've had problems in the past with the editor in cPanel losing or otherwise maiming text. The best practice is to download the file to your local computer, edit it (preferable with something like Notepad++), and re-upload to the server.
  3. Oops. It should be: $bids=SchedulesData::getBids(Auth::PilotID()); That's what I get for posting when I first wake up
  4. Something like this should work (note: untested): <?php $bids=getBids(Auth::PilotID()); if($bids) { foreach($bids as $bid) { echo $bid->code.$bid->flightnum.' - '.$bid->depicao.' - '.$bid->arricao.'<br />'; } } else { echo 'You have not bid on any flights.'; }?>
  5. In local.config in the 'core' directory: define('DBASE_USER', 'xxx'); define('DBASE_PASS', 'xxx'); define('DBASE_NAME', 'xxx');
  6. The SQL is in the getAllAirlines() function in OperationsData.class: if($all_airlines === false) { $sql = 'SELECT * FROM ' . TABLE_PREFIX ."airlines $where} ORDER BY `code` ASC"; $all_airlines= DB::get_results($sql); CodonCache::write($key, $all_airlines, 'long'); } You could change the ORDER BY clause, but I don't know if that might break something somewhere else.
  7. In any language I've ever used, manipulating dates, times, datetimes...always is a big pain I'm no expert in PHP, but unless DATE_FORMAT is some PHP constant (which it could be, for all I know) then you need to actually enter the format that you want as a string. The PHP reference for the date function is here. An example: <li><strong>Date Joined: </strong><?php echo date('F j', strtotime($pilotinfo->joindate));?></li> will display the date as 'Month Day' like 'April 19'.
  8. Just as an additional note: I would suggest not using Notepad or Wordpad to edit PHP files. Over the years, I've found that they can do some strange things, like adding extra formatting characters which are not readily visible. I suggest using something specifically made for editing source code. I personally use Notepad++. Not only does it not jack up the formatting, it includes such things as syntax highlighting and auto-indent, which makes editing and writing code much easier .
  9. $queryP="SELECT SUM(`load`) as totalpax FROM `phpvms_pireps` WHERE `flighttype`='P'"; $resultP=DB::get_results($queryP); $queryH="SELECT SUM(`load`) as totalpax FROM `phpvms_pireps` WHERE `flighttype`='H'"; $resultH=DB::get_results($queryH); $total=$resultH[0]->totalpax + $resultP[0]->totalpax; echo $total I don't remember what you were doing with this, but if you're not using the results for anything but just to get the totals, you can eliminate one of the queries: $query="SELECT SUM(`load`) as totalpax FROM `phpvms_pireps` WHERE `flighttype`='P' OR `flighttype`='H'"; $result=DB::get_results($query); $total=$result[0]->totalpax;
  10. Yes, you could use a series of if statements: <?php echo 'Flight Type: '; if($route->flighttype=='P') echo 'Passenger<br />'; elseif($route-flighttype=='C') echo 'Cargo<br />'; ...?> You can also use a switch statement: <?php echo 'Flight Type: '; switch($route->flighttype) { case 'C': echo 'Cargo<br />'; break; case 'P': echo 'Passenger<br />'; break; ... }?>
  11. Can you post the exact code you're using? The cache shouldn't make a difference; the code I posted is a direct SQL query, which is not cached, unlike the API calls, which do utilize caching. My way is not necessarily better, in fact it's worse in several ways, but it is one way to get the results.
  12. Nuclear

    Timetable

    Dresdenair and twincessna, sorry about that. I apparently uploaded the wrong version of timetable.tpl in the original zip file. I've updated the download in the original post. The only changes are to timetable.tpl. Let me know if this works now, thanks.
  13. Nuclear

    Timetable

    Yes, putting it on your front page is problematic, since it tends to be fairly long. I suggest you create a link, this will render it in it's own page.
  14. Nuclear

    Timetable

    Yes, Tom. Looking at Simpilot's add-on, it's very similar. I wrote this completely unaware of his contribution at the time, if that's what you're implying.
  15. Nabeel, is of course right, but I do have a question: I understand the API exists to deal with most everything. but what's the problem with using raw SQL? Beside the fact that it's raw SQL? I do get it, but I find it much easier to use raw SQL (assuming that there isn't an API call for it...)
×
×
  • Create New...