Jump to content

web541

Members
  • Posts

    700
  • Joined

  • Last visited

  • Days Won

    17

Posts posted by web541

  1. 5 hours ago, PetitJedi said:

    As I said in the introduction to my post, I am in version 5.5 and php 5.6

    Oops I must have skimmed over that, I just took it from the lines that the error was occurring and just assumed.

     

    5 hours ago, PetitJedi said:

    For the color of the permission error, no it is not red.
    Here is the code if it helps you in terms of color (brown and blue)

    Ahh yeah that's definitely a phpVMS error and not a PHP one (even though there were PHP ones that you stated) which could indicate a problem with your database.

     

    5 hours ago, PetitJedi said:

    and more specifically to:

    Are you sure? Line 153 here https://github.com/DavidJClark/phpvms_5.5.x/blob/master/core/common/StatsData.class.php#L153 looks like this:

    $year = date('Y', $start); # Get the months

    which is very similar. I think it is probably an issue with your database or at least one of the tables, have you installed recently or have you been running it for a while? That line and the non-numeric error is saying that it cannot find the date your VA started (or it cannot interpret it), and when it can't do that it will try and get the date of the first PIREP submitted. Have you had access to the admin panel before this or did it just pop up?

     

    And just to check, the timezone issue is now gone?

  2. 7 hours ago, PetitJedi said:

    date.timezone = Europe/Paris

    What version of phpVMS are you using? I think you are using v2 so go to this line:

    https://github.com/phpvms/phpvms_v2/blob/master/core/common/StatsData.class.php#L137

    and before it, put this:

    date_default_timezone_set("Europe/Paris");

    and see if that makes any difference.

     

    7 hours ago, PetitJedi said:

    What permissions does he need? on which folder or file because nothing specified: '(

    Was this writing red by and chance? I think it may be referring to the admin panel's permissions if it's thrown an exception. You could setting 777 to the cache folder only but I don't think it's related.

  3. 4 hours ago, Strider said:

    By the sounds it, the code is getting the information sent to it wrong, and instead of showing the flights, it is showing the no routes found. Sometimes it is just a simple change of code in the if/else statement.

    Definitely a possibility but in this case I've taken code from Jeffery's original module and changed the template rendering in the module, so the module logic itself remains untouched. I haven't heard anyone else having issues with it so far so I can only assume it could be a schedules issue or a conflict with the schedules module being used.

  4. 11 hours ago, ProAvia said:

    Doesn't it need a 

    
    foreach $pilots as $pilot

    in there somewhere to be able to get $pilot->pilotid from the pilots database table? pilots table being plural and pilot being singular......

    As long as you pass in a pilot id as the first parameter of PilotData::GetFieldValue() it shouldn't matter where you put it or if you use it in a loop.

     

    1 hour ago, FlyingMachine said:

    I have the code of custom field on Pilot list page, works perfect, i would like to show the same filed on pending pireps, next to full name check my code.

     

    1 hour ago, FlyingMachine said:

    To display the custom filed.

     

    I have checked your code, you have provided this:

    <!-- Here i would like to show VATSIM or IVAO ID using the following code -->
         l <?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM CID or IVAO VID'); ?>

    As I stated above, if you want it to work inside of your pireps page ($pireps loop as you provided) then you will need to swap that line for this one (as I already provided above):

    <?php echo PilotData::GetFieldValue($pirep->pilotid, 'VATSIM CID'); ?>

    where VATSIM CID is the name of your custom field. Note the change from $pilot to $pirep. If this isn't what you are after then please give further explanation/code so we can help you out.

    • Thanks 1
  5. How are you handling the form data in your create() method? Are you using $request->all() by any chance? If you are then that would be why the _token is showing as it's part of the request (as you already know). From my understanding, if you are going to use $request->all() you should specify your fields/column names that you will be using as part of your $fillable property on your model. Like this

    https://github.com/nabeelio/phpvms/blob/dev/app/Models/Airline.php#L34

     

    That way (at least from my understanding), by using $request->all() you are only allowing the fields you have specified in $fillable to be modified in your database, so you are protected from anyone adding a hidden input field into your form for example. This will also allow you to use it without getting that '_token column not found' error as it's not specified in your $fillable property. But @Nabeel can confirm this.

  6. The 'method' => 'patch', part of the Form::model(...) means you would have to declare it as a PATCH instead of a POST.

    So does something like this work (obviously change airport to whatever you are using)?

     

    Route::patch('staff/update/{id}', 'AdminController@update')->name('update');
    {{ Form::model($airport, [
    	'route' => ['YOURMODULEPREFIX.update', $airport->id],
    	'method' => 'patch',
    	'id' => 'airportForm'])
    }}

    The name('update') bit is what the route() uses to get the name, so by default it should be MODULENAME.update or (::) but it might not be working right now because of the issue.

  7. What's your routes that you have put in Routes/web.php (or AppServiceProvider)?

     

    Edit: Just saw you posted at the same time haha. It could be related to the module issue on github, but what routes have you defined? Also, did it throw any errors or just a "Page Not Found"?

  8. Really? I thought he was using the LaravelCollective HTML linked above?

    Here's his airports example.

    1. https://github.com/nabeelio/phpvms/blob/dev/app/Http/Controllers/Admin/AirportController.php#L125 << Fetches the airport, sets the variable for use in the view and shows the view.

    2. https://github.com/nabeelio/phpvms/blob/dev/resources/views/admin/airports/edit.blade.php#L6 << In the view, he defines the model binding (note the $airport) which should fill in the fields and match up the fieldname with the column name in the database.

    3. https://github.com/nabeelio/phpvms/blob/dev/resources/views/admin/airports/fields.blade.php << His fields are defined here.

     

    Does that help a bit more?

  9. 20 minutes ago, nickkecooper said:

    Now how to fill in the input fields when you on an edit screen 

    As in filling the inputs in your form at URL.com/.../edit? You should be able to do something like this:

    <div class="form-group">
      {{ Form::label('FIELDNAME', 'FIELDNAME TEXT TO DISPLAY:') }} <span class="required">*</span>
      {{ Form::text('FIELDNAME', null, ['class' => 'form-control']) }}
      <p class="text-danger">{{ $errors->first('FIELDNAME') }}</p>
    </div>

    and it should auto-fill the values based on the model data (e.g. $users) you have, provided you have setup the Form::model().. binding before this. For more info, checkout how Nabeel does it in the admin area (airports for example), or view the Collective HTML docs here.

     

    If you wanted to make it more traditional, you could also do something like this:

    <form action="{{ route('/users', $user->id) }}" method="post">
      @csrf
      @method('PUT') OR PATCH
      
      <div class="form-group">
        	<label for="...">FIELDNAME TO DISPLAY</label>
        	<input type="text" name="FIELDNAME" id="..." class="form-control" value="{{ old('FIELDNAME', DEFAULT VALUE) }}" /> OLD will display the last data the user has entered if it fails validation.
            @errors fields...
      </div>
    </form>

     

    • Thanks 1
  10. 1 hour ago, nickkecooper said:

    Do you happen to know a good way to insert into the database?

    I would get the form values from the submission using a Request (or App\Requests\Request...) $request, then I would validate it using $request->validate([...]) (although it might be done automatically), then call $this->REPO->create([..]) to insert it.

     

    1 hour ago, nickkecooper said:

    But having an issue on finding where findWithoutFail functions are stored. 

    Not sure what you mean here, if it's where the code actually is, it should be here

    https://github.com/nabeelio/phpvms/blob/dev/app/Contracts/Repository.php#L19

  11. 9 hours ago, LuxuryCEO said:

    The thing on the phpvms7 installer didn't work for me soo

    You mean when you go to install, you click "Importing from a legacy install"? I thought that was fixed now (or at least in its prelim stages). Which part of it didn't work and were there any errors? Yeah you could do it the way @LeonardIGO4036 suggested, but the installer should be the easiest way of doing it.

    • Like 1
    • Thanks 1
  12. Not sure if it's the right way of doing it, but I've had success doing it like this:

    private $userRepo;
    
    /**
    * @param UserRepository $userRepo
    */
    public function __construct(UserRepository $userRepo)
    {
    	$this->userRepo = $userRepo;
    }
    
    /**
     * Display a listing of the resource.
     */
    public function index()
    {
        $where = [];
    
        if (setting('pilots.hide_inactive')) {
        	$where['state'] = UserState::ACTIVE;
        }
    
        try {
        	$users = $this->userRepo
        		->with(['airline', 'current_airport'])
        		->orderBy('pilot_id', 'desc')
        		->findWhere($where);
    
        } catch (RepositoryException $e) {
        	Log::emergency($e);
        }
    
        return view('staff::admin.index', [
            'users'   => $users,
        ]);
    }

    Also, not sure what you plan on doing but I would usually keep any $request for its own method other than index unless there's a reason to keep it in.

  13. 23 minutes ago, ProAvia said:

    Hmm - the link you provided works for me. And I can also view the live map.

    I think he was referring to the /update route on his site.

     

    3 hours ago, LuxuryCEO said:

    HTTP 500 error

    That’s odd... the website can’t display this page

    I've posted an issue on Github and the updater is getting some updates (ironic haha) so it's likely you will have to wait until a beta 5 and manually install it before the auto updates will work again. Still being tested.

  14. If the live data isn't being shown when you converted to Leaflet/OSM and you do have active flights (pilots using ACARS) then there's something wrong. When they are connected through ACARS, do you see any data in your phpvms_acars table in your database?

     

    Also, check your browser console for any errors as it may show something if it's Leaflet related.

  15. 21 hours ago, LuxuryCEO said:

    I get the fallowing image when I go to the admin side after I login

     

    That's weird, are you using the latest beta release? It seems to be failing as it can't correctly pick up/store the latest version number. It could be a permissions issue on the storage folder, if you refresh the admin do you have a kvp.json file in the Storage\app directory?

  16. What phpVMS, PHP & MySQL versions are you running? I remember having the same issue a while back when I was testing, but I never got around to finding the issue. Potentially check that the versions are exactly the same in your new host to your old host as even a slight change could cause something like this to happen.

     

    Also, check your DB details are correct in your local.config.php file, but I suspect you already have as the Tour bids are going through and the site isn't blowing up with errors.

     

    And check your browser console for any JS errors, as some of the bidding logic (buttons) is done via JS.

×
×
  • Create New...