phpScheduleIt
June 18, 2013, 06:57:19 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: phpScheduleIt 2.4.2 has been released!
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: A way to have expired reservations deleted?  (Read 5779 times)
Andrew
Newbie
*

Karma: 0
Posts: 6


« on: March 31, 2006, 09:20:35 AM »

Is there a way to have reservations deleted from the database when they expire?

Thanks,
Andrew
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5506


WWW
« Reply #1 on: March 31, 2006, 10:09:01 AM »

That wasn't built in because most people wanted to keep old reservations around for statistics and billing.

This is very easy to do, though and I can likely get this into the 1.2 release.
Logged
Andrew
Newbie
*

Karma: 0
Posts: 6


« Reply #2 on: March 31, 2006, 10:21:32 AM »

I would really like that functionality - any chase that it would be a simple thing or will it require a major re-write?

Thanks,
Andrew
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5506


WWW
« Reply #3 on: March 31, 2006, 10:36:11 AM »

It's a very simple thing.  This actually used to be part of the application, but it was removed by request.
Logged
Andrew
Newbie
*

Karma: 0
Posts: 6


« Reply #4 on: March 31, 2006, 11:28:53 AM »

Can you tell me what I need to put back to get this to work?

Thanks,
Andrew
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5506


WWW
« Reply #5 on: March 31, 2006, 11:52:07 AM »

If you want the rude and crude one, just make a new page that executes a db query:

Code:
select resid from reservations where end_date < mktime(0,0,0);


Then create a ResDB object  
Code:
$db = new ResDB();
and loop through all reservation ids, calling
Code:
$db->delRes($id, null, false, 0);


I can't really provide all the code to create the page and DB connection, but you can copy that from the existing code.
Logged
Andrew
Newbie
*

Karma: 0
Posts: 6


« Reply #6 on: March 31, 2006, 12:01:03 PM »

Thanks - a little over my head so I guess I'll wait to see if this feature makes it into the next release...

Thanks,
Andrew
Logged
Andrew
Newbie
*

Karma: 0
Posts: 6


« Reply #7 on: March 31, 2006, 04:29:39 PM »

Got it working with a very crude PHP page and a cronjob running wget on it.

Thanks for the help!
Andrew
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5506


WWW
« Reply #8 on: March 31, 2006, 04:30:50 PM »

No problem.  I'm going to try to put this in the 1.2 release if I have time.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!