1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
<?php /** * announcement.php * * Displays the announcement page * * @package TeamCalPro * @version 3.3.001 * @author George Lewe * @copyright Copyright (c) 2004-2010 by George Lewe * @link http://www.lewe.com * @license http://www.lewe.com/tcpro/doc/license.txt Extended GNU Public License */ //echo "<script type=\"text/javascript\">alert(\"Debug: \");</script>"; /** * Set parent flag to control access to child scripts */ define( '_VALID_TCPRO', 1 );
/** * Includes */ require ("config.tcpro.php"); require_once ("includes/functions.tcpro.php"); getOptions(); if (strlen($CONF['options']['lang'])) require ("includes/lang/" . $CONF['options']['lang'] . ".tcpro.php"); else require ("includes/lang/english.tcpro.php");
require_once("includes/tcannouncement.class.php"); require_once("includes/tcconfig.class.php"); require_once("includes/tclogin.class.php"); require_once("includes/tcuser.class.php");
$AN = new tcAnnouncement; $C = new tcConfig; $L = new tcLogin; $U = new tcUser; $UL = new tcUser; /** * Check authorization */ if ( !checkAuth("viewAnnouncement") ) { // Not authorized. Get outta here jsReload("index.php"); }
/** * Process form */ if ( isset($_POST['btn_delete']) && strlen($_REQUEST['annid'])) { $user=$L->checkLogin(); $UL->findByName($user); $query = "DELETE FROM ".$AN->uatable." WHERE ats='".$_REQUEST['annid']."' AND username='".$UL->username."';"; $result = $AN->db->db_query($query); } /** * Show HTML header * Use this file to adjust your meta tags and such */ require("includes/header.html.inc.php");
echo "<body>\r\n";
/** * Show application header * This is the file to change in order to put different images at the top * of the main page. */ require("includes/header.application.inc.php");
/** * Show menu header * This is the file containing the TeamCal menu */ require("includes/menu.inc.php");
?> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr> <td VALIGN="top"> <table class="dlg"> <tr> <td class="dlg-header"> <?php printDialogTop($LANG['ann_title']." ".$UL->firstname." ".$UL->lastname,"announcement_display.html","ico_bell.png"); ?> </td> </tr> <tr> <td class="dlg-body"> <?php $query = "SELECT * FROM ".$AN->uatable." WHERE username='".$UL->username."' ORDER BY ats DESC;"; $result = $AN->db->db_query($query); while ( $row = $AN->db->db_fetch_array($result,MYSQL_ASSOC) ) { ?> <form class="form" name="form-ann-<?=$row['ats']?>" method="POST" action="<?=$_SERVER['PHP_SELF']."?annid=".$row['ats']?>"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td width="90%"> <?=$LANG['ann_id'].": ".$row['ats']?><br><br> <?=$AN->read($row['ats'])?> </td> <td style="text-align: right;" width="10%"> <input name="btn_delete" type="submit" class="button" value="<?=$LANG['btn_confirm']?>" onmouseover="this.className='button-over';" onmouseout="this.className='button';" onclick="return confirmSubmit('<?=$LANG['ann_delete_confirm_1'].$row['ats'].$LANG['ann_delete_confirm_2']?>');"> </td> </tr> </table> </form> <HR size="1"> <?php } ?> </td> </tr> </table> </td> </tr> </table> <?php require("includes/footer.html.inc.php"); ?>
|