189ff2355a7e70292bfa5c26a6f82852728cfc79
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');
22 require_once('../functions/html.php');
24 function confirm_deletion()
26 global $calself, $dyear, $dmonth, $dday, $dhour, $dminute, $calendardata, $color, $year, $month, $day;
28 $tmparray = $calendardata["$dmonth$dday$dyear"]["$dhour$dminute"];
30 echo html_tag( 'table',
32 html_tag( 'th', _("Do you really want to delete this event?") . '<br>', '', $color[4], 'colspan="2"' )
35 html_tag( 'td', _("Date:"), 'right', $color[4] ) .
36 html_tag( 'td', $dmonth.'/'.$dday.'/'.$dyear, 'left', $color[4] )
39 html_tag( 'td', _("Time:"), 'right', $color[4] ) .
40 html_tag( 'td', $dhour.':'.$dminute, 'left', $color[4] )
43 html_tag( 'td', _("Title:"), 'right', $color[4] ) .
44 html_tag( 'td', $tmparray[title
], 'left', $color[4] )
47 html_tag( 'td', _("Message:"), 'right', $color[4] ) .
48 html_tag( 'td', $tmparray[message
], 'left', $color[4] )
52 " <FORM NAME=\"delevent\" METHOD=POST ACTION=\"$calself\">\n".
53 " <INPUT TYPE=HIDDEN NAME=\"dyear\" VALUE=\"$dyear\">\n".
54 " <INPUT TYPE=HIDDEN NAME=\"dmonth\" VALUE=\"$dmonth\">\n".
55 " <INPUT TYPE=HIDDEN NAME=\"dday\" VALUE=\"$dday\">\n".
56 " <INPUT TYPE=HIDDEN NAME=\"year\" VALUE=\"$year\">\n".
57 " <INPUT TYPE=HIDDEN NAME=\"month\" VALUE=\"$month\">\n".
58 " <INPUT TYPE=HIDDEN NAME=\"day\" VALUE=\"$day\">\n".
59 " <INPUT TYPE=HIDDEN NAME=\"dhour\" VALUE=\"$dhour\">\n".
60 " <INPUT TYPE=HIDDEN NAME=\"dminute\" VALUE=\"$dminute\">\n".
61 " <INPUT TYPE=HIDDEN NAME=\"confirmed\" VALUE=\"yes\">\n".
62 ' <INPUT TYPE=SUBMIT VALUE="' . _("Yes") . "\">\n".
64 'right', $color[4] ) .
66 " <FORM NAME=\"nodelevent\" METHOD=POST ACTION=\"day.php\">\n".
67 " <INPUT TYPE=HIDDEN NAME=\"year\" VALUE=\"$year\">\n".
68 " <INPUT TYPE=HIDDEN NAME=\"month\" VALUE=\"$month\">\n".
69 " <INPUT TYPE=HIDDEN NAME=\"day\" VALUE=\"$day\">\n".
70 ' <INPUT TYPE=SUBMIT VALUE="' . _("No") . "\">\n".
74 '', $color[0], 'border="0" cellpadding="2" cellspacing="1"' );
87 $calself=basename($PHP_SELF);
89 displayPageHeader($color, 'None');
93 echo html_tag( 'tr', '', '', $color[0] ) .
95 html_tag( 'table', '', '', $color[0], 'width="100%" border="0" cellpadding="2" cellspacing="1"' ) .
97 html_tag( 'td', '', 'left' ) .
98 date_intl( 'l, F d Y', mktime(0, 0, 0, $month, $day, $year));
99 if (isset($dyear) && isset($dmonth) && isset($dday) && isset($dhour) && isset($dminute)){
100 if (isset($confirmed)){
101 delete_event("$dmonth$dday$dyear", "$dhour$dminute");
102 echo '<br><br>' . _("Event deleted!") . "<br>\n";
103 echo "<a href=\"day.php?year=$year&month=$month&day=$day\">" .
104 _("Day View") . "</a>\n";
110 echo '<br>' . _("Nothing to delete!");
114 </table
></td
></tr
></table
>