7ad4eaaa0fd4b6c656e987e6f325757eba2095f5
5 * Copyright (c) 2001 Michal Szczotka <michal@tuxy.org>
6 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 * Functions to delete a event.
13 require_once('calendar_data.php');
14 require_once('functions.php');
16 require_once('../src/validate.php');
17 require_once('../functions/strings.php');
18 require_once('../functions/date.php');
19 require_once('../config/config.php');
20 require_once('../functions/page_header.php');
21 require_once('../src/load_prefs.php');
23 function confirm_deletion()
25 global $calself, $dyear, $dmonth, $dday, $dhour, $dminute, $calendardata, $color, $year, $month, $day;
27 $tmparray = $calendardata["$dmonth$dday$dyear"]["$dhour$dminute"];
29 echo " <TABLE BORDER=0 CELLPADDING=2 CELLSPACING=1 BGCOLOR=\"$color[0]\">\n".
30 " <TR><TH COLSPAN=2 BGCOLOR=\"$color[4]\">\n".
31 _("Do you really want to delete this event?") . "<br></th>\n".
32 " <TR><TD ALIGN=RIGHT BGCOLOR=\"$color[4]\">" . _("Date:") . "</TD>\n".
33 " <TD ALIGN=LEFT BGCOLOR=\"$color[4]\">$dmonth/$dday/$dyear</TD></TR>\n".
34 " <TR><TD ALIGN=RIGHT BGCOLOR=\"$color[4]\">" . _("Time:") . "</TD>\n".
35 " <TD ALIGN=LEFT BGCOLOR=\"$color[4]\">$dhour:$dminute</TD></TR>\n".
36 " <TR><TD ALIGN=RIGHT BGCOLOR=\"$color[4]\">" . _("Title:") . "</TD>\n".
37 " <TD ALIGN=LEFT BGCOLOR=\"$color[4]\">$tmparray[title]</TD></TR>\n".
38 " <TR><TD ALIGN=RIGHT BGCOLOR=\"$color[4]\">" . _("Message:") . "</TD>\n".
39 " <TD ALIGN=LEFT BGCOLOR=\"$color[4]\">$tmparray[message]</TD></TR>\n".
40 " <TR><TD ALIGN=RIGHT BGCOLOR=\"$color[4]\">\n".
41 " <FORM NAME=\"delevent\" METHOD=POST ACTION=\"$calself\">\n".
42 " <INPUT TYPE=HIDDEN NAME=\"dyear\" VALUE=\"$dyear\">\n".
43 " <INPUT TYPE=HIDDEN NAME=\"dmonth\" VALUE=\"$dmonth\">\n".
44 " <INPUT TYPE=HIDDEN NAME=\"dday\" VALUE=\"$dday\">\n".
45 " <INPUT TYPE=HIDDEN NAME=\"year\" VALUE=\"$year\">\n".
46 " <INPUT TYPE=HIDDEN NAME=\"month\" VALUE=\"$month\">\n".
47 " <INPUT TYPE=HIDDEN NAME=\"day\" VALUE=\"$day\">\n".
48 " <INPUT TYPE=HIDDEN NAME=\"dhour\" VALUE=\"$dhour\">\n".
49 " <INPUT TYPE=HIDDEN NAME=\"dminute\" VALUE=\"$dminute\">\n".
50 " <INPUT TYPE=HIDDEN NAME=\"confirmed\" VALUE=\"yes\">\n".
51 ' <INPUT TYPE=SUBMIT VALUE="' . _("Yes") . "\">\n".
53 " </TD><TD ALIGN=LEFT BGCOLOR=\"$color[4]\">\n".
54 " <FORM NAME=\"nodelevent\" METHOD=POST ACTION=\"day.php\">\n".
55 " <INPUT TYPE=HIDDEN NAME=\"year\" VALUE=\"$year\">\n".
56 " <INPUT TYPE=HIDDEN NAME=\"month\" VALUE=\"$month\">\n".
57 " <INPUT TYPE=HIDDEN NAME=\"day\" VALUE=\"$day\">\n".
58 ' <INPUT TYPE=SUBMIT VALUE="' . _("No") . "\">\n".
76 $calself=basename($PHP_SELF);
78 displayPageHeader($color, 'None');
82 echo "<TR BGCOLOR=\"$color[0]\"><TD>".
83 "<TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=1 BGCOLOR=\"$color[0]\">".
85 date_intl( 'l, F d Y', mktime(0, 0, 0, $month, $day, $year));
86 if (isset($dyear) && isset($dmonth) && isset($dday) && isset($dhour) && isset($dminute)){
87 if (isset($confirmed)){
88 delete_event("$dmonth$dday$dyear", "$dhour$dminute");
89 echo '<br><br>' . _("Event deleted!") . "<BR>\n";
90 echo "<A HREF=\"day.php?year=$year&month=$month&day=$day\">" .
91 _("Day View") . "</A>\n";
97 echo '<br>' . _("Nothing to delete!");
101 </table
></td
></tr
></table
>