Jump to content

Jakes

Members
  • Posts

    72
  • Joined

  • Last visited

Everything posted by Jakes

  1. Jakes

    Ledger DB

    Thanks gents. Where did this tale come from? I have searched all my add ons, couldn't find the query?
  2. Jakes

    Ledger DB

    Here is the error log: (all my tables have a prefix MySQL)
  3. Jakes

    Ledger DB

    I am not sure, Don't this update have something to do with it? http://forum.phpvms.net/topic/4967-rev-v21934-112-g46862a2-moved-ledger-into-its-own-data-class/page__hl__ledger I will runt rhrough my mods installations maye Ive missed a SQL query
  4. Jakes

    Ledger DB

    Good day, I have for some reason not a phpvms_ledger table. I do not understand why, maybe because I doesnt have the latest update. I did not do the update due to the many modifations. The site function fine, but the finances does not update when selling/repairing aircraft, not showing the expenses, sales income. Any help, or a SQL query that can add the table? Best Regards, Jakes
  5. Marcosilva, I also had that error. The fix is to make sure you have the APVacars.php module uploaded to the correct location of your website, which is \core\modules\APVacars Enjoy!
  6. Good day, I have updated this mod to the latest version, and now all my pireps have the following errors: Any idea why? Thanks for the awesome mod!
  7. Jakes

    Airline Skin

    Hi, No actually it is freeware. That is why I left the link in the skin. In the original post, I also placed the link to the skin. Also, I do not take credit for the skin, as said, I only adapted it for phpVMS.
  8. Hi there, I would like to know how to modify the auto retire function so that it only retire the pilots that have 0 hours logged? Cheers!
  9. Hi there, I recently updated our website with a new skin I compiled. It features a roundabout image carousel on the frontpage, an accordian style built in for multiple sub pages on a page, as well as a family tree style bulleting system if needed. See the website live here: http://www.uvsaaf.fsworld.co.za/index.php Download the skin here: https://www.dropbox.com/s/0lge15r47bs9s7f/bluecorporationSkin.zip Installation instructions: Copy the bluecorporation folder into your www/lib/skins folder and activate To use the accordian style for multiple pages, create a new page in your admin center and save. Then, close your admin center and then open the created pagename.htm in an HTML editor. Copy the contents of the supplied accordianpage.html page to your page. and save. WARNING!!! DO NOT EVEN ATTEMPT TO EDIT THE ACCORDIAN STYLE PAGE IN YOUR ADMIN CENTER PAGE EDITOR. IT THROWS AWAY IMPORTANT INFO NEEDED FOR THE STYLE TO WORK. ONLY EDIT IT WITH AN EXTERNAL EDITOR, SUCH AS NOTEPAD++, or cpanel's code editor copyright: Allthough the basic skin was derived from a free template, I have modified more than 30% of the skin, and added bits and pieces to create my own unique skin. Original template by cool website templates c+c welcome!
  10. Jakes

    Airline Skin

    thanx! the width can easily be adjusted in the css
  11. Jakes

    Airline Skin

    Hi there, I have adapted a skin for a friend, and gladly share it with you guys. View the website live here: http://www.worldwide...x.php/Frontpage DOWNLOAD Airline.zip INSTALLATION Extract the file to your main phpVMS directory (There where your index.php, action.php files are, as well as the core and lib folders) It will ask to overwite some templates. Choose yes, it only adjust the width of some tables to fit in ( I have included a original backup should you want to revert) NOTE: Some html knowledge is required to adjust the wording on the frontpage, add buttons, etc. Credits: This Airline template is a free template from Templatemonster. Visit http://www.templatemonster.com/ I have adjusted it to work for phpVMS I have also used Simpilot's Popup news module (free from their website). Proper credit is given to them. C+C welcome Cheers, Jakes
  12. Hi there, Is there a way to automatically mark the pilot as on Leave when he/she submit a LoA form? Also, in addition to that, then exclude the pilots marked as on Leave from the automatic retire function? Best Regards, Jakes
  13. My apologies, I have made the folder name in the templates folder, LoA ,instead of loa. All fixed now. Thanks for the great add on!
  14. If you look at the error url it have something to do with the path to the tpl file. It have two forward slashes instead of only one.
  15. Hi, I have double checked it, and all are in the locations as instructed. I also have a similar error with the admin page
  16. Hi there, I have this error after installing this mod: well, the problem is the double forward slash in the URL before the first CORE, but I dont know where to fix it? Cheers
  17. Hi there, Since the last upgrade I made, I have a few prolems with the schedules. 1) Whenever I try to edit ANY existing schedule, I get the error: (No I have no Week1 anywhere, not even in my sql table) There was an error editing the schedule: Unknown column 'week1' in 'field list' 2) There is no option to delete a schedule. Only to reverse and edit. Can someone help me with these issues please? Cheers Jakes
  18. Hey Oaks, It's been a long time since i've worked on this mod, and I have some success. First of all, I had success writing to the database. The code below is adjusting the condition. ( PLEASE BEWARE IF YOU USE IT LIKE THIS, IT WILL CHANGE THE ENTIRE FLEET'S CONDITION) The code I have now, is a bare code, with the basics. It picks up the landing rate, and in this case, when zero, it writethe condition to the DB. Also, just to help , I have added a message to show me if it picks up the landing rate, and show a message when filed a pirep. Also, teh event I test on is pirep_prefile. The reason is then I dont need to approve the pirep every time I do a test. It is simply to speed up the testing. Once all are sorted, I will change it back. That is the main functions we need here. Now, I am trying to update just the specific aircraft's condition. but haven't got much luck yet. Maybe I miss something and my brain is just tired? AGAIN, I WARN YOU TO NOT USE THIS CODE ON AN ACTIVE WEBSITE, IT WILL CHANGE THE ENTIRE FLEET'S CONDITION. <?php class Aircraft_Condition extends CodonModule { public function __construct() { CodonEvent::addListener('Aircraft_Condition'); } public function EventListener($eventinfo) { if($eventinfo[0] == 'pirep_prefile') { $pirepinfo = $eventinfo[2]; if($pirepinfo->landingrate == 0) { $cond = 50; Template::Set('message', 'Landing rate Picked up!'); Template::Show('core_error.tpl'); //DB::query('UPDATE '.TABLE_PREFIX.'aircraft SET `cond`='.$cond.' WHERE `aircraft`='.$pirepinfo->aircraft); DB::query('UPDATE '.TABLE_PREFIX.'aircraft SET `cond`='.$cond ); } } if(DB::errno() != 0) return false; CodonCache::delete('all_aircraft'); CodonCache::delete('all_aircraft_enabled'); CodonCache::delete('all_aircraft_search'); CodonCache::delete('all_aircraft_search_enabled'); return true; } } Here is the code I am working on to update a specific aircraft: <?php class Aircraft_Condition extends CodonModule { public function __construct() { CodonEvent::addListener('Aircraft_Condition'); } public function EventListener($eventinfo) { if($eventinfo[0] == 'pirep_prefile') { $pirepinfo = $eventinfo[2]; $aircraft = OperationsData::getAircraftByReg($pirepinfo->registration); if($pirepinfo->landingrate == 0) { $cond = 50; Template::Set('message', 'This aircraft distance is out of range for this flight!'); Template::Show('core_error.tpl'); DB::query('UPDATE '.TABLE_PREFIX.'aircraft SET `cond`='.$cond.' WHERE `id`='.$aircraft ); } } if(DB::errno() != 0) return false; CodonCache::delete('all_aircraft'); CodonCache::delete('all_aircraft_enabled'); CodonCache::delete('all_aircraft_search'); CodonCache::delete('all_aircraft_search_enabled'); return true; } }
  19. Hi Nighthawk, Thanks for the help so far, I will also play around with the new info you gave. Just a bit swamped in work right now. Cheers,
  20. Thanks Thomas, but it is a bit confusing; // Condition for new Plane $newrd= rand(95, 100); // Condition for used Plane $userd= rand(60, 85); // Condition for retired Plane $retrd= rand(25, 55); Then, there is also this line: <input name="cond" type="hidden" value="<?php echo $newrd; ?>" /> My guess is that this have something to do with the state of the aircraft, whether it is new, used or retired. I cannot understand why it is so difficult to just get a simple php script to write to a table.
  21. Thanks Nabeel, do I need to add this to the module, or the OperationsData.class?
  22. Ok, worked on a few angles. First, Jeffery, I've tried your code above, and no luck. @Nabeel, thhrowing a DB::debug() as suggested, give an error. Parse error: syntax error, unexpected '}' in C:\wamp\www\core\modules\Aircraft_Condition\Aircraft_Condition.php on line 27 Also, Jefferey, I have already modified my OperationsData,class to this: /** * Edit an aircraft */ public static function editAircraft($data) { $data['icao'] = DB::escape(strtoupper($data['icao'])); $data['name'] = DB::escape(strtoupper($data['name'])); $data['registration'] = DB::escape(strtoupper($data['registration'])); $data['range'] = ($data['range'] == '') ? 0 : $data['range']; $data['weight'] = ($data['weight'] == '') ? 0 : $data['weight']; $data['cruise'] = ($data['cruise'] == '') ? 0 : $data['cruise']; $data['range'] = str_replace(',', '', $data['range']); $data['weight'] = str_replace(',', '', $data['weight']); $data['cruise'] = str_replace(',', '', $data['cruise']); $data['maxpax'] = str_replace(',', '', $data['maxpax']); $data['maxcargo'] = str_replace(',', '', $data['maxcargo']); $data['price'] = ($data['price'] == '') ? 0 : $data['price']; $data['cond'] = ($data['cond'] == '') ? 0 : $data['cond']; $data['bought'] = ($data['bought'] == '') ? 0 : $data['bought']; $data['rep'] = ($data['rep'] == '') ? 0 : $data['rep']; if (empty($data['minrank'])) { $data['minrank'] = 0; } if ($data['enabled'] === true || $data['enabled'] == '1') $data['enabled'] = 1; else $data['enabled'] = 0; if ($data['minrank'] > 0) { $data['ranklevel'] = RanksData::getRankLevel($data['minrank']); } else { $data['ranklevel'] = 0; } $sql = "UPDATE " . TABLE_PREFIX . "aircraft SET "; $sql .= DB::build_update($data); $sql .= " WHERE `id`={$data['id']}"; /*$sql = "UPDATE " . TABLE_PREFIX."aircraft SET `icao`='{$data['icao']}', `name`='{$data['name']}', `fullname`='{$data['fullname']}', `registration`='{$data['registration']}', `downloadlink`='{$data['downloadlink']}', `imagelink`='{$data['imagelink']}', `range`='{$data['range']}', `weight`='{$data['weight']}', `cruise`='{$data['cruise']}', `maxpax`='{$data['maxpax']}', `maxcargo`='{$data['maxcargo']}',`price`={$data['price']},`cond`={$data['cond']}, `bought`={$data['bought']},`rep`={$data['rep']},`minrank`={$data['minrank']}, `ranklevel`={$rank_level}, `enabled`={$data['enabled']}, `bought`={$data['bought']}, `rep`={$data['rep']} WHERE `id`={$data['id']}";*/ $res = DB::query($sql); if (DB::errno() != 0) return false; CodonCache::delete('all_aircraft'); CodonCache::delete('all_aircraft_enabled'); CodonCache::delete('all_aircraft_search'); CodonCache::delete('all_aircraft_search_enabled'); return true; } Now, I need to explain my initial question; The default phpVMS software does not have a "cond" table. Only after I installed the Step 1 Aircraft buying mod, the "cond" table was added. Now when in the admin panel, the aircraft condition ( cond) is 0 until the aircraft is bought or leased. Only then, the aircraft show a condition. And not all of them shows 100% when bought. Some of my aircraft is at 95% even. So somewhere (Without this Aircraft_Condition module) there is already a code that calculate that condition. And I am looking for that code. Am I missing something? Then, lastly, I went back to the basics: I slightly modified the code on the developer's guides to test. First I tested the landingrate. It pics up the landing rate from a manual pirep which is 0 Here is what I have: <?php class Aircraft_Condition extends CodonModule { public function __construct() { CodonEvent::addListener('Aircraft_Condition'); } public function EventListener($eventinfo) { if($eventinfo[0] == 'pirep_prefile') { $pirepinfo = $eventinfo[2]; if($pirepinfo->landingrate == 0) { Template::Set('message', 'This aircraft distance is out of range for this flight!'); Template::Show('core_error.tpl'); CodonEvent::Stop(); } } } } I have also tested it with an aircraft with a registration ZS-AA1 and it also worked well if($pirepinfo->aircraft == 'ZS-AA1') So the basics are working 100% Just need to write the condition to the DB
  23. Hi Jeffrey, Thanks, but i cannot find the CodonEvent::Dispatch('pirep_filed', 'PIREPS', $_POST); In the core/modules/acars/acars.php Perhaps it in another file?
  24. Hi Jeffrey, The code as it is now. I cannot understand why it doesn't write to the db, maybe a fresh eye will catch the fault? <?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/ * */ class Aircraft_Condition extends CodonModule { public function __index() { CodonEvent::addListener('Aircraft_Condition'); } public function EventListener($eventinfo) { if($eventinfo[2] == 'pirep_filed') //Retrieve the aircraft info based on the aircraft id stored in the pirep row $aircraft = OperationsData::getAircraftByReg($pirepdata->registration); //Figure out the $cond that needs to be placed into the if($pirepdata->landingrate > 1 && $pirepdata->landingrate <-500) $cond = $aircraft->cond -20; else $cond = 50; $params = array ( 'id' => $aircraft->id, 'cond' => $cond, 'minrank' => $aircraft->minrank, 'enabled' => $aircraft->enabled, ); $update = OperationsData::editAircraft($params); } }
  25. We have many modifications to our site anyway, that is not standard, like Search by Squadron, ect that does not work after the latest update. I do not mind adding it again after an update. Thanks Jeffrey, Me and redcoals will check it out, and report
×
×
  • Create New...