Jump to content

DisposableHero

Members
  • Posts

    623
  • Joined

  • Last visited

  • Days Won

    97

Everything posted by DisposableHero

  1. Most important things here are 1. Finding the correct blade 2. Using the correct widget at the correct page with proper configuration. Imagine you want to use some "airport" related widget like "Sunrise / Sunset" Then you need to place it a blade where you have some airport related information in hand. @widget('DisposableTools::SunriseSunset', ['location' => $airport->id]) Why ? Because you need to provide it an airport's ID (4 Letter ICAO code). So placing that widget at your homepage will generate an error because there is no $airport (airport model as a variable) there. The error will say something like `unable to get property id of non object` and you will see `500 | Server Error` However same widget, can be used at homepage with a fixed airport code. Then you will not get any errors but it will always show the same airport. @widget('DisposableTools::SunriseSunset', ['location' => 'LIRF']) In short, if you see something starting with $ in the readme, this means that "be careful when placing that widget"
  2. https://github.com/FatihKoz/DisposableTools#usage This section gives the main usage of all available widgets provided by Disposable Tools. Also at the same readme there are detailed sub-sections for each widget. https://github.com/FatihKoz/DisposableTools#top-pilots So for example, if you want to use "TopPilots" widget at your home page, you need to do below items 1. Find the blade file responsible for the page you want to add the widget. Here in our example, imagine you want "Home" page so it is "home.blade.php" located directly under your theme folder. 2. Edit that file, pick a suitable location as you wish, then add it. @widget('DisposableTools::TopPilots', ['type' => 'landingrate']) 3. Save the file. I just copied the example usage syntax from the readme file. If you want to adjust the widget options, then you need to follow the explanations provided in the readme. For example, you want to display not overall leaderboard but only last month, then you add relevant configuration options to the widget call @widget('DisposableTools::TopPilots', ['type' => 'landingrate', 'period' => 'lastm']) Also you may want to show top 10 pilots, then it would be @widget('DisposableTools::TopPilots', ['type' => 'landingrate', 'period' => 'lastm', 'count' => 10]) Most of the time, people get confused with the "grid" design used by Bootstrap (the theme's core) and can not find the correct blade file ("blade" is a Laravel term). All visible pages (the output) are called "blades" and they are stored under your theme folder (nicely organized). Everything related to dashboard is under dashboard folder, pages related to flights are under flights folder etc. etc. If you need more info about Bootstrap and Laravel Blade, I would kindly suggest checking their official documents. ( Default theme uses Bootstrap 4.3 / Disposable Theme v2 uses Bootstrap 4.6 / phpvms v7 uses Laravel 8.x series ) If you are using Disposable Theme you can check it's home.blade.php as an example for how the "grid" system works and how the widgets are placed. Or you can check it from Github with below link https://github.com/FatihKoz/DisposableTheme/blob/main/resources/views/layouts/Disposable_v2/home.blade.php#L33-L48 Hope this helps
  3. "Time Out" is a server limit and can be adjusted. Most probably you are hitting php execution time limits. There are several repeated notes/replies about NOT using beta4, even the download page itself it says not to use it and gives a link to latest development (DEV) builds. Good luck on your new install.
  4. Upload/FTP location : yoursite.com/public/assets/img/new_image.png URL / Usage address : yoursite.com/assets/img/new_image.png Notice the difference with "public", which is the document root hence must be removed from the url.
  5. Mostly styling is done by editing CSS files of themes. No one can explain you things from the universe started with big bang to today. Even though somebody gives you the location or path to default theme's stylesheet file you still will need some more info. https://www.w3schools.com/htmL/html_css.asp W3Schools may be a good location to start reading, provides nice examples and tries to explain things at dummies level step by step. Landing Page : home.blade.php (or dashboard/index.blade.php for logged in users) Default Theme Stylesheet : ./public/assets/frontend/css/styles.css
  6. What is "Operating Costs" ? There is no such field, if you are talking about Subfleet level "Cost Per Hour" it works fine. Also other cost related areas do work well too. Time Out = Happens when the file is big enough to trigger your server's limit. It may be a size limit or uploading time limit (both related to your server's php settings). Won't Recognize Url = You need to check some basic docs (mostly about Laravel blade) to understand the path logic, also you need to double check your typo Example; Upload your file via FTP to ; yoursite/public/uploads/my-repaint.zip URL for download will be something like ; yoursite.com/uploads/my-repaint.zip Notice the difference in the path, you upload to public folder but it is not mentioned in the url 'cause it is the document root. Outside visitors (including you) can not reach files/images outside of that document root folder with URL's, so upload your files under that public folder for linking (use sub-folders under it if you need)
  7. 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.
  8. 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)
  9. 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
  10. 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.
  11. 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...
  12. 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.
  13. 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.
  14. 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)
  15. My pleasure and thanks for kind thoughts, considered as if I had that drink
  16. 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
  17. 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.
  18. 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
  19. 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
  20. 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>'
  21. 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
  22. 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):&nbsp; <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>'; } } ?>
  23. 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)
  24. 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.
×
×
  • Create New...