Jump to content

Nascoli

Members
  • Posts

    36
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Nascoli

  1. On 1/13/2023 at 1:13 PM, Atcarrillo said:

    @Nascoli So we got that module install, had to fix a few things but I am getting this erro code “PHP Warning:  Missing argument 2 for SMPirepValidator::clearField(), called in /core/modules/SMPirepValidator/SMPirepValidator.php on line 61 and defined in /core/modules/SMPirepValidator/SMPirepValidator.php on line 199”

     

    this is the code that we have 

    3E432F72-AE03-4C54-B926-58546700B8D1.jpeg

    7724BF91-4BE1-44B2-8EEC-7F97078D917D.jpeg

     

    Thanks for your report. I have uploaded a new version which is currently in use and without any errors.


    This module was tested on PHP 7.4 and phpVMS v5.5.2.72 @ProAvia.

     

    • Thanks 1
  2. It's really a shame what's happening with CrazyCreatives. By the way, now I can't even access my login area and I can't even reset my password.

     

    I started to develop modules for the community based on my needs. These modules modules are being tested in phpvms 5.5.7.2 and PHP 7.4 versions.

     

    Unfortunately, due to my available time, I can't produce faster.

  3. Hi Folks,

     

    So, I scanned the PHP code and got the result. Let´s go!
    You can do a quick test using Postman. If you don't have it yet, download it here: https://www.postman.com/downloads/

    You need to create an account and password to use it, it's free!

     

    See the attached print of my postman that will guide the explanation.

     

    1. Define the method, in this case GET, as I want to bring the list of pilots.
    2. Enter your URL remembering to put the folder where your phpVMS is installed.
    3. Click Authorization tab

    4. Choose the type of authorization, in this case Basic Auth

    5. Enter your username. This is where I was wrong and it's not clear from the API documentation. Your username is your ID and not your callsign used when you log into phpVMS. So, ID is the number (unless zeros) that after airline code. Example: My login callsign is XYZ0001, so my username is 1.

    6. Type your password

     

    Finally, I got a positive response!

     

    Captura de tela 2021-12-14 18.01.48.png

     

     

    Here's an example of the PHP code you can make inside your phpVMS using cURL

     

    <?php

    ob_start();

    $user = 'type your User ID number';

    $pass = 'type your password';

    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, 'https://{your website}/{phpvms folder}/index.php/api/pilots');

    curl_setopt($ch, CURLOPT_HEADER, 0);

    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Basic '.base64_encode($user.':'.$pass)));

    curl_exec($ch);

    $result = ob_get_contents();

    ob_end_clean();

    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

    curl_close($ch);

    header("Content-Type: text/html;

    charset=utf8");

    echo "$httpCode<br>$result";

     

    I hope I've helped!👍

     

     

  4. Tom is there?

    This definitely doesn't work for me. Unless I delete line 81 as presented above by #JefferssonSantos, even using Authorization Basic

    On 12/3/2020 at 11:53 PM, JefferssonSantos said:

    There's a file called core/modules/api/api.php. Inside that file, there's a function called "private static function setup()". Comment the line 81(self::checkUser();) and you'll be able to use this API without Verification. Sorry for my english.

     

  5.  

    Hi guys, I'm making this module available for free. Enjoy!

     

    Bug report: contatct@smartmodules.com.br

     

     

    Feel free to contribute improvements! 😉

     

    Download: https://github.com/smmodules/SMPirepValidator

     

    /**
     * SMPirepValidator v.1.3 for phpVMS (tested under PHP 7.4 and phpVMS v5.5.2.72 by @ProAvia)
     * @description This module aims to validate if the pilot made his flights online on the IVAO and VATSIM networks
     *
     * SmartModules addon module for phpVMS virtual airline system
     * @link https://smartmodules.com.br
     *
     * SmartModules addon modules are licensed under the following license:
     * Creative Commons Attribution Non-commercial Share Alike (by-nc-sa)
     * To view full license text visit http://creativecommons.org/licenses/by-nc-sa/3.0/
     *
     * @author Ton Nascoli (SmartModules)
     * @copyright Copyright (c) 2021, Ton Nascoli
     * @license http://creativecommons.org/licenses/by-nc-sa/3.0/
     */

     

    Install:
    1. Download the ZIP file in your computer
    2. Extract the zip file into a folder of your choice
    3. Go to the folder where you extracted the files and access the phpvms_content folder
    4. Upload the ADMIN and CORE folders to your website by placing them in the phpvms root folder
    5. If asked to replace files, click YES


    Install sm_onlinelog.sql
    Just import the sm_onlinelog.sql file using your PhpMyAdmin


    CRON JOB
    This is the commonly used command line. If in doubt, consult your host provider

    /usr/bin/GET https://{your_website}/{your_phpvms_folder}/action.php/SMPirepValidator/run_check


    How does work?
    After you enable CRON JOB, the module will add all the pilot's flight logs to the sm_onlinelog table.
    When validating the PIREP, the system will show if the LOG was found and will enable the administrator
    to see the LOG of the flight performed at IVAO/VATSIM.

    ENJOY!!!!


    NOTE

    • Tested under PHP 7.4 and phpVMS v5.5.2.72 (by @ProAvia)
    • We made a little bit change to the original code of the pirep_list.php file to allow the IVAO / VATSIM flight log to be presented when validating PIREP. Therefore, it is important that you back up your file. This file is in the admin/templates folder. We have provided a backup of the original file in the bkp_original_file folder.

    Captura de tela 2021-10-23 12.31.40.png

    Captura de tela 2021-10-23 12.33.16.png

  6. On 5/15/2021 at 6:56 PM, ProAvia said:

    The website is online. You can purchase items, but support has been less than stellar.

     

    Since their offerings are payware, you cannot ask specific support questions here in the open forum. You can state the module you are having issues with and ask that anyone having the same module contact you via PM - where you can ask more specific questions. Use caution and be sure that the other person actually has the same module.

     

    Ok, thank you!

  7. On 5/11/2021 at 6:58 PM, DisposableHero said:

     

     

    Just do not use the default/provided root folder ... Create a new folder in your drive like My Projects, define it as your second Document Root, switch to that document root from laragon menu (needed just once) then under that document root, create another folder like phpvms , then click the reload button from Laragon main window.

     

    It will instantly recognize it as a new virtual host, and you will be able to access that project folder like http://phpvms.test , that will also let most of the features of phpvms work (like airport lookup, weather updates etc)

     

    Hope these tips help,

     

     

    laragon2.png.73eb6a3199c00b1b68e2073cf568f1bf.png

     

     

     

    Great! It´s does work now! Easy!

    Tks a Lot!

    • Like 1
  8. 16 hours ago, DisposableHero said:

     

     

    Just do not use the default/provided root folder ... Create a new folder in your drive like My Projects, define it as your second Document Root, switch to that document root from laragon menu (needed just once) then under that document root, create another folder like phpvms , then click the reload button from Laragon main window.

     

    It will instantly recognize it as a new virtual host, and you will be able to access that project folder like http://phpvms.test , that will also let most of the features of phpvms work (like airport lookup, weather updates etc)

     

    Hope these tips help,

     

     

    laragon2.png.73eb6a3199c00b1b68e2073cf568f1bf.png

     

     

     

    Tkss a Lot!!! I´ll try!

  9. 1 hour ago, DisposableHero said:

    I had similar errors with XAMPP, thus used WAMP first (with virtual host configuration) then switched to Laragon (which is much faster and capable of things compared to XAMP and WAMP).

     

    Though i saw some friends using XAMMP for their local tests but I never asked how they managed to get it work. If possible try Wamp or Laragon.

     

    OK thanks! I will try Laragon. I tried Laradoc, but I had the same problem!

  10. Hi guys, I have a problem installing. After following all the steps in the DOC, I installed phphVMS7 on my own machine (localhost). After installation, I typed https: // localhost / phpvms / public / and a screen with the <Head on to the installer> button appears. However, when I click on this button, instead of going to the installation screen, the system redirects me to PhpMyAdmin. Would anyone know what the problem is?

     

     

    I am using XAMPP with PHP v7.4.18

     

    1134715910_2021-05-10(1).thumb.png.6a225e609f5cfe774f4eb6c08539d9f3.png1757075325_2021-05-10(2).thumb.png.e792a49b2d55e252d64c0e7a3456d864.png

  11. 8 minutes ago, Strider said:

    Looks like it is trying to get a template that it cant find. And by some of the errors it is having problems with SSL, if you use SSLthere are some files that need to be edited. I don't know this module, b ut if it is trying to get info from an external source, and you are not connected to the internet it could cause problems. What module are you trying to use? As I cant find smartmodules on their site.

     

     

    I am using CrazySkin01_Jetset. It is a CC module for customizing PHPVMS Skin.

  12. 24 minutes ago, ProAvia said:

    Support from CC has been less than ideal for some time. No idea why.

     

    As to your issue... what are the contents of layout.php on line 113 ?

    That may be the key to your issue.

     

     

    Hi ProAvia,

     

    On line 113 it tries to load the XML file:

     

     

    <?php $xml2=simplexml_load_file(SITE_URL."/lib/skins/crazyskin01/css/navigationstyles.xml");

     

     

  13. SMRoutes - phpVMS Module by SmartModules

     

    Hi guys, I would like to announce that soon (July, 30th) I will be launching SMRoutes, the first SmartModules module for phpVMS.

    SmartModules launches its first module for the Virtual Airlines community. Who has never had trouble creating routes?

    SMRoutes is easy, friendly and automates routes creation and no interfering with your phpVMS.

     

    It is worth checking. The full module will be paid for, but there will be a free version for download with less functionality.

     

    Watch the video! 😉

     

    Video: https://youtu.be/K9bCeF8qnOM

     

    Website: https://smartmodules.com.br

  14. 9 hours ago, gio1961 said:

    I remember making a change to the skin a long time ago, but honestly I don't remember what I changed. If the solution comes to mind.
    However this is my code and as you can see from the image the notice is placed where I wanted.

    
    <?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
    <div class="box-body">
    <div class="block">
    <div class="block-title">
    <h4><i class="fa fa-paper-plane"></i> <strong>File</strong> Manual PIREP</h4>
    </div>
                        <?php
                            if(isset($message))
                                echo '<div class="callout callout-warning">
                                <h4>Error</h4>
                                <p>'.$message.'</p></div>';
                        ?>
                        
                        <form action="<?php echo url('/pireps/mine');?>" method="post">
                            <div class="form-group">
                                <label>Pilot</label>
                                <input type="text" class="form-control" disabled placeholder="<?php echo Auth::$userinfo->firstname . ' ' . Auth::$userinfo->lastname;?>">
                            </div>
                            <div class="form-group">
                                <label>Airline</label>
                                <select name="code" id="code" class="form-control">
                                    <option value="">Select airline</option>
                                    <?php
                                        foreach($allairlines as $airline)
                                        {
                                            $sel = ($_POST['code'] == $airline->code || $bid->code == $airline->code)?'selected':'';
                                            echo '<option value="'.$airline->code.'" '.$sel.'>'.$airline->code.' - '.$airline->name.'</option>';
                                        }
                                    ?>
                                </select>
                            </div>
                            <div class="form-group">
                                <label>Flight Number</label>
                                <input type="text" name="flightnum" class="form-control" value="<?php if(isset($bid->flightnum)) { echo $bid->flightnum; }?><?php if(isset($_POST['flightnum'])) { echo $_POST['flightnum'];} ?>">
                            </div>
                            <div class="form-group">
                                <label>Departure Airport</label>
                                <select id="depicao" name="depicao" class="form-control">
                                    <option value="">Select departure airport</option>
                                    <?php
                                        foreach($allairports as $airport)
                                        {
                                            $sel = ($_POST['depicao'] == $airport->icao || $bid->depicao == $airport->icao)?'selected':'';
                                            echo '<option value="'.$airport->icao.'" '.$sel.'>'.$airport->icao . ' - '.$airport->name .'</option>';
                                        }
                                    ?>
                                </select>
                            </div>
                            <div class="form-group">
                                <label>Arrival Airport</label>
                                <select name="arricao" id="arricao" class="form-control">
                                    <option value="">Select arrival airport</option>
                                    <?php
                                        foreach($allairports as $airport)
                                        {
                                            $sel = ($_POST['arricao'] == $airport->icao || $bid->arricao == $airport->icao)?'selected':'';
                                            echo '<option value="'.$airport->icao.'" '.$sel.'>'.$airport->icao . ' - '.$airport->name .'</option>';
                                        }
                                    ?>
                                </select>
                            </div>
                            <div class="form-group">
                                <label>Aircraft</label>
                                <select name="aircraft" id="aircraft" class="form-control">
                                    <option value="">Select aircraft</option>
                                    <?php
                                        foreach($allaircraft as $aircraft)
                                        {
                                            /*	Skip any aircraft which have aircraft that the pilot
                                                is not rated to fly (according to RANK) 
                                            */
                                            if(Config::Get('RESTRICT_AIRCRAFT_RANKS') === true)
                                            {
                                                /*	This means the aircraft rank level is higher than
                                                    what the pilot's ranklevel, so just do "continue"
                                                    and move onto the next route in the list 
                                                 */
                                                if($aircraft->ranklevel > Auth::$userinfo->ranklevel)
                                                {
                                                    continue;
                                                }
                                            }
                                            $sel = ($_POST['aircraft'] == $aircraft->name || $bid->registration == $aircraft->registration)?'selected':'';
                                            echo '<option value="'.$aircraft->id.'" '.$sel.'>'.$aircraft->name.' - '.$aircraft->registration.'</option>';
                                        }
                                    ?>
                                </select>
                            </div>
                            
                            <?php
                            // List all of the custom PIREP fields
                            if(!$pirepfields) $pirepfields = array();
                            foreach($pirepfields as $field)
                            {
                            ?>
                            <div class="form-group"></div>
                            <label><?php echo $field->title ?></label>
                            <?php
                            // Determine field by the type
                            if($field->type == '' || $field->type == 'text')
                            {
                            ?>
                                <input type="text" name="<?php echo $field->name ?>" value="<?php echo $_POST[$field->name] ?>" class="form-control" />
                            <?php
                            } 
                            elseif($field->type == 'textarea')
                            {
                                echo '<textarea name="'.$field->name.'" class="form-control">'.$field->values.'</textarea>';
                            }
                            elseif($field->type == 'dropdown')
                            {
                                $values = explode(',', $field->options);
                                echo '<select name="'.$field->name.'" class="form-control">';
                                foreach($values as $value)
                                {
                                    $value = trim($value);
                                    echo '<option value="'.$value.'">'.$value.'</option>';
                                }
                                echo '</select>';		
                            }
                            ?>
                            <?php } ?>
                            
                            <div class="form-group">
                                <label>Fuel Used</label>
                                <input type="text" name="fuelused" class="form-control" placeholder="Enter fuel used in <?php echo Config::Get('LIQUID_UNIT_NAMES', Config::Get('LiquidUnit'))?>" value="<?php echo $_POST['fuelused']; ?>" />
                                <p>This is the fuel used on this flight in <?php echo Config::Get('LIQUID_UNIT_NAMES', Config::Get('LiquidUnit'))?></p>
                            </div>
                            <div class="form-group">
                                <label>Flight Time</label>
                                <input type="text" name="flighttime" class="form-control" placeholder="Enter in format HH.MM (example 3.45 = 3 hours and 45 minutes)" value="<?php echo $_POST['flighttime'] ?>" />
                            </div>
                            <div class="form-group">
                                <label>Route</label>
                                <textarea name="route" class="form-control" style="width: 100%" placeholder="Enter the route flown, or default will be from the schedule"><?php echo (!isset($_POST['route'])) ? $bid->route : $_POST['route']; ?></textarea>
                            </div>
                            <div class="form-group">
                                <label>Comments</label>
                                <textarea name="comment" class="form-control" style="width: 100%"><?php echo $_POST['comment'] ?></textarea>
                            </div>
                            <input type="hidden" name="bid" value="<?php echo $bidid ?>" />
                            <input type="submit" name="submit_pirep" value="Submit" class="btn btn-danger btn-block btn-flat" style="width:120px;" />
                        </form>
    <br />
     
    </div></div>

     

    PIREP.jpg

     

    Great! 

    Thank you for sending me! I'll take a look at your code and post it here if I can solve it.

    Question: What is the name of the file you changed? Is this PIREP_NEW.PHP?

  15. 11 hours ago, ProAvia said:

    Looking at your first and last images, it appears that the wording has move a bit to the right. Maybe add a few more spaces (&nbsp;).

     

    Just to be certain we are all looking at the same thing - the words "You must fill out all of the required fields!" are slightly further to the right in the last image compared to the first image. Another 5-10 spaces will line the "Y" in "You..." up with the icon directly below it.

     

    Thanks for the link to the base skin template! 

     

    Hi,

     

     

    I'm so sorry. I forgot to explain how I did it. In fact, the text is now inside the CONTAINER, but I did it by changing the LAYOUT.PHP file as shown below. However, I can't even change the layout or color of the text or anything like that.

     

    /*    Auth::$userinfo has the information about the user currently logged in
            We will use this next line - this gets their full pilot id, formatted properly */

    Template::Show('core_navigation.php');?>
    <div class="content-wrapper">
         <?php echo $page_content;?>
    </div>

×
×
  • Create New...