Jump to content

James142

Members
  • Posts

    656
  • Joined

  • Last visited

Everything posted by James142

  1. Haha no problem
  2. Oh dear
  3. Folt? lol yeah I meant to say font
  4. (sorry for butting in) But maybe change the folt? For example: http://www.freshjetvirtual.com/index.php/PopUpNews/popupnewsitem/?itemid=27 maybe change the font/color of the text "Congratulations Yanick Techer!" ?
  5. Stuart, I have tried using that one but you need to have 2x the % in the <em style="left:<%=flight.percomplete%>px">. So if the flight was 50% completed, the px would have to be 100px.SO to use that one, you would have to add $multiply = 2; $total = '.percomplete.'; $totalpx = $total * ($multiply); into acars.php then use <dd> <span><em style="left:<%=flight.totalpx%>px"><%=flight.percomplete%></em></span> </dd> EDIT: Ok ignore my post, Stuart just changed his
  6. I don't know why but that just made me laugh
  7. Heres mine: <?php /** * phpVMS - Virtual Airline Administration Software * Copyright (c) 2008 Nabeel Shahzad * For more information, visit www.phpvms.net * Forums: http://www.phpvms.net/forum * Documentation: http://www.phpvms.net/docs * * phpVMS is licenced under the following license: * Creative Commons Attribution Non-commercial Share Alike (by-nc-sa) * View license.txt in the root, or visit http://creativecommons.org/licenses/by-nc-sa/3.0/ * * @author Nabeel Shahzad * @copyright Copyright (c) 2008, Nabeel Shahzad * @link http://www.phpvms.net * @license http://creativecommons.org/licenses/by-nc-sa/3.0/ */ class ACARS extends CodonModule { public $title = 'ACARS'; public $acarsflights; public function index() { $this->viewmap(); } public function viewmap() { $this->title = 'ACARS Map'; $this->set('acarsdata', ACARSData::GetACARSData()); $this->render('acarsmap.tpl'); } /** * We didn't list a function for each ACARS client, * so call this, which will include the acars peice in */ public function __call($name, $args) { $acars_action = $args[0]; // clean the name... $name = preg_replace("/[^a-z0-9-]/", "", strtolower($name)); if(dirname(__FILE__).DS.$name.'.php') { include_once dirname(__FILE__).DS.$name.'.php'; return; } } public function data() { $flights = ACARSData::GetACARSData(); if(!$flights) $flights = array(); $this->acarsflights = array(); foreach($flights as $flight) { if($flight->route == '') { $flight->route_details = array(); } else { $flight->route_details = NavData::parseRoute($flight->route); } $c = (array) $flight; // Convert the object to an array $c['pilotid'] = PilotData::GetPilotCode($c['code'], $c['pilotid']); $totaldistance = round(SchedulesData::distanceBetweenPoints($flight->deplat, $flight->deplng, $flight->arrlat, $flight->arrlng)); $percomplete = ABS(number_format(((($totaldistance - $flight->distremain) / $totaldistance) * 100), 2)); $c['percomplete'] = $percomplete; // Normalize the data if($c['timeremaining'] == '') { $c['timeremaining'] == '-'; } if(trim($c['phasedetail']) == '') { $c['phasedetail'] = 'Enroute'; } /* If no heading was passed via ACARS app then calculate it This should probably move to inside the ACARSData function, so then the heading is always there for no matter what the calcuation is */ if($flight->heading == '') { /* Calculate an angle based on current coords and the destination coordinates */ $flight->heading = intval(atan2(($flight->lat - $flight->arrlat), ($flight->lng - $flight->arrlng)) * 180 / 3.14); //$flight->heading *= intval(180/3.14159); if(($flight->lng - $flight->arrlng) < 0) { $flight->heading += 180; } if($flight->heading < 0) { $flight->heading += 360; } } // Little one-off fixes to normalize data $c['distremaining'] = $c['distremain']; $c['pilotname'] = $c['firstname'] . ' ' . $c['lastname']; unset($c['messagelog']); $this->acarsflights[] = $c; continue; } CodonEvent::Dispatch('refresh_acars', 'ACARS'); echo json_encode($this->acarsflights); } public function routeinfo() { if($this->get->depicao == '' || $this->get->arricao == '') return; $depinfo = OperationsData::GetAirportInfo($this->get->depicao); if(!$depinfo) { $depinfo = OperationsData::RetrieveAirportInfo($this->get->depicao); } $arrinfo = OperationsData::GetAirportInfo($this->get->arricao); if(!$arrinfo) { $arrinfo = OperationsData::RetrieveAirportInfo($this->get->arricao); } // Convert to json format $c = array(); $c['depapt'] = (array) $depinfo; $c['arrapt'] = (array) $arrinfo; echo json_encode($c); } public function fsacarsconfig() { $this->write_config('fsacars_config.tpl', Auth::$userinfo->code.'.ini'); } public function fspaxconfig() { $this->write_config('fspax_config.tpl', Auth::$userinfo->code.'_config.cfg'); } public function xacarsconfig() { $this->write_config('xacars_config.tpl', 'xacars.ini'); } /** * Write out a config file to the user, give the template name and * the filename to save the template as to the user * * @param mixed $template_name Template to use for config (fspax_config.tpl) * @param mixed $save_as File to save as (xacars.ini) * @return mixed Nothing, sends the file to the user * */ public function write_config($template_name, $save_as) { if(!Auth::LoggedIn()) { echo 'You are not logged in!'; break; } $this->set('pilotcode', PilotData::GetPilotCode(Auth::$userinfo->code, Auth::$userinfo->pilotid)); $this->set('userinfo', Auth::$userinfo); $acars_config = Template::GetTemplate($template_name, true); $acars_config = str_replace("\n", "\r\n", $acars_config); Util::downloadFile($acars_config, $save_as); } }
  8. Thanks
  9. Put the above code in your acars.php file (core/modules/acars) then put <%=flight.percomplete%> in your acarsmap.tpl file (core/templates)
  10. Its there. Scroll up
  11. Ok, I shall have a go with that tomorrow. Thanks Tom
  12. Thats 100% true
  13. Hello. Would anyone here know how to do delete a row from a MySQL database after a certain date? so lets say someone puts in 11/12/2012 in a form text-box and is sent to a table in a MySQL database, when the date 11/12/2012 comes, the row in the MySQL database will delete? Any help will be much appreciated! Regards, James
  14. Why not make it show up on their first visit then have it redirect to the main site on their second?
  15. action failed: you have reached your quota of positive votes for the day D: I'll do it tomorrow
  16. Haha thanks
  17. I love that start page! But maybe add a-bit more color too it? There is a lot of white. Just my opinion though. Other than that you have a very professional site there
  18. Sorry guys that was me, I tried to give you both +1 but for some reason I hit the -1 by mistake. I gave you both +1 in your second posts though Again sorry about that
  19. Finally! Thanks
  20. ACTUALLY, I might have cracked it! Give me 2 days
  21. Unfortunately I will be unable to finish this project. I have managed to make the form and make it send the information to the MySQL database. But I am unable to make the MySQL database to delete the row after the absence dates has passed and make the information show in the admin panel and some other stuff. Hopefully someone else who has a much greater knowledge of php and MySQL might have a go at making this module as it is too complicated for me. I would love to have being able to have completed this but it was just too complicated, sorry guys Regards, James This is what I got completely done: Module in core/modules: one for displaying the form and one for submitting. Table in the database to store: loaid (A/I: for unique records), pilotid, startdate, enddate, reason .tpl files for the form and error messages (I think it would be really good if someone could take the time out to make a file showing how to make modules for phpvms as the original documentation for making a module on the document page is too basic)
  22. I think you would have to use <?php $sql = "INSERT INTO ".TABLE_PREFIX."thetable (firstname, lastname, age) VALUES ('$_POST[firstname]','$_POST[lastname]','$_POST[age]')"; ?> while having the tables: firstname, lastname, email, age in the table in the mySQL database. I think thats how you do it but I am no expert so it could be completely wrong.. James
  23. http://www.greeceairwaysva.com/fss/index.php/pages/fsairlines ?
  24. Ok thanks I will have a shot at it
×
×
  • Create New...