| 1 | <?php
|
|---|
| 2 | // $Id: pollresults.php,v 1.3 2005/09/04 20:46:12 onokazu Exp $
|
|---|
| 3 | // ------------------------------------------------------------------------ //
|
|---|
| 4 | // XOOPS - PHP Content Management System //
|
|---|
| 5 | // Copyright (c) 2000 XOOPS.org //
|
|---|
| 6 | // <http://www.xoops.org/> //
|
|---|
| 7 | // ------------------------------------------------------------------------ //
|
|---|
| 8 | // This program is free software; you can redistribute it and/or modify //
|
|---|
| 9 | // it under the terms of the GNU General Public License as published by //
|
|---|
| 10 | // the Free Software Foundation; either version 2 of the License, or //
|
|---|
| 11 | // (at your option) any later version. //
|
|---|
| 12 | // //
|
|---|
| 13 | // You may not change or alter any portion of this comment or credits //
|
|---|
| 14 | // of supporting developers from this source code or any supporting //
|
|---|
| 15 | // source code which is considered copyrighted (c) material of the //
|
|---|
| 16 | // original comment or credit authors. //
|
|---|
| 17 | // //
|
|---|
| 18 | // This program is distributed in the hope that it will be useful, //
|
|---|
| 19 | // but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
|---|
| 20 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|---|
| 21 | // GNU General Public License for more details. //
|
|---|
| 22 | // //
|
|---|
| 23 | // You should have received a copy of the GNU General Public License //
|
|---|
| 24 | // along with this program; if not, write to the Free Software //
|
|---|
| 25 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
|
|---|
| 26 | // ------------------------------------------------------------------------ //
|
|---|
| 27 |
|
|---|
| 28 | include "../../mainfile.php";
|
|---|
| 29 | include XOOPS_ROOT_PATH."/modules/xoopspoll/include/constants.php";
|
|---|
| 30 | include_once XOOPS_ROOT_PATH."/modules/xoopspoll/class/xoopspoll.php";
|
|---|
| 31 | include_once XOOPS_ROOT_PATH."/modules/xoopspoll/class/xoopspolloption.php";
|
|---|
| 32 | include_once XOOPS_ROOT_PATH."/modules/xoopspoll/class/xoopspolllog.php";
|
|---|
| 33 | include_once XOOPS_ROOT_PATH."/modules/xoopspoll/class/xoopspollrenderer.php";
|
|---|
| 34 |
|
|---|
| 35 | $poll_id = $_GET['poll_id'];
|
|---|
| 36 | if(empty($poll_id)) $poll_id = $_POST['poll_id'];
|
|---|
| 37 |
|
|---|
| 38 | switch($_POST['mode']) {
|
|---|
| 39 | case 'regist':
|
|---|
| 40 | $poll_id = $_POST['poll_id'];
|
|---|
| 41 | $poll = new XoopsPoll($poll_id);
|
|---|
| 42 | if ( $xoopsUser ) {
|
|---|
| 43 | $uid = $xoopsUser->getVar("uid");
|
|---|
| 44 | } else {
|
|---|
| 45 | $uid = 0;
|
|---|
| 46 | }
|
|---|
| 47 | $poll->vote($option_id, xoops_getenv('REMOTE_ADDR'), $uid, $_POST['rating_id'], $_POST['comment']);
|
|---|
| 48 | $poll->updateCount();
|
|---|
| 49 | redirect_header(XOOPS_URL."/modules/xoopspoll/pollresults.php?poll_id=".$poll_id, 1, $msg);
|
|---|
| 50 | exit();
|
|---|
| 51 | break;
|
|---|
| 52 | default:
|
|---|
| 53 | break;
|
|---|
| 54 | }
|
|---|
| 55 |
|
|---|
| 56 | $xoopsOption['template_main'] = 'xoopspoll_new.html';
|
|---|
| 57 | include XOOPS_ROOT_PATH."/header.php";
|
|---|
| 58 |
|
|---|
| 59 | $xoopsTpl->assign('arrStatus', $arrStatus);
|
|---|
| 60 | $xoopsTpl->assign('arrCat', $arrCategory);
|
|---|
| 61 | $xoopsTpl->assign('poll_id', $poll_id);
|
|---|
| 62 |
|
|---|
| 63 | include XOOPS_ROOT_PATH."/footer.php";
|
|---|
| 64 | ?> |
|---|