-
Posts
723 -
Joined
-
Last visited
-
Days Won
117
Content Type
Profiles
Forums
phpVMS Resources
Downloads
Everything posted by DisposableHero
-
change language to Modules Disposable
DisposableHero replied to TheDoctor75's topic in Disposable Hero Addons
Hi, To use a different language you need to change the locale setting from env.php because this is not a module setting and effects your phpvms v7 installation. APP_LOCALE=en is the default, you can change that to; APP_LOCALE=it for Italian and save your env.php , then go to admin -> maintenance , clean ALL CACHE or APP CACHE for this change to be recognized. -
Acars error, it gets stuck in "Started Pushback"
DisposableHero replied to JuniorIP's topic in vmsACARS
Use latest beta version 1.0.0.1769 please. Current stable ("non-beta") version may act weird with MsFs and FBW A320 Mod (and maybe with other aircraft of MsFs) -
My pleasure, hope manual import trick helps you out By the way, even after a successful import, pilots need to reset their passwords to be able to login to v7. So it will take almost the same time (maybe less) for them to re-register
-
Check your v7 database @miniarma, probably your users table is not imported correctly and "name" fields are empty. I saw people using migration without errors you described, specially not with airports or users part. Why it is generating such errors on your side is strange.
-
You need to provide some more info for our "suggestions" Unfortunately, this really means nothing. Yes, there is an error you are facing but what it is ? This gives no idea at all. https://docs.phpvms.net/help#information-required https://docs.phpvms.net/help#logs https://docs.phpvms.net/help#enable-debug-and-debugging Without proper error details, we really can't help you much...
-
The problem is with starting the flight Acars stucks at "Pushback" 'cause engine state does not get recognized with MsFs + FBW Airbus A320 NEO (maybe with others too). So for acars flight never leaves "Pushback" and end flight is not possible, nothing being recorded/recognized during that state. As expected, it never detects the landing in the first place to offer "End Flight". Had to manually change pirep states/fuel values etc from db for tonight's flights and then told my pilots to manually send/file their pireps via web. Just for your info.
-
Great to see it working You can remove the name from the select 'cause you do not need to send it to SimBrief. <select id="dropdown" onChange="ChangeFormValues()"> When you submit a form, everything you gave a name will be passed with its value (if it is enabled of course). We can not disable the dropdown here 'cause we need it, but we can avoid sending it to SimBrief by removing the name="" tag Just a little trick for you.
-
I think you can filter the json in your second dropdown, so a second call to database would not be needed / required at all. Once you create the json object from mysql results, what you need to to is ; 1. Show only the ICAO values of that json object in your first dropdown (group them by icao, so there will be only one B738) 2. And when user selects an ICAO type, use onChange() with JavaScript to show/display your second dropdown while passing the user's ICAO Type selection, here you need to show Registrations only which have the selected ICAO type by using the same json object. At this point you will have two values in your hand; ICAO, from the first dropdown and REGISTRATION from second one. Then you can pass those values to your SimBrief form. Hope you can manage to finish this and have a working solution. Since you are not using live database calls, you may not need Ajax at all and all this can be done with plain JavaScript. (even you do not need JQuery to do all the above)
-
My pleasure and thanks for kind thoughts, considered as if I had that drink
-
Imagine a scenario, in which pilot lands with -673 feet/minute. ( absolute value is 673 , using abs() makes it easier to handle things logically ) It will pass the first "if" check we put in 'cause we are checking anything above -500 feet/minute. Then it will reach the multiplier part, here our new $amount will be calculated like this $amount = 250 * (673 / 500) , means simply $amount = 250 * 1.346 , result will be rounded so it will be 337 ($ or Eur, your selected currency) The next step will prepare the proper Expense array to pass back, charge_to_user is true, this means that the amount will be taken from pilot's pocket In another flight, another pilot lands with -499 feet/minute, then nothing will happen and no expense will be charged to pilot 'cause it will be captured by the "if" check and it can not proceed further. Now, after the example above and basic explanation here, it is up to you and your imagination + skills
-
There is no such expense type called Hard Landing and the transaction group you defined is wrong, also the Hard Landing([...]); will mean nothing for the code etc etc. The images you added in above message is not visible, even when I click I see a thumbnail of them, nothing readable <?php namespace App\Listeners; use App\Contracts\Listener; use App\Events\Expenses; class HardLanding_ChargePilot extends Listener { public function handle(Expenses $event) { $expenses = []; $amount = 250; // Do your check here, return an empty array if it is ok/below your check limit (no expense needed) if (abs($event->pirep->landing_rate) < 500) { return $expenses; } // You can even increase the punishment here by getting a ratio // So the harder they land, the higher the punishment $amount = round($amount * (abs($event->pirep->landing_rate) / 500)); // Prepare a New Expense here $expenses[] = new Expense([ 'type' => ExpenseType::FLIGHT, // This must be FLIGHT for a pirep related pilot charged expense 'amount' => $amount, // No need to add two more digitis, 150 is 150$ or 150Eur etc. 'transaction_group' => 'Hard Landing', // This is the group name, visible at financial report 'name' => 'Hard Landing Fee For Pirep='.$event->pirep->id, // Name is visible like a memo 'multiplier' => false, // or true (to use Subfleet GH Multiplier) 'charge_to_user' => true, // true to charge pilot, false to charge company ]); // If you wish you can create another expense here like the one above... // And finally return all new expenses you prepared return $expenses; } } As the example above, you need to follow some basic logic and do checks. If you do not follow standards it will either not work at all (errors out and causes problems) or at best it will not be applied by phpvms v7. Anyway, if you want to code your expenses or have modules/widgets etc you need to study phpvms first, to learn how it works, what it needs/expects.
-
Sounds like the Hard Landing expense you wrote is not checking the landing rate and charging the pilot always. Which is not good of course I do not know how you coded it or did found an example and used it as it is without modifications. So without seeing the expense you are using I can not help much. For the first question, I kindly do not advise messing up with core code so I will not point you to some core files/filenames You can however, try the second/third alternatives by using the same expense logic you used for the hard landing with some enhancements to achieve what you want
-
Not much The basics of server side / client side limitations still apply but we are much flexible there at server side (with php + laravel) I do not know if it is possible with php 5.x series but you may consider using JSON objects in that page too. Build the resultset once with php, convert it to a json object, then use it with javascript so show a dropdown for ICAO Types and then another one for Registrations
-
In basic terms, for php this is happening ; $resultSet = "SELECT icao, registration FROM phpvms_aircraft"; > Returns a nice result $resultSet2 = "SELECT registration FROM phpvms_aircraft WHERE icao='<input type="hidden" id="typo" readonly>'"; > Returns nothing Because $avion = '<input type="hidden" id="typo" readonly>'
-
This is happening because you are mixing up two different languages here and expecting them to work together always. PHP is a server side language, means that anything you write with it runs *BEFORE* you see the actual result/page. While on the other hand, JavaScript runs at client side, meaning that you will see it working *AFTER* the page is rendered/loaded. So what is happening in your code; 1. When you want to use that page, php code runs *before* you see it and generates the $resultset. At this moment, also the second php code block runs for $resultset2 but returns nothing because $avion has no value yet, simply it is null. 2. Page loads, you see the dropdown menu filled with $resultset data. You select one of them, and at that moment your JavaScript upIcao() start working and assigns a value to typo (which is also the $avion) Here at this exact moment, you expect for php code to pick/see that change and run again. But this can not happen, it is against the design logic of it. So for php $avion is still empty and will remain empty, no matter how many times you change your selection it will have no effect for php 'cause it worked and stopped before you even see the that dropdown items. What you can do; 1. Alter your code to select all aircraft registrations you have with php, make it ready to be used when the page loads. Then filter those results with your Javascript upIcao() and show a filtered second dropdown according to the selection of first dropdown. 2. Or you can make use of JavaScript/AJAX calls, which basically enables the use of php along with JavaScript (simple terms: it will run a php/mysql code when you change the first dropdown and then display you the results). You can find some nice examples for that and implement your own code. Hope this helps
-
Something like this (a little bit cleaner of yours and tried to correct the form elements <?php require_once ("/Connections/db.php"); mysqli_select_db($db, $database_db); $resultSet = "SELECT icao, registration FROM phpvms_aircraft"; ?> <select name="type" id="typo" onChange="upicao()"> <?php $resultSet = mysqli_query($db, $resultSet) or die(mysqli_error($db)); while ($rows = $resultSet->fetch_assoc()) { $icao = $rows['icao']; $reg = $rows['registration']; echo '<option value="'.$icao.'">'.$icao.' '.$reg.'</option>'; } ?> </select> <?php $avion = '<input type="hidden" id="typo" readonly>'; ?> <script type="text/javascript"> function upicao() { var select = document.getElementById('typo'); var option = select.options[select.selectedIndex]; document.getElementById('typo').value = option.value; } </script> <?php if (isset($avion)) { require_once ("/Connections/db.php"); mysqli_select_db($db, $database_db); $resultSet2 = "SELECT registration FROM phpvms_aircraft WHERE icao='".$avion."'"; ?> <b>Registro</b> (opcional): <input name="reg" id="regist"> <?php $resultSet2 = mysqli_query($db, $resultSet2) or die(mysqli_error($db)); while ($rows = $resultSet2->fetch_assoc()) { $reg = $rows['registration']; echo '<option value="'.$reg.'">'.$reg.'</option>'; } } ?>
-
Does the above code works ? I mean did you somehow tried to dump the form values at some point to see if it is working properly (assigning values to names etc). echo '<option value="'.$reg.'">'.$reg.'</option>'; I think the html form tags should be like <option value="E-ABCD">E-ABCD</option>, I did not tried to use them like you did with <option value=E-ABCD>E-ABCD</option> Same applies to your ICAO Type selection code too (if this is the case of course)
-
And of course, for both alternative and third solution there should be some checks and corrections (to handle rejected pirep situations, like taking the same amount back from the pilot if the pirep gets rejected after being accepted once). So the first solution is the safest way to do it 'cause phpVMS v7 will handle all the transactions (and accept/reject/accept cases). Second and third solutions may look nicer but both needs extra attention to detail.
-
It is not possible without writing your own code. Currently phpVMS v7 offers two ways to pay pilots; 1. By flight time 2. By each flight (fixed amount) What you need is a your own code, which basically will have two separate parts/actions; 1. Listen pirep events to get the amount of cargo they carried (pirep->fares and fare->count). Calculate the "pilot pay" for that amount/flight. 2. Send back that amount to phpVMS v7 as "pilot pay" for that pirep. For the first, you do not need to alter core code, you can do that without problems by event listeners. But for the second part, you need to alter core code to get and process your calculated pilot pay (which makes tracking updates hard). Alternatively, you can do the first part but skip the second part by paying the amount directly to pilot account after the calculation. This does not need altering core code, but no one will see the calculated pilot pay in pirep transactions, it may be only visible in admin / finances. Pilots will see increase in their current balance of course, but no details will be there. Or as a third solution, you can do the first part and change the second part a little bit. By sending that pilot pay "pilot bonus" as an "expense" (which is already built in to v7 core code so no need to alter it). While sending in the expense to v7, you need to credit the pilot account at the same time, so everyone will see it clearly when looking through pirep transactions. This probably be the nicest solution without altering the core code; 1a. Listen pirep events to get the amount of cargo they carried (pirep->fares and fare->count). Calculate the "pilot bonus" for that amount/flight. 1b. Send back that amount to phpVMS v7 as an additional "expense" for that pirep, credit pilot with the same amount. (This solution can be done in a single custom expense code) Hope this helps
-
No. How can he/she/it fix a mistake if you do not let a pilot to fly again when a pirep gets rejected ? It will be totally strange to forbid them to fly when a flight report gets rejected. You can manually change their state to Suspended from admin panel if you really want them to stop flying for you until you somehow resolve the rejected pirep problem. (Or you can just fire them, this will forbid them flying too)
-
https://docs.phpvms.net/config/email
- 1 reply
-
- 1
-
-
My pleasure 😇 Oh, we forgot to clear the cache Poor laravel was trying to act on the old domains cache at the new domain. Sorry I forgot that step, technically you need to clean the cache (delete some files) when you swap domains/subdomains. No need to edit files under cache folders, phpvms generates them on the first run when not found (and this manual cache cleaning process is sometimes becomes a key factor for updates) When you need a blade change, just let me know (either via forum or discord), I may not be able to do the change for you but at least I can give you some basic info about it Safe flights,
-
What were they complained about... Two values being separated logically or visually ? If it is visuals only (which the pilots see) it can be fixed though (we can make them happily fly ever after), but if they are against the logic behind it then I think they need to focus on their flights rather than administrative issues Are those domains on same server and under same hosting account ? If yes, then after copying over all files to the new domain (or subdomain) changing the APP_URL value at env.php should be enough (considering the database server remains same). That was what I did when switching from test to live (same server different subdomains, same database). No laravel log from today seems like the problem is somewhere in the server (apache/nginx or php) config, it fails before even loading laravel core. So for more comments, we need to see logs. And double check that new server's capabilities against phpvms requirements, if they are not under the same hosting account.
-
"not have it be listed under transferred hours" Manually editing database : Will not work 'cause user stats get re-calculated every night Filing a manual pirep for each user, then editing its "flight time" directly from database : Is the only solution according to your above mentioned wish. (which may have small side effects but will not be harmful I think) Why do you want that hours to be listed as normal hours, in fact there are actually transferred hours from your old system ? I see nothing wrong there 'cause those transfer hours are used in ranks / rewards etc (if you enable that setting too). So if you define same ranks (matching or improving your old system), all will be auto selected by their vms7 hours + transferred hours etc. (same applies to awards too) Also as the admin of the va, you will have full control over your theme(s). In those you can simply show the total hours without any separation if you need so (like in roster and user profile). This of course needs some blade editing but nothing hard there. Hope you find the best solution for your new system Just a side note : Pirep / flight_time is in minutes, so when editing the pireps one by one for each user, you need to enter their VAM hours as minutes User / transfer_hours is in hours, no conversion needed.