5 * Copyright 1999-2001 (c) VA Linux Systems
6 * Copyright 2002-2004 (c) GForge Team
7 * Copyright (C) 2010 Alain Peyrat - Alcatel-Lucent
8 * http://fusionforge.org/
10 * This file is part of FusionForge. FusionForge is free software;
11 * you can redistribute it and/or modify it under the terms of the
12 * GNU General Public License as published by the Free Software
13 * Foundation; either version 2 of the Licence, or (at your option)
16 * FusionForge is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 require_once '../env.inc.php';
27 require_once $gfcommon.'include/pre.php';
29 $HTML->header(array('title'=>_('Voting')));
31 if (!session_loggedin()) {
34 $vote_on_id = getIntFromRequest('vote_on_id');
35 $response = getStringFromRequest('response');
36 $flag = getStringFromRequest('flag');
38 if ($vote_on_id && $response && $flag) {
44 $toss = db_query_params ('DELETE FROM survey_rating_response WHERE user_id=$1 AND type=$2 AND id=$3',
49 $result = db_query_params ('INSERT INTO survey_rating_response (user_id,type,id,response,post_date) VALUES ($1,$2,$3,$4,$5)',
56 $error_msg .= _('Insert Error')._(': ').db_error();
57 session_redirect('/');
59 $feedback .= _('Vote registered');
60 $warning_msg .= _('If you vote again, your old vote will be erased.');
61 session_redirect('/');
64 exit_missing_param('',array(_('Vote ID'),_('Response'),_('Flag')),'survey');