mseiwald Posted November 21, 2011 Report Share Posted November 21, 2011 Hi guys i`ve got a problem with the maintenance.php and the bids removal. I have set the local config to : # If someone places a bid, whether to disable that or not Config::Set('DISABLE_SCHED_ON_BID', true); Config::Set('DISABLE_BIDS_ON_BID', false); and in the maintenance.php i`ve activated this for the cron job: if(Config::Get('CLOSE_BIDS_AFTER_EXPIRE') === true) { SchedulesData::deleteExpiredBids(); CronData::set_lastupdate('check_expired_bids'); } now the bids are removed after the period i`ve set but the flights don`t show up in my schedules again after the bid removal. So no one else can book them anymore. any ideas what`s wrong here? Would be nice if someone could help me with this because actually i have to delete all the affected flights in the admin panel and create a new flight in order to show them in my schedules again. kind regards Manuel 1 Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted November 22, 2011 Moderators Report Share Posted November 22, 2011 The reasons why it's not biding it is that your config settings is true Config::Set('DISABLE_SCHED_ON_BID', true); Change the true value to false. That's why the bidding is not allowing. Quote Link to comment Share on other sites More sharing options...
mseiwald Posted November 22, 2011 Author Report Share Posted November 22, 2011 hi, thanx for your reply! but isn't it just excluding flights from the schedule that actually have open bids when this settings is "true"? of course i want to hide flights that someone has booked but my problem is i've set the bid expiry to 72h and setup the maintenance.php cron job to close expired bids. so normally the flights should be available again in the schedule after the bid was deleted by the cron but it isn't. the bids get removed correctly after the 72h but the flights don't show up in the schedule again then. kind regards manuel Quote Link to comment Share on other sites More sharing options...
mseiwald Posted November 24, 2011 Author Report Share Posted November 24, 2011 Has no one else ideas how to fix it? I have for now disabled the automatic close expired bid function and have to delete them manually. Quote Link to comment Share on other sites More sharing options...
Felipe Posted October 26, 2012 Report Share Posted October 26, 2012 I'm facing the same problem as you, Manuel. I'm still trying to fix it. By this time I am looking for grants to start repairing this issue. For the time being, what I've realized is that bidid field in the schedules table in the database should be updated to zero when bids expires and maintainance.php does its job. And this is not happening... That's is our problem. Whenever I get something, I'll post in here. The problem is I'm just a newbie in php programming... Quote Link to comment Share on other sites More sharing options...
piuozorio Posted October 27, 2012 Report Share Posted October 27, 2012 Hello all and sorry my english, i think Felipe is right the problem is when cron job do the work is not setting the scheduled bid (bidid) to 0 in schedules table. You can check that, in your table and if is that the problem here is my code so you can try. I´m not a pro coder, just works for me, maybe the function already exists or other faster way so here it is. In your SchedulesData.class.php add the function public function ResetSchedulesBidsExpired() { $bids = self::getSchedulesBidsExpired(true); if(!$bids) return true; foreach($bids as $bid) { $sql = 'UPDATE '.TABLE_PREFIX.'schedules SET `bidid`=0 WHERE `id`='.$bid->routeid; DB::query($sql); } } now in your admin/maintenance.php after SchedulesData::deleteExpiredBids(); add SchedulesData::ResetSchedulesBidsExpired(); Hope it works for you Quote Link to comment Share on other sites More sharing options...
Felipe Posted October 29, 2012 Report Share Posted October 29, 2012 Hello, Piuozorio! It's great from hear the solution from you. I'll take a time tonight to check it and if it works for me I'll let you know. By the way, I'm watching your badge and it says Eficiência 93%. By chance, has your VA developed a FOQA system based on phpVMS? Thank you very much for your help! Quote Link to comment Share on other sites More sharing options...
Felipe Posted October 30, 2012 Report Share Posted October 30, 2012 Hello, Piuozorio! The cron is deleting the bid, but it still remains with some bidid set. I'll test your query it with just... $sql = 'UPDATE '.TABLE_PREFIX.'schedules SET `bidid`= 0; ... until I can figure out how to solve my problem definitely. Quote Link to comment Share on other sites More sharing options...
piuozorio Posted October 31, 2012 Report Share Posted October 31, 2012 Hello again, i forgot to add the other function to work. Add to schedulesData.class.php public function getSchedulesBidsExpired() { $cache_time = Config::Get('BID_EXPIRE_TIME'); if($cache_time == '') { return; } $sql = 'SELECT * FROM '.TABLE_PREFIX."bids WHERE `dateadded` + INTERVAL {$cache_time} HOUR < NOW()"; $row = DB::get_results($sql); return $row; } Hope it works now NOTE: I saw the other thread and is the "same code" all in one I think i have edited the table bids to save date/time, not only date, because if is only date dont work properlly. Lets say you have configured expire after 24 hours You bid at 13:00 30/10/2012 and hope expired at 13:00 31/10/2012 Without the hours in database it expires (start) at 00:00 31/10/2012 and with the date only, yeh 30/10/2012 to 31/10/2012 is 24h so with the hour it calculates well, only after 13:00 31/10/2012 I dont know if you understand what im saying, sorry my english The "eficiência" was created with a help of a friend. Just a php code that reads each line of log when "send pirep" and "before" enter in database. Now in each line , i use this line code http://www.php.net/m...tion.substr.php to get the bold values, [11:43] - Flaps to position 2 at 3169ft, hdg 3 and 200kts It makes the "send pirep" time slower to read all code first and then get the "pirep filed". Quote Link to comment Share on other sites More sharing options...
Felipe Posted November 1, 2012 Report Share Posted November 1, 2012 I think i have edited the table bids to save date/time, not only date, because if is only date dont work properlly. You mean I should head for the phpvms_bids table on my DB and change the dateadded column type from "date" to "datetime"? Quote Link to comment Share on other sites More sharing options...
piuozorio Posted November 1, 2012 Report Share Posted November 1, 2012 You mean I should head for the phpvms_bids table on my DB and change the dateadded column type from "date" to "datetime"? Yes thats it. Quote Link to comment Share on other sites More sharing options...
Felipe Posted November 1, 2012 Report Share Posted November 1, 2012 I did it and also added the function getSchedulesBidsExpired() And still my expired bid are being deleted but the schedules are not being updated to zero on bidid column. I've tried yours and Kyle's tips and nothing works for me. Now I'm trying my own way... Let's see what happens... Quote Link to comment Share on other sites More sharing options...
Kapitan Posted April 4, 2013 Report Share Posted April 4, 2013 Any solution ? Quote Link to comment Share on other sites More sharing options...
Felipe Posted April 4, 2013 Report Share Posted April 4, 2013 Yes, try this one: https://github.com/DavidJClark/phpVMS_extended Quote Link to comment Share on other sites More sharing options...
Kapitan Posted April 5, 2013 Report Share Posted April 5, 2013 Yes, try this one: https://github.com/D...phpVMS_extended I done that but now any bid i made the time show 00;00;00- Sorted But now i lost all pilots from admin panel also all pilots got 0 flight the hours are ok just flights. Quote Link to comment Share on other sites More sharing options...
Kapitan Posted April 7, 2013 Report Share Posted April 7, 2013 Hello any one got the solution ? Quote Link to comment Share on other sites More sharing options...
lorlandi Posted April 7, 2013 Report Share Posted April 7, 2013 Hello Kapitan, in fact i have for many time the same problem with the bids, my solution is not a good solution but it's work for the moment, I go to the database table phpvms_schedules at the column with name "bids" who show the flight who are on bids whit the numer "1" and no bids with numer "0", i just compare the current bids with the bid value in the column, if you have 5 currents bids you must have 5 flights with numer 1 on the column bids at shedules data base, finsh that i just change the value to "0" without "" and your flights wll be as on bid. Is not a good practice because you change values on database but with care it's work. I make this procedure weekly with no problem untill now. According Felipe's post on April 5th i made a update with that files and the problem with bids is unsolved.....but i have erroneous data on my finances Searching on files i found this code on core/common/LedgerData.class http://www.transpola...ages/ledger.jpg The values .$params['amount'].', NOW(), NOW() populate the table phpvms_ledger in the data base in the values `submitdate`and `modifieddate` with the present date and when the system makes the calculatin for pilotpay only shows the pilotpay for current months assuming all are reports are on this month instead by month due to the submit date is equal than modified date instead the submit date must have the date when the pirep was sent. Regards. Luis 1 Quote Link to comment Share on other sites More sharing options...
Kapitan Posted April 7, 2013 Report Share Posted April 7, 2013 Hello Kapitan, in fact i have for many time the same problem with the bids, my solution is not a good solution but it's work for the moment, I go to the database table phpvms_schedules at the column with name "bids" who show the flight who are on bids whit the numer "1" and no bids with numer "0", i just compare the current bids with the bid value in the column, if you have 5 currents bids you must have 5 flights with numer 1 on the column bids at shedules data base, finsh that i just change the value to "0" without "" and your flights wll be as on bid. Is not a good practice because you change values on database but with care it's work. I make this procedure weekly with no problem untill now. Accordin the Felipe post on April 5th i made a update with that files and the problem with bids is unsolved.....but i have erroneous data on my finances Cheers m8 ...i know thats what im doing now. 1 Quote Link to comment Share on other sites More sharing options...
lorlandi Posted April 7, 2013 Report Share Posted April 7, 2013 Ok Kapitan, let's wait for a better way solution. Regards 1 Quote Link to comment Share on other sites More sharing options...
Kapitan Posted April 8, 2013 Report Share Posted April 8, 2013 Ok Kapitan, let's wait for a better way solution. Regards I think i got solution i will pm you soon as i test it trust me very simple ..... 1 Quote Link to comment Share on other sites More sharing options...
lorlandi Posted April 8, 2013 Report Share Posted April 8, 2013 I think i got solution i will pm you soon as i test it trust me very simple ..... Ok thanks a lot....i'll wait for ti. Regards Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.