Jump to content

web541

Members
  • Posts

    700
  • Joined

  • Last visited

  • Days Won

    17

Posts posted by web541

  1. 5 hours ago, djtiger76 said:

    Module is working fine, I am trying to show pictures on my dashboard (outside of the screenshot center): 
    Deprecated: Non-static method Screenshots::show_newest_screenshot() should not be called statically, assuming $this from incompatible context in /home/tstamer/public_html/crew/lib/skins/crewcenter/profile_main.php on line 167

    You'll want to make sure in core/common/ScreenshotsData.class.php (or similar named file), all the

    public function xxx()...

    are changed to (note the word static)

    public static function xxx()...

     

    Then if that doesn't work, instead of this

    <?php Screenshots::show_newest_screenshot(); ?>

    Try this

    <?php
    $screenshot = new Screenshots();
    $screenshot->show_newest_screenshot();
    ?>

     

    • Thanks 1
  2. It seems to be working for me, have you tried the most up to date version on github? Also, you might be confused about the User ID:

    User ID: The ID of the user, but it remains the same in the database regardless of the change in the admin panel (to keep everything synced nicely across the app). This shouldn't be changed.

    Pilot ID: The Pilot ID of the User which is used to create the "callsign" you see (mix of Airline Code & Pilot ID). This can be changed in the admin panel and will update the callsign accordingly.

     

    If it's still not working, see if there are any errors in the laravel.log file and/or submit an issue on github

    • Like 1
  3. 8 hours ago, ncd200 said:

    Sorry to open an old topic, but is it also possible to show this on the public profile?

    It is showing but on all the pilots the same numbers

    Which graph are you looking to get? For the donut, you would have to change this

    'url': "<?php echo actionurl('/pilots/morrisstatsaircraftdata/'.Auth::$userinfo->pilotid.'');?>",

    to this

    'url': "<?php echo actionurl('/pilots/morrisstatsaircraftdata/'.$pilot->pilotid.'');?>",

     

    And similarly, for the monthly chart, you would have to replace this

    public function morrisstatsbymonthdata()
     {
    		 $data = PIREPData::getIntervalDataByMonth(array('p.pilotid'=>Auth::$userinfo->pilotid), 3);
    		 header("Content-type: application/json");
    		 echo json_encode($data);
     }

    with this

    public function morrisstatsbymonthdata($pilotid)
     {
    		 $data = PIREPData::getIntervalDataByMonth(array('p.pilotid'=> DB::escape($pilotid)), 3);
    		 header("Content-type: application/json");
    		 echo json_encode($data);
     }

    And this

    $.ajax({
        'async': false,
        'global': false,
        'url': "<?php echo actionurl('/pilots/morrisstatsbymonthdata');?>",
        'dataType': "json",
        'success': function(data) {
            json = data;
        }
    });
    return json;

    Replace with this

    $.ajax({
        'async': false,
        'global': false,
        'url': "<?php echo actionurl('/pilots/morrisstatsbymonthdata/'.$pilot->pilotid.'');?>",
        'dataType': "json",
        'success': function(data) {
            json = data;
        }
    });
    return json;

    and I would think that would work.

  4. Is there anything in your PHP error_log file?

    Also, not sure if that's from your code or from view source, but your include statements should look like this

    <?php
    include('/home/YOURUSERNAME/public_html/core/codon.config.php');
    include('/home/YOURUSERNAME/public_html/core/local.config.php');
    ?>

    where YOURUSERNAME should be your cPanel username (it could be FSV_phpvms?), you are on shared hosting?

    And confirm which version of phpVMS (v2 or 5.5.x) and PHP (5.5, 5.6, 7.0, etc.) you are using?

  5. It's really up to the VA to determine how their times are set. Ideally, it would be set at real time and the sim time would be the same as the real time, but it should be up to the VA to have a policy in place to make sure all times are uniform across the board (not mixing sim and real). It's also up to the VA to determine when it is appropriate to complete the flight, so there might be a policy that states you must fly the flight at the specified time, or it could be flown at any time.

  6. Yes @ProAvia is right, you have installed the skin incorrectly. Read his EDIT.

    Plus, the skin shouldn't have a core_htmlhead.php file anyway, that should remain in core/templates and should not be edited (unless absolutely necessary). Any JS that would need to be added should go into the layout.php file anyway.

  7. Yeah where did you get that code from? It looks like nothing is happening with these lines:

    path.push(L.latLng(nav.lat, nav.lng));
    points.push(loc);

    As in there's nothing in that snippet to say that they are being added to the map, although the navaids look like they should be showing up from the .addTo(map);

    Can you check that you've added that snipped in correctly? Also, what is actually missing right now (flight path or navaids), if anything?

  8. Provided that the route isn't empty, the `route_details` field should populate automatically as seen here https://github.com/DavidJClark/phpvms_5.5.x/blob/master/core/common/PIREPData.class.php#L643 which will then call NavData::parseRoute() leading to here where it finds the waypoint in your `_navdata` table https://github.com/DavidJClark/phpvms_5.5.x/blob/master/core/common/NavData.class.php#L311

    It's possible that it's not finding the waypoint in the table properly and thus not saving the route_details in PIREPData.

  9. What version of phpVMS do you have (which github link did you download it from?). It looks like the skin is incompatible with your phpVMS version (as in the skin has .tpl and your phpvMS is .php, or vice-versa), or if the developer has more than one version, you have downloaded the incorrect one for your setup.

  10. 7 minutes ago, nicky9499 said:

    I was thinking v7 would be suitable for the long term since the v5 to v7 migrator still has issues and v7 itself it reasonably complete.

    Really, it's up to you. The migrator should be fixed provided a stable version of v7 has officially been released. I believe it already migrates pilots, pireps, schedules and fleet across to some extent and the functionality will continue to be improved for the release as far as I'm aware.

    9 minutes ago, nicky9499 said:

    Can the git be obtained manually from github and uploaded to my server somehow?

    Check here https://forum.phpvms.net/topic/26778-700-beta-2/ that should give you the entire git with the vendor folder extracted. Bear in mind that it will need to be updated manually when Nabeel releases the next official version.

    • Like 1
  11. This is in the phpVMS v7 forum (which isn't completely stable yet). If you want a current, working version of phpVMS then I suggest uploading this https://github.com/DavidJClark/phpvms_5.5.x to your server and making sure your PHP version is compatible.

    If you are looking for phpVMS v7 to install, then follow these instructions http://docs.phpvms.net/setup/installation and just by chance, are you using ssh on your server?

  12. Have to agree on both answers for this one, smartCARS & TFDi don't use the raw data field (although they say their smartCARS v3 will have this capability, but who knows when this will be released). Theoretically, you could catch/make an acars live tracking event through another module or integrate it (and serialize) the data from smartCARS to get it to work, but there is no native solution. This looks similar to what CC have done, but I haven't used the module myself.

  13. 8 hours ago, Qshad said:

    I'm having problems with the installation of phpVMS 5.5. As soon as I finish the installation there is this error message:

    It looks like you're on PHP version 7.2/7.3, if you are able to I suggest changing to PHP 5.6 if possible (and still available from your host). Otherwise, you can try ProAvia's pack here https://github.com/ProAviaAZ/phpvms_5.5.2.72 and see if that works for you.

    The reason I say this is because that error

    8 hours ago, Qshad said:

    Deprecated: define(): Declaration of case-insensitive constants is deprecated

    Indicates the deprecation of the define(..,.., TRUE) and case-insensitive names in PHP 7.2^. You could try and change these lines

    define('OBJECT','OBJECT', true);
    define('ARRAY_A','ARRAY_A', true);
    define('ARRAY_N','ARRAY_N', true);

    to this

    define('OBJECT','OBJECT');
    define('ARRAY_A','ARRAY_A');
    define('ARRAY_N','ARRAY_N');

    But I would assume that there will be a few more errors within your phpVMS installation and possible database connection issues if your PHP version is high enough.

    • Thanks 1
  14. The acars data travels from your acars software to the `phpvms_acarsdata` table. This is then read by phpvms and is output in JSON format to SITEURL/action.php/acars/data.

    Then in lib/js/acarsmap.js this is loaded into the map using a JS AJAX call: https://github.com/nabeelio/phpvms_v2/blob/master/lib/js/acarsmap.js#L216

    Through a few more calls, this function is loaded as the time specified in the bottom of the acarsmap.php file (or specific to the template file you are using):

    refreshTime: 20000,

    Where 20000 is in milliseconds, therefore giving a 20 second refresh rate. Now every 20 seconds, the map (and table) will update using the populateMap() function here https://github.com/nabeelio/phpvms_v2/blob/master/lib/js/acarsmap.js#L141 as specified in the previous AJAX call.

     

    I haven't tried this myself, but I would think you would be able to just change this line https://github.com/nabeelio/phpvms_v2/blob/master/lib/js/acarsmap.js#L147 to

    if (data.length == 0) {
        $("#acars_map_table").hide(); // Or .css("display", "none");
        return false;
    }
    
    $("#acars_map_table").show(); // or .css("display", "block");

    And then in acarsmap.php add an id to the table, change this

    <script type="text/html" id="acars_map_bubble">
    <table width="250px">

    to this

    <script type="text/html" id="acars_map_bubble">
    <table width="250px" id="acars_map_table">

    And you would have to give the id to the table on the dashboard template as well.

    Hope you have some luck with this.

    • Thanks 1
  15. Which list of flights, the user side cards or the admin side? And what subfleet information are you looking for?

    If the user cards then try this:

    After this line: https://github.com/nabeelio/phpvms/blob/dev/resources/views/layouts/default/flights/table.blade.php#L57

    Add this:

    <h5 class="pt-2 mb-0">Available Subfleets:</h5>
    @if($flight->subfleets)
    	@foreach($flight->subfleets as $subfleet)
    		<span class="title">FLEET:&nbsp;</span>
    		{{ $subfleet->type }} - {{ $subfleet->name }}
    		<br />
    	@endforeach
    @endif

     

    • Like 2
  16. 51 minutes ago, Ither said:

    this-> editprofile just pulls back up previous data

    Had a suspicion that would be the case.

    On the same line (The one that you just put in, Auth::$pilot = $pilot;), try and replace it with this:

    Auth::$pilot = PilotData::getPilotData($pilot->pilotid);

     

    If that doesn't work, try and replace these 3 functions and see if that works for you

     
    
    	public function index()
    	{
    		if(!Auth::LoggedIn()) {
    			$this->set('message', 'You must be logged in to access this feature!');
    			$this->render('core_error.php');
    			return;
    		}
    
    		/*
    		 * This is from /profile/editprofile
    		 */
    		 if(isset($this->post->action)) {
    			if($this->post->action == 'saveprofile') {
    				$this->save_profile_post();
    				return;
    			}
    
    			/* this comes from /profile/changepassword
    			*/
    			if($this->post->action == 'changepassword') {
    				$this->change_password_post();
    			}
    		}
    
            $pilot = PilotData::getPilotData(Auth::$pilot->pilotid);
    
    		if(Config::Get('TRANSFER_HOURS_IN_RANKS') == true) {
    			$totalhours = $pilot->totalhours + $pilot->transferhours;
    		} else {
    			$totalhours = $pilot->totalhours;
    		}
    
    		$this->set('pilotcode', PilotData::getPilotCode($pilot->code, $pilot->pilotid));
    		$this->set('report', PIREPData::getLastReports($pilot->pilotid));
    		$this->set('nextrank', RanksData::getNextRank($totalhours));
    		$this->set('allawards', AwardsData::getPilotAwards($pilot->pilotid));
    		$this->set('userinfo', $pilot);
            $this->set('pilot', $pilot);
    		$this->set('pilot_hours', $totalhours);
    
    		$this->render('profile_main.php');
    
    		CodonEvent::Dispatch('profile_viewed', 'Profile');
    	}

     

    
    	public function editprofile()
    	{
    		if(!Auth::LoggedIn()) {
    			$this->set('message', 'You must be logged in to access this feature!');
    			$this->render('core_error.php');
    			return;
    		}
    
    		$p = PilotData::getPilotData(Auth::$pilotid);
    		$this->set('userinfo', $p);
            $this->set('pilot', $p);
    		$this->set('customfields', PilotData::getFieldData($p->pilotid, true));
    		$this->set('bgimages', PilotData::getBackgroundImages());
    		$this->set('countries', Countries::getAllCountries());
    		$this->set('pilotcode', PilotData::getPilotCode($p->code, $p->pilotid));
    
    		$this->render('profile_edit.php');
    	}
    
    	protected function save_profile_post()
    	{
    		if(!Auth::LoggedIn()) {
    			$this->set('message', 'You must be logged in to access this feature!');
    			$this->render('core_error.php');
    			return;
    		}
    
    		$pilot = Auth::$pilot;
    
    		//TODO: check email validity
    		if($this->post->email == '') {
    			$this->set('message', 'The email address cannot be blank.');
    			$this->render('core_error.php');
    			return;
    		}
    
    		$fields = RegistrationData::getCustomFields();
    
                    if(is_array($fields) || $fields instanceof Countable) {
                        if(count($fields) > 0) {
                            foreach ($fields as $field) {
                                $value = Vars::POST($field->fieldname);
                                    $value1 = DB::escape($value);
                                        if ($field->required == 1 && $value1 == '') {
                                            $this->set('message', ''.$field->title.' cannot be blank!');
                                            $this->render('core_error.php');
                                                return;
                                        }
                            }
                        }
    		}
    
    		$params = array(
    			'code' => $pilot->code,
    			'email' => $this->post->email,
    			'location' => $this->post->location,
    			'hub' => $pilot->hub,
    			'bgimage' => $this->post->bgimage,
    			'retired' => false
    		);
    
    		PilotData::updateProfile($pilot->pilotid, $params);
    		PilotData::SaveFields($pilot->pilotid, $_POST);
    
    		# Generate a fresh signature
    		PilotData::GenerateSignature($pilot->pilotid);
    
    		PilotData::SaveAvatar($pilot->code, $pilot->pilotid, $_FILES);
    
    		$this->set('message', 'Profile saved!');
    		$this->render('core_success.php');
    		$this->editProfile();
    	}
     

    [END SPOILER] 

     

    [END SPOILER] 

  17. 10 hours ago, Kursat said:

    How to select all planes, im looking for a solution on this topic

    What do you mean by this? It looks like it is correct as two A320 NEO aircraft are showing up.

    Are there supposed to be more planes showing up? Check that the aircraft have the correct ICAO (A20N) and airline (AKD) set in the admin panel.

    If you mean how can you book more than one plane, than that is not possible at the moment, nor is it realistic.

    If you mean how can you have every plane in the database show for a route (is there another module for that?) or more than one aircraft type per route, then this is also not possible at this stage, but I would consider it for a future update.

  18. What happens if you replace

    if($this->post->action == 'saveprofile') {
    	$this->save_profile_post();
    }

    with

    if($this->post->action == 'saveprofile') {
    	$this->save_profile_post();
    	$this->editProfile();
    	return;
    }

    Check if that has worked first, and if not try adding this:

    Auth::$pilot = $pilot;

    After this line in save_profile_post() function (around line 226)

    PilotData::SaveFields($pilot->pilotid, $_POST);

    That's a workaround (not ideal) so that the editProfile() function doesn't have to be changed slightly.

  19. On 12/26/2019 at 6:19 AM, Shadesb181 said:

    So the change i need is unlocking the pilot name at the top of the form. additionally, i need to make it a drop-down for all pilots within the VA. Any ideas? 

    8 hours ago, ProAvia said:

    how will admins be able to now enter the pilots ID to input the PIREP data for a specific pilot?

    Haven't tested this but this is one way to go about it. Go to here:

    https://github.com/DavidJClark/phpvms_5.5.x/blob/master/core/modules/PIREPS/PIREPS.php#L401

    And change it to

    $pilotid = $this->post->pilotid;

    Note: The pilot you are entering for must have a bid already.

    Here, https://github.com/DavidJClark/phpvms_5.5.x/blob/master/core/templates/pirep_new.php#L10

    You would need to change this to something like this

    <dd>
        <select name="pilotid">
            <option value="">Select a Pilot</option>
          	<?php
    		$allpilots = PilotData::getAllPilots();
    		foreach($allpilots as $pilot) {
       			echo '<option value="'.$pilot->pilotid.'">'.PilotData::getPilotCode($pilot->code, $pilot->pilotid).' - '.$pilot->firstname.' '.$pilot->lastname.'</option>';
    		}
    		?>
        </select>
    </dd>

    You may also have to alter the FilePIREPForm() function a little.

    This is answering the question, although I would recommend (if you have a lot of pilots) that you use a textbox and a JS AJAX request so that the list isn't really long and would require a lot of scrolling. Hope this helps in some way.

    Edit: Looks like Yash got there first.

    • Thanks 1
×
×
  • Create New...