home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2004 April
/
CMCD0404.ISO
/
Software
/
Freeware
/
Programare
/
groupoffice-com-2.01
/
modules
/
calendar
/
reminder.php
< prev
next >
Wrap
PHP Script
|
2004-03-08
|
3KB
|
72 lines
<?php
/*
Copyright Intermesh 2003
Author: Merijn Schering <mschering@intermesh.nl>
Version: 1.0 Release date: 08 July 2003
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
*/
require("../../Group-Office.php");
require_once($GO_CONFIG->class_path.'calendar.class.inc');
$cal = new calendar();
$GO_SECURITY->authenticate();
$GO_MODULES->authenticate('calendar');
require($GO_LANGUAGE->get_language_file('calendar'));
$page_title=$sc_reminder;
require($GO_THEME->theme_path."simple_header.inc");
echo '<embed src="'.$GO_THEME->sounds['reminder'].'" hidden="true" autostart="true"><noembed><bgsound src="'.$GO_THEME->sounds['reminder'].'"></noembed>';
echo '<table border="0" cellpadding="10" width="100%"><tr><td><h2>'.$sc_reminder.'</h2>';
echo '<table border="0" cellspacing="0" cellpadding="0" width="450"><tr><td colspan="4" align="right" class="small">';
$event_count = $cal->get_events_to_remind($GO_SECURITY->user_id);
echo '</tr><tr height="20"><td class="TableHead2">'.$strName.'</td>';
echo '<td class="TableHead2">'.$strDate.'</td></tr>';
$cal2 = new calendar();
while($cal->next_record())
{
$event = $cal2->get_event($cal->f('event_id'));
$next_recurrence_time = $cal2->get_next_recurrence_time(0,0, $event);
echo '<tr><td><a class="normal" href="javascript:goto_event(\''.$cal->f('event_id').'\')">'.$event['name'].'</a></td>';
if($event['all_day_event'])
{
$date_format = $_SESSION['GO_SESSION']['date_format'];
$timezone_offset = 0;
}else
{
$date_format = $_SESSION['GO_SESSION']['date_format'].' '.$_SESSION['GO_SESSION']['time_format'];
$timezone_offset = $_SESSION['GO_SESSION']['timezone']*3600;
}
echo '<td>'.date($date_format, $next_recurrence_time+$timezone_offset).'</td></tr>';
$update_reminder = $cal2->get_next_recurrence_time(0, $next_recurrence_time, $event);
if ($update_reminder > $next_recurrence_time)
{
$cal2->update_reminder($GO_SECURITY->user_id, $event['id'], $update_reminder);
}else
{
$cal2->delete_reminder($GO_SECURITY->user_id, $event['id']);
}
}
echo '</table><br />';
$button = new button($cmdClose, "javascript:window.close()");
echo '</td></tr></table>';
?>
<script type="text/javascript">
function goto_event(event_id)
{
opener.parent.main.document.location='event.php?event_id='+event_id+'&return_to='+escape(opener.parent.main.location);
opener.parent.main.focus();
}
</script>
<?php
require($GO_THEME->theme_path."simple_footer.inc");
?>