3 * GForge Survey Facility
5 * Portions Copyright 1999-2001 (c) VA Linux Systems
6 * The rest Copyright 2002-2004 (c) GForge Team
9 * This file is part of GForge.
11 * GForge is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * GForge 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
22 * along with GForge; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 require_once('../env.inc.php');
28 require_once $gfwww.'include/pre.php';
30 $HTML->header(array('title'=>_('Voting')));
32 if (!session_loggedin()) {
33 echo '<div class="error">'._('You must be logged in to vote')."</div>";
35 $vote_on_id = getIntFromRequest('vote_on_id');
36 $response = getStringFromRequest('response');
37 $flag = getStringFromRequest('flag');
39 if ($vote_on_id && $response && $flag) {
45 $toss = db_query_params ('DELETE FROM survey_rating_response WHERE user_id=$1 AND type=$2 AND id=$3',
50 $result = db_query_params ('INSERT INTO survey_rating_response (user_id,type,id,response,post_date) VALUES ($1,$2,$3,$4,$5)',
57 $feedback .= _('ERROR');
58 echo "<h1>"._('Error in insert')."</h1>";
61 $feedback .= _('Vote registered');
62 echo "<h2>"._('Vote registered')."</h2>";
63 echo "<a href=\"javascript:history.back()\"><strong>"._('Click to return to previous page')."</strong></a>
64 <p>"._('If you vote again, your old vote will be erased.')."</p>";
67 echo "<h1>"._('ERROR!!! MISSING PARAMS')."</h1>";
70 $HTML->footer(array());