Jump to content

Flight only once per day [SOLVED]


mseiwald

Recommended Posts

Is there a way in the schedule_results.tpl to check the latest pirep submit dates with todays date so that i can make something like if the pirep submitdate == today for that flight number and then echo a specific image in the line of that specific scheduled flight?

The reason i want something like that is because i want that every flightnumber can only be flown once per day. Any ideas?

Link to comment
Share on other sites

  • Moderators

How much are you gonna pay for that???!!!! loll! just joking!

So, you want the schedules to be disabled after they were flown!?

You need to search through the PIREPS for that schedule # and simply make it disabled on that day but do you want this for a certain pilot or for all other pilots as well?

Link to comment
Share on other sites

Hi Parviz,

yes that`s exactly what i want. All already completed flights on that day should be disabled for all pilots. So that every flight number can only be flown once per day. If a pilot has flown a flight it then is considered completed and can not be booked by other pilots on that day.

If that is much work to figure out how that works i wouldn`t mind to pay a reasonable amount for it ;)

Link to comment
Share on other sites

I think that your VA will very quickly become a ghost town if you implement this. People who join VA's are doing it for fun, not so that they can only fly a route once per day. In the real world, yes some routes are flown only once a day, but others are flown multiple times a day. This is taking realism a bit too far. There is a limit as to how far you can make your VA realistic before people will just atop flying for it as it will become too much of a chore and wont like it.

Link to comment
Share on other sites

Hm Daniel i don`t agree with you on that point. I have been flying for a German VA named "Leipzig Air" before and they use a system like that. They simulate the operations very realistic and also are very restrictive on accepting PIREPS and i think that is the reason why they are one of the best known and a very popular german VA. There are a lot of people who prefer a realistic operation. A VA should be for people who are having fun simulating the operations of a real world airline. People who just want to have fun flying around shall in my opinion just fire up their FS and go flying but they don`t need a VA for that.

We have a big choice of routes every day so i think there will still be enough options available.

And if a route shall be served like in RW more than 1 time a day then I make it like in reality and create a second or third flight number for it.

So i don`t see a problem there.

  • Like 2
Link to comment
Share on other sites

Guest lorathon

The easiest way to do this would be to set the schedule disabled upon PIREP submission. Then setup a cron that runs a 12:00 am server time that resets all schedules to enabled.

Link to comment
Share on other sites

  • Moderators

I

The easiest way to do this would be to set the schedule disabled upon PIREP submission. Then setup a cron that runs a 12:00 am server time that resets all schedules to enabled.

That's a good way. I can do the first part but not the cron job, can you help me?

Thanks

Link to comment
Share on other sites

oh but i see one problem there....what about the tour flights? they of course should be bookable anytime. That was the reason why i tried to check the pirep date with todays date and based on that just exclude the flights from being displayed on the schedules. Because then it would be possible to exclude all tour flights...in my case all have a T in the flightnumber...so it`s easy to identify them.

EDIT: not a problem anymore.... I`ll just add the booking buttons to the tour page directly...so there is no need to have them inside the regular schedules anymore then.

Link to comment
Share on other sites

Guest lorathon

Just add an if statement on the set to disabled script. If flight number contains "T" then continue. This will ensure that the tour schedules are never disabled.

For the cron you will need to write an update script. Set enabled to 1 where enabled = 0. Then add the cron job to your cPanel to run every evening.

Link to comment
Share on other sites

Guest lorathon

I would but I am heading out after work. Be gone until the 8th. If you dont have it finished when I get back let me know and I will knock it out for ya.

Link to comment
Share on other sites

You obviously just skimmed my reply, as I had pointed out that real world airlines never just fly a route once per day, some routes yes, but others they will fly multiple times. Take Aer Lingus flights between Dublin and Heathrow, they operate around 12 flights a day on the one route. And the VA you mentioned, I have never heared of it until you mentioned it. Maybe in Germany it is well known. And if you think that people who want to fly for fun don't need a VA, then what are you doing in the VA business? You have a very small mind if you think like that. Something like what you want will cause more trouble then it is worth. There is another problem with your request, just because you can set the schedule not to show a route after it has been filed, doesn't mean people can't fly it after that. And if you start rejecting perfectly good pireps just because it has been filed already that day, you will start to annoy pilots, and they will stop having fun.

Link to comment
Share on other sites

Hi Daniel,

You obviously just skimmed my reply, as I had pointed out that real world airlines never just fly a route once per day, some routes yes, but others they will fly multiple times. Take Aer Lingus flights between Dublin and Heathrow, they operate around 12 flights a day on the one route.

And you obviously did the same to my reply ;) I stated that this is correct....but I`m sure also Aer Lingus uses different flight numbers, different dep/arr times and maybe for some reason even different routings at different times.

And the VA you mentioned, I have never heared of it until you mentioned it. Maybe in Germany it is well known.

Yeah of course it only is well known in German Speaking Countries because their website is in German only.

And if you think that people who want to fly for fun don't need a VA, then what are you doing in the VA business? You have a very small mind if you think like that.

Of course we all fly for fun. But what i said was a virtual airline shall be for pilots who fly for fun && want to simulate a realistic airline operation.

I call Hellenic Airways a virtual "AIRLINE", not a virtual flying club and not a online logbook for fun flyers or something like that. It is stated several times on my website that " we simulate the operations of real world airlines as close as possible". Also in our Operations Manual which is accessible for the public all reasons for PIREPS being rejected are listed. So everyone has the chance to see how we operate and that we are aiming for a as real as it gets simulation before joining us.

Something like what you want will cause more trouble then it is worth. There is another problem with your request, just because you can set the schedule not to show a route after it has been filed, doesn't mean people can't fly it after that. And if you start rejecting perfectly good pireps just because it has been filed already that day, you will start to annoy pilots, and they will stop having fun.

I don`t think it will cause a lot of trouble if we do it the way Jeff has proposed. Also when the Flights are disabled for the rest of that day people won`t be able to fly them anymore. So no need to reject any PIREPS for that reason. I thank you for sharing your concerns....however i don`t think that making the VA more realistic will result in pilots not to join us but in fact the opposite. Nobody is forced to use this modification. One can if he wants a more realistic operation but nobody must add it. There are so many VA`s out there....and also thousands of Flightsim enthusiasts. I don`t need 100s of pilots in my VA....it would be enough to just have 30 active people or so who wants to fly realistic airline operations just as i and my staff do.....and if someone wants to fly just for fun he is free to join any of the 1000 other VA`s out there.

kind regards

Link to comment
Share on other sites

  • Moderators

After reading your argument, I think Manuel has the right to ask for what he wants for his VA, so it doesn't matter if someone likes it or not that's what he wants and that's what he's eventually going to get and if there are some issues along, that's totally his business.

Link to comment
Share on other sites

i think i have found a easy way that allows to hide the already flown flights from the schedules for that day.

i have created a new column in the schedules table called "lastflown"

now when a pirep is sent it should automatically insert the submitdate into that column.

so it will be easy to skip those flights from being displayed by just adding a if statement like

if($route->lastflown == $today)

{

continue;

}

i already tried to make it work but failed.

I don`t get the lastflown column populated with todays date.

I was trying to add a update function to the PIREPData.class.php to add the submitdate into the lastflown column where code and flightnumber match schedules<->pirep.

it would be amazing if someone could tell me how i can update that table....i just need the submitdate that is sent to the pireps table anyway to also populate the column in the schedules table.

I hope that wouldn`t be too difficult.

kind regards

Manuel

Link to comment
Share on other sites

  • Moderators

Ok that's good, first you need to assign a value to $today like this:

$today = date("Y-m-d"); ////// This gives you today's date
$pirepdate = date(DATE_FORMAT, strtotime($pirep->submitdate)); ////// This formats the pirep's submit date.
If($today == $pirepdate)
 {
 continue;
 }

But you will need a foreach for your column meaning another foreach inside the already existing foreach and of course you need to pull the pirep data for your foreach. Complicated huh! :D . I'm working on it let me see if I can resolve it ;)

Link to comment
Share on other sites

yeah i know i already came that far by getting it via PIREPData::getRecentReportsByCount(50) inside the schedule_results.tpl.

$reports = PIREPData::getRecentReportsByCount(50);
foreach($reports as $report)
{
$pirepdate = date(DATE_FORMAT, strtotime($report->submitdate))
$today = date("Y-m-d");
If($today == $pirepdate && $report->flightnum == $route->flightnum)
 {
	 echo.......(some images...because what i originally wanted was to have a image displayed if the route was flown and another if it wasn`t flown.
 }
else
  {
 echo.....
  }
}

this brought up the right image of course but besides the one i wanted to show only for the already flown routes it also was giving out 49 times the other image :( hehe

there is a function missing to get the latest Pirep by code & flightnum.... that would be a way to get it done.

So it came to my mind to add the latest submitdate directly into the schedules table......that way you wouldn`t need a second foreach loop.

Isn`t it possible to have the column lastflown in the schedules table populated with the submitdate when a pirep is filed?

Link to comment
Share on other sites

  • Moderators

I don't think that's doable but I was thinking of using the find pirep function in PIREPData passing the submitedate value as today and then use a foreach and an if statement. Don't know if it works though.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...