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. Ah ok, that is from the "events" module from crazy creatives. It is basically a template that pulls information from the events tables and then just displays it using the template with css styling applied. I can't give you the code because it's not mine to give. Sorry.

  10. 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');?>
    

  11. 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?

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

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

  14. 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?

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

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

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

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

×
×
  • Create New...