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
|
<?php /** * popup.php * * Displays an announcement popup * * @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/tclogin.class.php" ); require_once("includes/tcuser.class.php" );
$AN = new tcAnnouncement; $L = new tcLogin; $U = new tcUser;
/** * Check authorization */ if ( !isset($_REQUEST['uname']) || ($L->checkLogin()!=$_REQUEST['uname']) || !$U->findByName($_REQUEST['uname']) ) { // Not authorized. Get outta here jsCloseAndReload("index.php"); }
/** * Process form */ if ( isset($_POST['btn_confirm']) && strlen($_POST['ats'])) { $query = "DELETE FROM ".$AN->uatable." WHERE ats='".$_POST['ats']."' AND username='".$U->username."';"; $result = $AN->db->db_query($query); } require("includes/header.html.inc.php" ); ?> <body> <table class="dlg"> <tr> <td class="dlg-header"> <?php printDialogTop($LANG['ann_title']." ".$U->firstname." ".$U->lastname,"announcement_popup.html","ico_bell.png"); ?> </td> </tr> <tr> <td class="dlg-body"> <?php $query = "SELECT ats FROM ".$AN->uatable." WHERE username='".$_REQUEST['uname']."' ORDER BY ats DESC;"; $result = $AN->db->db_query($query); while ( $row = $AN->db->db_fetch_array($result,MYSQL_ASSOC) ){ $AN->read($row['ats']); if ($AN->popup) { echo " <form class=\"form\" name=\"form-ann-".$row['ats']."\" method=\"POST\" action=\"".$_SERVER['PHP_SELF']."?uname=".$_REQUEST['uname']."\"> <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 class=\"text\" type=\"hidden\" name=\"ats\" value=\"".$row['ats']."\"> <input name=\"btn_confirm\" 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\">"; } } ?> </td> </tr> <tr> <td class="dlg-menu"> <input name="btn_help" type="button" class="button" onclick="javascript:this.blur(); openPopup('help/<?=$CONF['options']['helplang']?>/html/index.html?announcement_popup.html','help','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,titlebar=0,resizable=0,dependent=1,width=740,height=500');" value="<?=$LANG['btn_help']?>" onmouseover="this.className='button-over';" onmouseout="this.className='button';"> <input name="btn_close" type="button" class="button" onclick="javascript:window.close();" value="<?=$LANG['btn_close']?>" onmouseover="this.className='button-over';" onmouseout="this.className='button';"> </td> </tr> </table> <?php require("includes/footer.html.inc.php"); ?>
|