From b7207cffaf733ce25140d9ed06b8a6417601968d Mon Sep 17 00:00:00 2001 From: skeeter Date: Fri, 23 Mar 2001 03:13:23 +0000 Subject: [PATCH] Written the delete_calendar() for sql. --- calendar/inc/class.calendar_sql.inc.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/calendar/inc/class.calendar_sql.inc.php b/calendar/inc/class.calendar_sql.inc.php index 61a08b2941..1da789588b 100755 --- a/calendar/inc/class.calendar_sql.inc.php +++ b/calendar/inc/class.calendar_sql.inc.php @@ -77,6 +77,19 @@ class calendar_ extends calendar__ function delete_calendar($stream='',$calendar='') { + $this->stream->query('SELECT cal_id FROM calendar_entry WHERE cal_owner='.$calendar,__LINE__,__FILE__); + if($this->stream->num_rows()) + { + while($this->stream->next_record()) + { + $this->delete_event($stream,intval($this->stream->f('cal_id'))); + } + $this->expunge($stream); + } + $this->stream->lock(array('calendar_entry_user')); + $this->stream->query('DELETE FROM calendar_entry_user WHERE cal_login='.$calendar,__LINE__,__FILE__); + $this->stream->unlock(); + return $calendar; }