2 /*=====================================================================*\
3 || ################################################################### ||
4 || # BugStrike [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
13 define('SVN', '$Id$');
15 $focus['showreport'] = 'focus';
17 require_once('./global.php');
19 // ###################################################################
21 if (empty($_REQUEST['do']))
23 $message->error(lang
::p('error_invalid_id'));
26 // ###################################################################
28 if ($_REQUEST['do'] == 'vote')
30 $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX
. "bug WHERE bugid = " . intval($bugsys->in
['bugid']) . ((!can_perform('canviewhidden')) ?
" AND !bug.hidden" : ''));
31 $vote = $db->query_first("SELECT *, FIND_IN_SET(" . $bugsys->userinfo
['userid'] . ", userids) AS uservote FROM " . TABLE_PREFIX
. "vote WHERE bugid = $bug[bugid]");
35 $message->error(lang
::p('error_invalid_id'));
38 if ($vote['uservote'])
40 $message->error('you have already voted on this bug');
44 $userids = $vote['userids'];
45 if ($bugsys->userinfo
['userid'])
47 if (trim($vote['userids']))
49 $userids .= ',' . $bugsys->userinfo
['userid'];
53 $userids = $bugsys->userinfo
['userid'];
57 $uservote = intval($bugsys->in
['vote']);
59 $votefor = $vote['votefor'];
60 $voteagainst = $vote['voteagainst'];
71 $db->query("UPDATE " . TABLE_PREFIX
. "vote SET userids = '$userids', votefor = $votefor, voteagainst = $voteagainst WHERE bugid = $bug[bugid]");
73 $message->redirect('your vote has been added', "showreport.php?bugid=$bug[bugid]");
76 /*=====================================================================*\
77 || ###################################################################
80 || ###################################################################
81 \*=====================================================================*/