Jump to content

DisposableHero

Members
  • Posts

    766
  • Joined

  • Last visited

  • Days Won

    123

Posts posted by DisposableHero

  1. 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>';
        }
      }
    ?>

     

  2. 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)

  3. 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.

  4. 9 hours ago, Jbaltazar67 said:

    Hello ,
    We offer cargo contracts to our pilots, they are paid by the KG transported, I am looking for how to create the tariff.
    Ex: 1kg loaded = 1.00 € if a sympathetic enough person could help me that would be great.
    Thanks in advance

     

    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

  5. 5 hours ago, DominZo said:

    Is it possible to somehow remove the fact that the pilot cannot fly if the pirep is not accepted?

     

    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)

  6. 1 hour ago, atrdriver said:

    As you were probably typing that I did a search for the old domain name inside all the website's files, and found it a LOT in the file

    \phpvms\bootstrap\cache\config.php

    I changed all of them and it appears to be working now, at least I can log in and all the data seems to be there.  Yes, it is the same hosting company, and both sited were inside my account there.  There were a bunch of other files that had the shootingstarfan domain name in them, but they were all long file names that made no sense, such as

    \phpvms\storage\framework\sessions\BaxV6zu49204SbJNn91VxnIsc9ZNnhjZhNV0jVzI

     

    Hopefully the config.php file got it working :)  And someday I hope to be smart enough to edit the blade files, but I'm not there yet.

    Thanks a TON!!!!

     

     

    My pleasure 😇

     

    Oh, we forgot to clear the cache :D 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,

  7. 1 hour ago, atrdriver said:

    Thanks Hero.  I guess for now I will just leave it at transferred hours as is.  That was the only complaint that I had from the couple of pilots that I had testing things.

     

    On a different topic.  I had phpvms running on another website to get it all set up.  Today I tried to make it live by changing the domain names around.  It was originally running on a site called www.shootingstarfan.com, and I changed it's domain to our live site, which is www.flycoa.com.  I changed the domain name in env.php, which was the only place where I could find a reference to the website domain.  But when I try to go to it I get a server error.  I looked for a log from today, and there isn't one.  Is there someplace else I have to change the domain names, or am I going to have to re-install and then import the databases?  Thanks.

     

    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.

     

  8. 31 minutes ago, atrdriver said:

    I am getting ready to take my phpVMS website live to replace my older VAM powered one.  Question is, is there a way for me to enter my pilots transferred hours so they show as flight time and not transferred hours?  Like manually editing the total in the database?  Or possibly filing a manual PIREP with all the transferred hours?  I'm just looking for a way for them to show up in a pilots hours, and not have it be listed under transferred hours. 

     

    Thanks in advance,

    john croft

     

     

    "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.

     

     

    • Thanks 1
  9. I saw those PR's and kindly informed you about the main requirements. I see you merged them in one PR, which is kind of mandatory but still failing a simple style check :(

     

    check.png.45ae3b4020989c2554665db36967da9f.png

     

    When you click the Details link, it will show you the errors in red and possible solutions in green lines.

     

    style.png.642b9026ae3c778ff1667de37d55c765.png

     

    So here in this particular file, you have 2 non necessary spaces :) First one is before the public, second one is after the comma. Deleting those spaces then saving the file will let the code to continue processing your changes.

     

    Every PR needs to pass some checks, these may be simple styling checks or complete build tests. And every PR has to run/pass those tests on their own 'cause they are threated as separate applications. They may work on your local environment without proper styling but this is not the case for being approved as core changes.

     

    Hopes this little info helps and you fix that simple style error, pass the tests and they get approved afterwards.

     

  10. 53 minutes ago, VOE17VV said:

    hi can someone help me to install and create the airline, please i am desperate, i have already bought the domain

     

    https://docs.phpvms.net/

     

    https://docs.phpvms.net/installation/uploading

     

    If you can not do the install yourself, there are some paid services offered just for that 5 minutes... Check "Paid Services" section of the forum.

     

    https://forum.phpvms.net/forum/39-paid-services/

    • Like 1
  11. 7 hours ago, natopower said:

    Yeah, that was solved. Just a misclick on that first bit. The App\Models\Pirep issue is the main problem.

     

    "No query results for model [App\Models\Pirep] prefile" simply means that Acars is not able to connect to your phpvms properly and can not pre-file the pirep to move on...

     

    And root cause of that error lies just above it ;

     

    08-27 00:16:00|ERROR; uri=http://
    08-27 00:16:00|ERROR; req=https://

     

    Sometimes, SSL certificates do these kind of redirections and when that happens, acars fails 'cause it looks for http response comes from https (or vice versa).

     

    Check your acars settings and your phpvms / env.php (APP_URL=)

     

    Hope this helps

     

     

     

    • Thanks 1
  12. As I wrote at GitHub,

     

    Missing fields ;

    • hub_id
    • simbrief_type 

    Non-Used Extra Fields (which also can be removed from the database, but it is another matter)

    • cargo_capacity
    • fuel_capacity
    • gross_weight

    Fares and their relations to subfleets (and flights) is a different subject, I think you will see (code wise) how they work soon :) And I hope your first PR will fix the csv export/import logic of subfleets (at least partially)

  13. Are you actually saving the aircraft ?

     

    save.thumb.png.75a7815e32a61524d38aa1c33d343381.png

    Cause if you do not save it, it will not be there.

     

    Also your screenshot shows that you have already some aircraft saved (attached to subfleets).

     

    Just a basic info, you can not use the same name or registration, they must be unique.

     

    Hope you figure it out or provide some logs for us to inspect.

  14. Technically, what the main question owner wants does not need a private token or a private api access ... Those checks can be done simply with the public access (public whazzup data). 

     

    You can fetch the data (with minimum 15 second interval for both networks), do your checks however you wish and then either store the data in a database table or delete it. If your acars software is sending live data to your phpvms, then you can do your checks live and mark the flight online/offline as you wish. If it is sending all the pirep info after the flight then you need to store the live whazzup data with (prefably utc) time codes (like one copy for every 5 mins and keep the last 24 hours) and then check them according to the pirep (prefably utc) times to see if the pilot was online or not during the flight.

     

    Anyway, these are technical details ... I already did it for phpvms v7 with public api access, so it can be done for v5 too. 

     

    Hope you can find your solution for v5.x series.

    • Like 1
  15. 8 hours ago, igusim said:

    hi ı bought phpVMS ACARS license but it asks for API key and phpVMS URL. in documentation it says go to your phpVMS profile but ı dont know how do ı acsees my phpVMS profile can someone help to me please? and the is the phpVMS url virtual Airline website?

     

    I do not know, why you (and most of other lovely human beings) insist on not reading the docs :( Do we have to link the docs to every question ?

     

    https://docs.phpvms.net/acars/install-client#client-config

    • Thanks 1
  16. Yeah, you asked a similar question two weeks ago ... We gave the same answer. You need to check what they offer and compare it to phpvms v7 requirements. We can not do that for you sorry :( 

     

    If you wish, you can ask to their support by copy / pasting the requirements or just providing them the docs/requirements link to get a proper answer.

     

    Hope you figure it out 'cause once you know the results, rest will be following the docs for install (or looking for another provider).

  17. 9 minutes ago, igusim said:

    Hi guys ı am starting up a virtual airline whith Wix. I have The Wix paid hosting whith everythying unlimited. I did everything but ı dont know how to add the crewcenter to wix? How can ı?

     

    Do they support, php 7.3 and up ?

    Do they offer MySQL and/or MariaDB ?

    Do they have all required php extensions installed and enabled ?

    Do they have a control panel for you, where you can upload files, create subdomains, manage databases etc.

     

    Simply, do their services meet PhpVms v7 requirements ?

     

    If so, then follow docs and you will be fine ... If they fail any of the requirements, consider finding yourself a proper hosting service provider.

     

    https://docs.phpvms.net/

  18. 10 hours ago, Jimmy_S said:

    How can I add some downloads to the download page? I looked in the Admin Panel but don't see how to do it. Thanks.

     

    Jimmy

    crew.braniffvirtual.com

     

    admin -> airports or admin -> airlines or admin -> fleet or admin -> fleet -> aircraft

    When editing any of them scroll down and you will see what you are looking for.

     

  19. Pilots has nothing to do with the server side stuff ... And it is not necessary to worry about it.

     

    What they need is first unpack the package to a folder, then to follow simulator side procedures first (like installing the xplane plugin, or installing fsuipc + makerunways.exe for fsx/prepar etc) and after this step double clicking the Acars.exe (or make a shortcut for it to their desktop for ease of access)

     

    If you wish you can provide a step by step guide to your pilots to follow for installing ;)

     

    Safe flights

  20. If you are asking about creating a template/skin for phpvms v7 with some other (pre defined templating) tools ... Then this is also possible but again you need to make your website compatible with what phpvms v7 templates need.

     

    Mainly you need to deal with Laravel Blade at that point , also again from docs -> https://docs.phpvms.net/customize/layouts

     

    Hope these help you to find an answer to your questions

     

  21. On 7/13/2021 at 11:35 PM, Vetrro said:

    We have a custom field in the pirep area and if I remove the field pireps file fine again but I would like to keep the field if I could. I tried re-adding the field after deleting it and it still has the issue.  So by the error saying it cant find the custom field is that meaning It cant find it on the pirep creation page? Or does it mean that it cant find some other way. Sorry if I'm frustrating to answer but I'm not too good with code stuff as of yet lol

    As for the custom field it is showing up on the pirep creation page as a field and can be filled out. I've included images of what I mean not sure if it is any help at all though shows the field that is created in the admin panel and then the field showing up on the pirep creation page.

    Thanks for the reply at least I understand what's causing the issue now I just still don't know how to get a fix in.

     

    Sorry for the late reply, I totally forgot this message :(

     

    Can you please change that fields name to CI or CostIndex (no spaces between Cost and Index) and try, the error may be related to the space being used in the name. If this does not help, we may look further.

     

  22. On 7/12/2021 at 2:32 PM, Vetrro said:

    Whenever a pirep is submitted it throws out this error:   "Trying to get property 'name' of non-object"

     

     

    That line belongs to the code part of "custom" pirep fields which are defined by the va admin (probably by you).

     

        /**
         * Update any custom PIREP fields
         *
         * @param string            $pirep_id
         * @param PirepFieldValue[] $field_values
         */
        public function updateCustomFields(string $pirep_id, array $field_values): void
        {
            if (!$field_values || empty($field_values)) {
                return;
            }
    
            foreach ($field_values as $fv) {
                PirepFieldValue::updateOrCreate(
                    ['pirep_id' => $pirep_id, 'name' => $fv->name], // This is line 577 your error refers
                    ['value' => $fv->value, 'source' => $fv->source]
                );
            }
        }

     

    What that errors says is this "You want me to use the name of a custom field, but I can not find the that custom field itself"

     

    I would suggest checking your custom fields defined for pireps first.

    • Like 1
×
×
  • Create New...