Jump to content

ahughes3

Members
  • Posts

    205
  • Joined

  • Last visited

Posts posted by ahughes3

  1. Hi folks,

     

    I have been into the phpvms docs and tried to download the latest stable version but when I click the link, it just opens then immediately closes the page. I have been onto the github page but can't find where to download the zipped files. The page I land at says "don't download the beta". I'm not usually this stupid but can anyone provide a link, or guidance as to where to find the installation files.

     

    Thanks

    Andy

  2. Brilliant as ever Vangelis. A question......how do I set it so the times display two digit format with the leading zero for times less than 10?

    Vangelis, I would still like to sort this if possible. I've tried using the PHP letters for times with leading zeros but it makes no difference and just either breaks the form or ends up with a blank dropdown. If you can help, that would be great :)

  3. Ok so I have finally made the updates to my files and uploaded them to Github. Latest updates include:

    • Improved the time code as per Vangelis' suggestion.
    • Replaced the code for the fleet dropdown with Strider's dynamically called fleet, using Web541's amended version to avoid duplicate aircraft.
    • Added the "OperationsData.class.php" file to Github with the code necessary to make the dynamic fleet call work properly.
    • Updated the readme file to include installation of the "OperationsData.class.php" file.

    There is a readme which explains how to install the form and additional files needed to run things properly. I've tested the form and it works very nicely on my VA site.

    Thanks for your contribution guys! :)

  4. 1,2 are ok.

    3. I'm just uploading the install folder again to check this but I don't think it is the issue as everything else seems to be ok.

    4. Have already checked the PIREPData.class.php and that's exactly the same as the original installation and my backup.

    5. Have already looked at this and didn't see anything unusual but just going to check again for throroughness.

    Yes the pireps are recording and submitting fine apart from just the log field. The table field is empty yet smartcars is definitely capturing the information.

    Yes still with 123REG, it was easier to rebuild on there than move the entire site.

    Last real test is, as you say, to file a flight with kACARS. Just going to do that now. Will report back in a bit.

    Thanks

  5. So, I've hit on an unusual issue that has occurred as a result of having to rebuild my VA. My hosts 123REG, made a major stuff up and deleted a load of servers including ours. We've rebuilt it from a backup image but we've got a few odd things going on now.

    First and most important is that our pireps are now not recording anything in the "log" field of the pireps table in the database. I wondered if it could be to do with Smartcars but that is recording the details just fine and I've checked their scripts and they are all good and as they should be.

    I've checked to see if there are any errors being logged but there aren't. I'm not really sure what to check next.

    Can anyone suggest anything to look at to try and pinpoint the problem? Could it be a dataclass issue maybe?

    Thanks

    Harry

  6. Hi all,

    Apologies, I've been crazy busy with work and family. Plus I've just had to rebuild my VA after my host destroyed it due to an incompetent error. Good thing for backups!

    Ok so I can see there have been some additional suggestions to help pull the fleet info dynamically. Thanks for your input Web541 & Strider. Apologies Vangelis I didn't respond to you sooner, I've been away quite a bit.

    I will incorporate the additions into my files and upload them to github. There was also another issue I remember seeing on it but I can't think of it right now so I might come back to this thread if I remember and can't sort it myself.

    Thanks guys :)

  7. The airac supplied in the free simbrief account will be an out of date one. That is probably why it will give you a route that is different to what you want. You either need to buy and navigraph subscription to get the latest airac or, if you go to the simbrief website itself, you can use their dispatch centre and enter the route you want. It may throw errors though if waypoints are out of date.

  8. Yep, sorted it now thank you. Now showing the form correctly.

    Just noticed that the events module from you (crazy creatives) does the same thing. When trying to add a scheduled flight to an event, I get a php memory error. When I look at the code, it's the same issue. The function is trying to show all schedules. I was thinking, it would make more sense for the addflights.php file to also have a form which is preset with the depicao and the arricao and then the form shows only those routes that apply, rather than all routes. It's the function addflights1 that looks like it's calling all schedules.

    Would there be a way to stop all the schedules showing as with the above and just call the relevant schedules using the ICAOs?

  9. No it is The foreach Loop in schedule_results.php

    Ok, bear with me as I'm just learning PHP and just trying to understand this. I get the IF statement at the top of the page is just checking there are actually any routes. The bit further down in effect says, from the $schedules_list array, set each to $schedule. From this point all the echo statements are there just to show routes in separate entities on the resulting page. (tell me if I'm mistaken).

    So, I am assuming that for your comment, it would need to go inside the existing foreach statement in order to turn the already created $schedules variable into something else such as $whatever, yes? What I don't get, is how this would stop the routes still being shown.

    <?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
    <?php
    if(!$schedule_list)
    {
    echo '<p align="center">No routes have been found!</p>';
    return;
    }
    ?>
    <table id="tabledlist" class="tablesorter">
    <thead>
    <tr>
    <th>Flight Info</th>
    <th>Options</th>
    </tr>
    </thead>
    <tbody>
    <?php foreach($schedule_list as $schedule) { ?>
    <tr>
    <td>
     <a href="<?php echo url('/schedules/details/'.$schedule->id);?>"><?php echo $schedule->code . $schedule->flightnum?>
      <?php echo '('.$schedule->depicao.' - '.$schedule->arricao.')'?>
     </a>
     <br />
    
     <strong>Departure: </strong><?php echo $schedule->deptime;?>         <strong>Arrival: </strong><?php echo $schedule->arrtime;?><br />
     <strong>Equipment: </strong><?php echo $schedule->aircraft; ?> (<?php echo $schedule->registration;?>)  <strong>Distance: </strong><?php echo $schedule->distance . Config::Get('UNITS');?>
    

  10. Ok I can confirm that commenting out;

    $this->set('allroutes', $schedules);
    

    does indeed result in the same original memory error. Thank you anyway web541 as always.

    That doesnt make much sense as the function would still query all schedules that way. Instead just use if in the template file.

    if($schedules)

    foreach($schedules as $whatever)

    Not sure what you mean here mseiwald. Do you mean include the "if" statement in the schedule_searchform.php?

  11. Just saw this post and tried removing the line as mentioned above. Mine is formatted as so;

    # Show the routes. Remote this to not show them.
    #$schedules = SchedulesData::getSchedules();
    

    This now makes my schedule search form show up nicely but I get an additional error relating to the foreach() function just underneath it in the Schedules.php file. The code that is throwing the error is;

    foreach($schedules as $key => $s) {
    
    	    # should we skip schedules based on day of week?
    	    if(Config::get('CHECK_SCHEDULE_DAY_OF_WEEK') === true) {
    
    		    if(isset($s->{$var_name}) && !empty($s->{$var_name})) {
    			    # check if today is in the active list for this week
    			    if(@substr_count($s->{$var_name}, $current_day) == 0) {
    				    unset($schedules[$key]);
    				    continue;
    			    }
    		    } else {
    			    if(substr_count($s->daysofweek, date('w')) == 0) {
    				    unset($schedules[$key]);
    				    continue;
    			    }
    		    }
    	    }
    
    	    # remove this schedule from the list if there's a bid on it
    	 if(Config::get('DISABLE_SCHED_ON_BID') === true && $route->bidid != 0) {
    	  unset($schedules[$key]);
    		    continue;
    	 }
    
    
    	    /* 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(Config::get('RESTRICT_AIRCRAFT_RANKS') === true && Auth::LoggedIn()) {
    	  if($route->aircraftlevel > Auth::$pilot->ranklevel) {
    	   unset($schedules[$key]);
    			    continue;
    	  }
    	 }
    
    	    if(Config::get('SCHEDULES_ONLY_LAST_PIREP') === true && Auth::LoggedIn() == true) {
    	  if(count($pirep_list) > 0) {
    	   # IF the arrival airport doesn't match the departure airport
    	   if($pirep_list[0]->arricao != $s->depicao) {
    	    unset($schedules[$key]);
    				    continue;
    	   }
    	  }
    	    }
    
        }
    

    It looks to me like the foreach statement is calling on the $schedules that I just commented out. I have tried making this $schedules = SchedulesData(); but that didn't seem to work.

    Any help anyone can give?

    Thank you.

  12. Hi Guys,

    Because I run an alliance VA, we have multiple airlines, multiple routes etc. We are currently standing at 32k routes and it's basically sending my php memory limit into spasms!

    So my question or challenge is; would it be possible to create or modify a function within phpvms so that rather than the standard form trying to pull all routes to then search on (tell me if I'm wrong on this, just my understanding), I can use a form to purely select from DEP ICAO, ARR ICAO, Aircraft Type, Distance and it then make a query to the database to return only the results needed?

    This issue is having a knock-on effect for me with modules also that require routes to be booked and for some reason, their scripts seem to call all routes from the off. I am happy to try and have a go at modifying functions and dataclasses, but I could do with a bit of sign posting as to what needs to be altered.

    Thanks in advance. B)

  13. 1 tip i would replace the whole hard coded time code with this

    					 $r = range(1, 24);
    
     $selected = is_null($selected) ? date('h') : $selected;
     $select = "<select name=deph id=dephour>\n";
     foreach ($r as $hour)
     {
    	 $select .= "<option value=\"$hour\"";
    	 $select .= ($hour==$selected) ? ' selected="selected"' : '';
    	 $select .= ">$hour</option>\n";
     }
     $select .= '</select>';
     echo $select;
     echo":";
    					 $rminutes = range(1, 60);
    
     $selected = is_null($selected) ? date('h') : $selected;
     $selectminutes = "<select name=depm id=dephour>\n";
     foreach ($rminutes as $minutes)
     {
    	 $selectminutes .= "<option value=\"$minutes\"";
    	 $selectminutes .= ($hour==$selected) ? ' selected="selected"' : '';
    	 $selectminutes .= ">$minutes</option>\n";
     }
     $selectminutes .= '</select>';
     echo $selectminutes;
    
    

    also you can get a dynamic fleet from the db if you want as i saw that you have it hard coded

    Brilliant as ever Vangelis. A question......how do I set it so the times display two digit format with the leading zero for times less than 10?

  14. Got it! :D

    I'd used the mins hours bit for both the hours and mins. I have changed it and tested it. All seems to be good with it now. I will upload it again to Github. Any other errors please do feel free to keep them to yourself, ahem....I mean, let me know and I will try to sort. :P

    Thanks again guys for the support.

  15. Ha ha, darn you Vangelis!! lol.

    I was working on it this morning and Derek from SimBrief suggested I check the popup url window to see if the date parameter was being passed. It wasn't. So I went back to look at why in the schedules_briefing.php and bam I saw it. The "sbapiform" was in the wrong place. I moved it and the date now works perfectly. :)

    Then you go present me with another problem! <_<

    Oh I love learning :P

    Give me a short mo to look at the time thing and if it stumps me completely, I'll take you up on that solution. B)

  16. Ok I now figure it is much easier to use the datepicker built into jquery to select the date. It now allows you to select the date but when I generate the OFP, it still shows the current date. I'm looking into what could be the problem but if anyone else has a notion, I'd be grateful for the help. Code I'm using is below.

    <td>
    <script>
    $(function() {
    		 $( "#datepicker" ).datepicker({dateFormat: "ddMy"
    		  });
    });
    </script>
    <input class="dispinput" name="date" size="7" type="text" id="datepicker">
    </td>
    

    Amended file now on Github.

  17. Ok so I know I'm going to regret this but I can't find a code that will return the date as "12 Mar" format.

    I have a calculation the returns both the day and month but as separate fields and I can't get the together. When I upload it only the first calculation appears. The code I'm using is below.

    <td><select class="dispinput" name="date" id="date">
     <?php for($i= 1; $i <= 31; $i++) { ?><option value="<?php printf("%02d", $i); ?>"><?php printf("%02d", $i); ?><?php } ?>
     <?php for($i= 1; $i <= 12; $i++) { ?>
    			    <?php printf("%02d", $i); ?>"><?php printf("%02d", $i); ?></option><?php } ?>
    			    </select>
    			    </td>
    

  18. Ok, for those that are interested, I have created a form on my website so that you can adjust various options before generating the SimBrief OFP. I have written a post about it. Below is the link to the post.

    http://forum.phpvms.net/topic/23385-simbrief-form-to-tailor-ofp-result/

    I use it in conjunction with Vangelis' module and it works perfectly. In essence it utilises the hidden form elements to allow tailoring of the resulting OFP. I have put the files on Github. I've not used Github before so I'm not sure if I've uploaded them correctly. Any problems, message me.

    Thanks Vangelis, keep up the great work :)

  19. Firstly, thank you to Vangelis for all the great work and support he gives to the community. I only wish I were half as capable! I have been using the community for a long time now and I am not often in the position to offer much back other than comments on posts. Hopefully, this will make up for it.

    Like many, I am using Vangelis' SimBrief addon, which creates a button that allows you to generate a SimBrief OFP.

    This worked great for a while on my airline site, but having used SimBrief itself, I wanted more control over the information used in my flight planning. I wanted something a little more like the Dispatch System used on SimBrief's website.

    I set about creating a form that I could use to specify some settings, before generating the OFP itself. After much playing around with ideas and combinations, I came up with something that works really well for me and creates a very accurate OFP. I wanted to share it on here and give a little something back.

    What this addon does.

    It provides a form that allows you to configure the following aspects of your flight plan:

    • Aircraft type
    • Weight unit preference (lbs or kgs)
    • The departure and destination airports
    • Contingency fuel amount
    • Reserve fuel amount (time based)
    • Detailed or simple Navlog
    • ETOPS planning
    • Stepclimb detail
    • Runway analysis
    • NOTAMS inclusion
    • Flight Map detail
    • Plan layout (LIDO, BAW etc)
    • Route preference

    Any of these options can be switched on or off, or adjusted before clicking the "Generate OFP" button.

    You can also configure the form by deleting or hiding elements you don't want pilots to change or control.

    Readme from Github

    A form to allow options to be altered before generating the SimBrief OFP.

    NOTE: This addon is designed to work with the SimBrief Addon by Vangelis on PHPVMS Forums. You must have this installed for this functionality to work. http://forum.phpvms....ief-for-phpvms/

    I am also using David Clark's version of PHPVMS where the templates are in .php format rather than .tpl. If you have an older version and your template files are .tpl, simply alter the file extension as required and the file should work.

    You must also have a SimBrief API key which is expained in Vangelis' module and you also need to register for a free SimBrief account for the form to work as it needs to make a connection to SimBrief itself.

    INSTALLATION

    1. Download the "schedules_briefing.php" file from here.
    2. It is optional if you want to download the "style.css" file. It gives you the custom styles I have used for my form and page. You may want to use your own sites styling for the form and tables.
    3. If you are using a custom skin for phpvms then you will need to place the "schedules_briefing.php" file in /lib/skins/(your skin name).
    4. If you are not using a custom skin, then you should place the file in /core/templates/.
    5. If you wish to use my styling, you can just copy and paste the styles from my "style.css" to your style file. For a custom skin this is likely to be /lib/skins/(your skin name)/css/style.css.
    6. For a vanilla phpvms install, your style file should be located in /lib/css/phpvms.css.
    7. If you want to use your own styling, then you need to change the following html tag references in the "schedules_briefing.php" file you downloaded.

    • Change "classic-title5" to one of your own header styles
    • The "call-action" is a Boostrap3 box. The styling of the box is controlled by "call-action-style1.
    • <div class="call-action call-action-boxed call-action-style1 no-descripton clearfix">


    • This controls the general styling of the container and it's elements that house the tables.
    • <div class="schedule-briefing">


    • This controls the specific table style. You can simply overwrite "briefing-table" with your own style classname.
    • <table class="briefing-table">


    • The "dispinput" styles the input and select form elements on the page.
    • <select class="dispinput" name="date" id="date">


    <p>Once you've uploaded the schedule_briefing.php file, you need to also edit the following line at the bottom of the file.

    Replace the url from my form (highlighted bit below) .

    <button type="button" style="width:100%" class="btn btn-success btn-lg" onclick="simbriefsubmit('http://www.globalairalliance.com/index.php/SimBrief');" style="font-size:30px" value="Generate">Click to Generate OFP>

    with yours as shown below.

    <button type="button" style="width:100%" class="btn btn-success btn-lg" onclick="simbriefsubmit('http://Your website URL here/index.php/SimBrief');" style="font-size:30px" value="Generate">Click to Generate OFP</button>

    To add the "dynamically called fleet" from your database, you also need to download and install the "OperationsData.class.php file and copy it to your "core/common" directory. Rename your existing file to "OperationsData.class.phpOLD" so you have a backup, just incase anything breaks.

    That's it, you should be good to go.

    To test it, bid on a flight, go to "view my bids" and click on "pilot brief". You should now see your form. Adjust the settings as you need and press on the "Click to Generate OFP". You should now see your OFP complete with accurate timings and fuel predictions.

    Enjoy!

    Link to Github files

    pilot-brief-module.png

    Credits: Vangelis, Web541, Strider, Keith

    • Like 1
×
×
  • Create New...