Jump to content

Email on bid expiration


Recommended Posts

In core/common/SchedulesData.class.php, somewhere near line 792, you can replace and try this, however I am not sure it may work or not.

public static function deleteExpiredBids() {

        $cache_time = Config::Get('BID_EXPIRE_TIME');
        if ($cache_time == '') {

        /* Make sure the schedule bidids */
        $sql = 'SELECT * FROM ' . TABLE_PREFIX . "bids
				WHERE `dateadded` + INTERVAL {$cache_time} HOUR < NOW()";
        $results = DB::get_results($sql);
        if (count($results) > 0) {
            foreach ($results as $row) {
                $pilotdet = PilotData::getPilotData($row->pilotid);
                $pilotname = $pilotdet->firstname.' '.$pilotdet->lastname;
                $pilotemail = $pilotdet->email;
                $subject = 'Vistara Virtual : Bid Deleted!';
                $message = 'Hello '.$pilotname.', your Bid having ID: '.$row->bidid.' has been deleted since it has crossed the minimum days required to fly!';
                $sql = 'UPDATE ' . TABLE_PREFIX . "schedules
						SET `bidid`=0 WHERE `id`={$row->routeid}";


        $sql = 'DELETE FROM ' . TABLE_PREFIX . "bids
				WHERE `dateadded` + INTERVAL {$cache_time} HOUR < NOW()";




Edited by Yash
  • Thanks 1
Link to comment
Share on other sites

  • 3 weeks later...
On 4/19/2019 at 5:52 AM, thunder175 said:

Thanks for the help! I finally implemented this and it saved me a lot of time. The only change I did was instead of


I used



Your welcome! :D

  • Like 1
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.

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.


  • Create New...