phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: polls admin.php,1.15,1.16 admin_addanswer.php,1.


From: Dave Hall <address@hidden>
Subject: [Phpgroupware-cvs] CVS: polls admin.php,1.15,1.16 admin_addanswer.php,1.13,1.14 admin_editanswer.php,1.6,1.7 admin_editquestion.php,1.7,1.8 admin_settings.php,1.9,1.10 admin_viewquestion.php,1.8,1.9
Date: Fri, 15 Nov 2002 04:07:45 -0500

Update of /cvsroot/phpgroupware/polls
In directory subversions:/tmp/cvs-serv16750

Modified Files:
        admin.php admin_addanswer.php admin_editanswer.php 
        admin_editquestion.php admin_settings.php 
        admin_viewquestion.php 
Log Message:
patch #641

Index: admin.php
===================================================================
RCS file: /cvsroot/phpgroupware/polls/admin.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** admin.php   30 Apr 2002 00:15:17 -0000      1.15
--- admin.php   15 Nov 2002 09:07:42 -0000      1.16
***************
*** 1,102 ****
! <?php
!   /**************************************************************************\
!   * phpGroupWare - Polls                                                     *
!   * http://www.phpgroupware.org                                              *
!   * --------------------------------------------                             *
!   *  This program is free software; you can redistribute it and/or modify it *
!   *  under the terms of the GNU General Public License as published by the   *
!   *  Free Software Foundation; either version 2 of the License, or (at your  *
!   *  option) any later version.                                              *
!   \**************************************************************************/
! 
!   /* $Id$ */
! 
!       $GLOBALS['phpgw_info'] = Array();
!       $GLOBALS['phpgw_info']['flags'] = array(
!               'admin_only'              => True,
!               'currentapp'              => 'polls',
!               'enable_nextmatchs_class' => True,
!               'admin_header'            => True
!       );
!       include('../header.inc.php');
! 
!       $show  = get_var('show',Array('GET'));
!       $order = get_var('order',Array('GET'));
!       $sort  = get_var('sort',Array('GET'));
! 
!       if(!$show)
!       {
!               $GLOBALS['phpgw']->common->phpgw_exit(True);
!       }
! 
!       if($order)
!       {
!               $ordermethod = " order by $order $sort";
!       }
! 
!       if($show == 'questions')
!       {
!               $GLOBALS['phpgw']->template->set_file(array('admin' => 
'admin_list_questions.tpl'));
!       }
!       else
!       {
!               $GLOBALS['phpgw']->template->set_file(array('admin' => 
'admin_list_answers.tpl'));
!       }
!       $GLOBALS['phpgw']->template->set_block('admin','form','form');
!       $GLOBALS['phpgw']->template->set_block('admin','row','row');
! 
!       $GLOBALS['phpgw']->template->set_unknowns('remove');
! 
!       
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
!       
$GLOBALS['phpgw']->template->set_var('sort_title',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'poll_title',$order,'admin.php',lang('Title'),'&show='
 . $show));
!       if($show == 'answers')
!       {
!               
$GLOBALS['phpgw']->template->set_var('sort_answer',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'option_text',$order,'admin.php',lang('Answer'),'&show='
 . $show));
!       }
! 
!       $GLOBALS['phpgw']->template->set_var('lang_edit',lang('edit'));
!       $GLOBALS['phpgw']->template->set_var('lang_delete',lang('delete'));
!       if($show == 'questions')
!       {
!               $GLOBALS['phpgw']->template->set_var('lang_view',lang('view'));
!       }
! 
!       if($show == 'questions')
!       {
!               $GLOBALS['phpgw']->db->query("select * from phpgw_polls_desc 
$ordermethod",__LINE__,__FILE__);
!       }
!       else
!       {
!               $GLOBALS['phpgw']->db->query("select phpgw_polls_data.*, 
phpgw_polls_desc.poll_title from phpgw_polls_data,"
!                       . "phpgw_polls_desc where phpgw_polls_desc.poll_id = 
phpgw_polls_data.poll_id $ordermethod",__LINE__,__FILE__);
!       }
!       $GLOBALS['phpgw']->template->set_var('rows','');
!       while ($GLOBALS['phpgw']->db->next_record())
!       {
!               $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
!               $GLOBALS['phpgw']->template->set_var('tr_color',$tr_color);
! 
!               if($show == 'questions')
!               {
!                       
$GLOBALS['phpgw']->template->set_var('row_title',$GLOBALS['phpgw']->db->f('poll_title'));
!                       $GLOBALS['phpgw']->template->set_var('row_edit','<a 
href="' . $GLOBALS['phpgw']->link('/polls/admin_editquestion.php','poll_id=' . 
$GLOBALS['phpgw']->db->f('poll_id')) . '">' . lang('Edit') . '</a>');
!                       $GLOBALS['phpgw']->template->set_var('row_delete','<a 
href="' . $GLOBALS['phpgw']->link('/polls/admin_deletequestion.php','poll_id=' 
. $GLOBALS['phpgw']->db->f('poll_id')) . '">' . lang('Delete') . '</a>');
!                       $GLOBALS['phpgw']->template->set_var('row_view','<a 
href="' . $GLOBALS['phpgw']->link('/polls/admin_viewquestion.php','poll_id=' . 
$GLOBALS['phpgw']->db->f('poll_id')) . '">' . lang('View') . '</a>');
!               }
!               else
!               {
!                       
$GLOBALS['phpgw']->template->set_var('row_answer',$GLOBALS['phpgw']->db->f('option_text'));
!                       
$GLOBALS['phpgw']->template->set_var('row_title',$GLOBALS['phpgw']->db->f('poll_title'));
!                       $GLOBALS['phpgw']->template->set_var('row_edit','<a 
href="' . $GLOBALS['phpgw']->link('/polls/admin_editanswer.php','vote_id=' . 
$GLOBALS['phpgw']->db->f('vote_id')) . '">' . lang('Edit') . '</a>');
!                       $GLOBALS['phpgw']->template->set_var('row_delete','<a 
href="' . $GLOBALS['phpgw']->link('/polls/admin_deleteanswer.php','vote_id=' . 
$GLOBALS['phpgw']->db->f('vote_id')) . '">' . lang('Delete') . '</a>');
!               }
!               $GLOBALS['phpgw']->template->parse('rows','row',True);
!       }
! 
!       
$GLOBALS['phpgw']->template->set_var('add_action',$GLOBALS['phpgw']->link('/polls/admin_add'
 . substr($show,0,(strlen($show)-1)) . '.php'));
!       $GLOBALS['phpgw']->template->set_var('lang_add',lang('add'));
! 
!       $GLOBALS['phpgw']->template->pparse('out','form');
! 
!       $GLOBALS['phpgw']->common->phpgw_footer();
! ?>
--- 1,102 ----
! <?php
!   /**************************************************************************\
!   * phpGroupWare - Polls                                                     *
!   * http://www.phpgroupware.org                                              *
!   * --------------------------------------------                             *
!   *  This program is free software; you can redistribute it and/or modify it *
!   *  under the terms of the GNU General Public License as published by the   *
!   *  Free Software Foundation; either version 2 of the License, or (at your  *
!   *  option) any later version.                                              *
!   \**************************************************************************/
! 
!   /* $Id$ */
! 
!       $GLOBALS['phpgw_info'] = Array();
!       $GLOBALS['phpgw_info']['flags'] = array(
!               'admin_only'              => True,
!               'currentapp'              => 'polls',
!               'enable_nextmatchs_class' => True,
!               'admin_header'            => True
!       );
!       include('../header.inc.php');
! 
!       $show  = get_var('show',Array('GET'));
!       $order = get_var('order',Array('GET'));
!       $sort  = get_var('sort',Array('GET'));
! 
!       if(!$show)
!       {
!               $GLOBALS['phpgw']->common->phpgw_exit(True);
!       }
! 
!       if($order)
!       {
!               $ordermethod = " order by $order $sort";
!       }
! 
!       if($show == 'questions')
!       {
!               $GLOBALS['phpgw']->template->set_file(array('admin' => 
'admin_list_questions.tpl'));
!       }
!       else
!       {
!               $GLOBALS['phpgw']->template->set_file(array('admin' => 
'admin_list_answers.tpl'));
!       }
!       $GLOBALS['phpgw']->template->set_block('admin','form','form');
!       $GLOBALS['phpgw']->template->set_block('admin','row','row');
! 
!       $GLOBALS['phpgw']->template->set_unknowns('remove');
! 
!       
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
!       
$GLOBALS['phpgw']->template->set_var('sort_title',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'poll_title',$order,'admin.php',lang('Title'),'&show='
 . $show));
!       if($show == 'answers')
!       {
!               
$GLOBALS['phpgw']->template->set_var('sort_answer',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'option_text',$order,'admin.php',lang('Answer'),'&show='
 . $show));
!       }
! 
!       $GLOBALS['phpgw']->template->set_var('lang_edit',lang('edit'));
!       $GLOBALS['phpgw']->template->set_var('lang_delete',lang('delete'));
!       if($show == 'questions')
!       {
!               $GLOBALS['phpgw']->template->set_var('lang_view',lang('view'));
!       }
! 
!       if($show == 'questions')
!       {
!               $GLOBALS['phpgw']->db->query("select * from phpgw_polls_desc 
$ordermethod",__LINE__,__FILE__);
!       }
!       else
!       {
!               $GLOBALS['phpgw']->db->query("select phpgw_polls_data.*, 
phpgw_polls_desc.poll_title from phpgw_polls_data,"
!                       . "phpgw_polls_desc where phpgw_polls_desc.poll_id = 
phpgw_polls_data.poll_id $ordermethod",__LINE__,__FILE__);
!       }
!       $GLOBALS['phpgw']->template->set_var('rows','');
!       while ($GLOBALS['phpgw']->db->next_record())
!       {
!               $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
!               $GLOBALS['phpgw']->template->set_var('tr_color',$tr_color);
! 
!               if($show == 'questions')
!               {
!                       
$GLOBALS['phpgw']->template->set_var('row_title',stripslashes($GLOBALS['phpgw']->db->f('poll_title')));
!                       $GLOBALS['phpgw']->template->set_var('row_edit','<a 
href="' . $GLOBALS['phpgw']->link('/polls/admin_editquestion.php','poll_id=' . 
$GLOBALS['phpgw']->db->f('poll_id')) . '">' . lang('Edit') . '</a>');
!                       $GLOBALS['phpgw']->template->set_var('row_delete','<a 
href="' . $GLOBALS['phpgw']->link('/polls/admin_deletequestion.php','poll_id=' 
. $GLOBALS['phpgw']->db->f('poll_id')) . '">' . lang('Delete') . '</a>');
!                       $GLOBALS['phpgw']->template->set_var('row_view','<a 
href="' . $GLOBALS['phpgw']->link('/polls/admin_viewquestion.php','poll_id=' . 
$GLOBALS['phpgw']->db->f('poll_id')) . '">' . lang('View') . '</a>');
!               }
!               else
!               {
!                       
$GLOBALS['phpgw']->template->set_var('row_answer',stripslashes(($GLOBALS['phpgw']->db->f('option_text')));
!                       
$GLOBALS['phpgw']->template->set_var('row_title',stripslashes($GLOBALS['phpgw']->db->f('poll_title')));
!                       $GLOBALS['phpgw']->template->set_var('row_edit','<a 
href="' . $GLOBALS['phpgw']->link('/polls/admin_editanswer.php','vote_id=' . 
$GLOBALS['phpgw']->db->f('vote_id')) . '">' . lang('Edit') . '</a>');
!                       $GLOBALS['phpgw']->template->set_var('row_delete','<a 
href="' . $GLOBALS['phpgw']->link('/polls/admin_deleteanswer.php','vote_id=' . 
$GLOBALS['phpgw']->db->f('vote_id')) . '">' . lang('Delete') . '</a>');
!               }
!               $GLOBALS['phpgw']->template->parse('rows','row',True);
!       }
! 
!       
$GLOBALS['phpgw']->template->set_var('add_action',$GLOBALS['phpgw']->link('/polls/admin_add'
 . substr($show,0,(strlen($show)-1)) . '.php'));
!       $GLOBALS['phpgw']->template->set_var('lang_add',lang('add'));
! 
!       $GLOBALS['phpgw']->template->pparse('out','form');
! 
!       $GLOBALS['phpgw']->common->phpgw_footer();
! ?>

Index: admin_addanswer.php
===================================================================
RCS file: /cvsroot/phpgroupware/polls/admin_addanswer.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** admin_addanswer.php 30 Apr 2002 00:15:17 -0000      1.13
--- admin_addanswer.php 15 Nov 2002 09:07:42 -0000      1.14
***************
*** 1,67 ****
! <?php
!       
/**************************************************************************\
!       * phpGroupWare - Polls                                                  
   *
!       * http://www.phpgroupware.org                                           
   *
!       * --------------------------------------------                          
   *
!       *  This program is free software; you can redistribute it and/or modify 
it *
!       *  under the terms of the GNU General Public License as published by 
the   *
!       *  Free Software Foundation; either version 2 of the License, or (at 
your  *
!       *  option) any later version.                                           
   *
!       
\**************************************************************************/
! 
!       /* $Id$ */
! 
!       $GLOBALS['phpgw_info'] = array();
!       $GLOBALS['phpgw_info']['flags'] = array(
!               'admin_only'              => True,
!               'currentapp'              => 'polls',
!               'enable_nextmatchs_class' => True,
!               'admin_header'            => True
!       );
!       include('../header.inc.php');
! 
!       $GLOBALS['phpgw']->template->set_file(array('admin' => 
'admin_form.tpl'));
!       $GLOBALS['phpgw']->template->set_block('admin','form','form');
!       $GLOBALS['phpgw']->template->set_block('admin','row','row');
! 
!       if(get_var('submit',Array('POST')))
!       {
!               $poll_id = get_var('poll_Id',Array('POST'));
!               $answer  = get_var('answer',Array('POST'));
!               $vote_id = get_var('vote_Id',Array('POST'));
! 
!               $GLOBALS['phpgw']->db->query("select max(vote_id)+1 from 
phpgw_polls_data where poll_id='$poll_id'",__LINE__,__FILE__);
!               $GLOBALS['phpgw']->db->next_record();
!               $vote_id = $GLOBALS['phpgw']->db->f(0);
! 
!               $GLOBALS['phpgw']->db->query("insert into phpgw_polls_data 
(poll_id,option_text,option_count,vote_id) values ('$poll_id','"
!                       . addslashes($answer) . 
"',0,'$vote_id')",__LINE__,__FILE__);
!               $GLOBALS['phpgw']->template->set_var('message',lang('Answer has 
been added to poll'));
!       }
! 
!       $GLOBALS['phpgw']->template->set_var('header_message',lang('Add answer 
to poll'));
!       $GLOBALS['phpgw']->template->set_var('td_message','&nbsp;');
!       
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
!       
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/polls/admin_addanswer.php'));
!       $GLOBALS['phpgw']->template->set_var('form_button_1','<input 
type="submit" name="submit" value="' . lang('Add') . '">');
!       $GLOBALS['phpgw']->template->set_var('form_button_2','</form><form 
method="POST" action="' . $GLOBALS['phpgw']->link('/polls/admin.php') . 
'"><input type="submit" name="submit" value="' . lang('Cancel') . '">');
! 
!       $poll_select = '<select name="poll_id">';
!       $GLOBALS['phpgw']->db->query("select * from 
phpgw_polls_desc",__LINE__,__FILE__);
!       while ($GLOBALS['phpgw']->db->next_record())
!       {
!               $poll_select .= '<option value="' . 
$GLOBALS['phpgw']->db->f('poll_id') . '"';
!               if ($poll_id == $GLOBALS['phpgw']->db->f('poll_id'))
!               {
!                       $poll_select .= ' selected';
!               }
!               $poll_select .= '>' . $GLOBALS['phpgw']->db->f('poll_title') . 
'</option>';
!       }
!       $poll_select .= '</select>';
! 
!       add_template_row($GLOBALS['phpgw']->template,lang('Which 
poll'),$poll_select);
!       add_template_row($GLOBALS['phpgw']->template,lang('Answer'),'<input 
name="answer">');
! 
!       $GLOBALS['phpgw']->template->pfp('out','form');
!       $GLOBALS['phpgw']->common->phpgw_footer();
! ?>
--- 1,67 ----
! <?php
!       
/**************************************************************************\
!       * phpGroupWare - Polls                                                  
   *
!       * http://www.phpgroupware.org                                           
   *
!       * --------------------------------------------                          
   *
!       *  This program is free software; you can redistribute it and/or modify 
it *
!       *  under the terms of the GNU General Public License as published by 
the   *
!       *  Free Software Foundation; either version 2 of the License, or (at 
your  *
!       *  option) any later version.                                           
   *
!       
\**************************************************************************/
! 
!       /* $Id$ */
! 
!       $GLOBALS['phpgw_info'] = array();
!       $GLOBALS['phpgw_info']['flags'] = array(
!               'admin_only'              => True,
!               'currentapp'              => 'polls',
!               'enable_nextmatchs_class' => True,
!               'admin_header'            => True
!       );
!       include('../header.inc.php');
! 
!       $GLOBALS['phpgw']->template->set_file(array('admin' => 
'admin_form.tpl'));
!       $GLOBALS['phpgw']->template->set_block('admin','form','form');
!       $GLOBALS['phpgw']->template->set_block('admin','row','row');
! 
!       if(get_var('submit',Array('POST')))
!       {
!               $poll_id = get_var('poll_Id',Array('POST'));
!               $answer  = get_var('answer',Array('POST'));
!               $vote_id = get_var('vote_Id',Array('POST'));
! 
!               $GLOBALS['phpgw']->db->query("select max(vote_id)+1 from 
phpgw_polls_data where poll_id='$poll_id'",__LINE__,__FILE__);
!               $GLOBALS['phpgw']->db->next_record();
!               $vote_id = $GLOBALS['phpgw']->db->f(0);
! 
!               $GLOBALS['phpgw']->db->query("insert into phpgw_polls_data 
(poll_id,option_text,option_count,vote_id) values ('$poll_id','"
!                       . addslashes($answer) . 
"',0,'$vote_id')",__LINE__,__FILE__);
!               $GLOBALS['phpgw']->template->set_var('message',lang('Answer has 
been added to poll'));
!       }
! 
!       $GLOBALS['phpgw']->template->set_var('header_message',lang('Add answer 
to poll'));
!       $GLOBALS['phpgw']->template->set_var('td_message','&nbsp;');
!       
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
!       
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/polls/admin_addanswer.php'));
!       $GLOBALS['phpgw']->template->set_var('form_button_1','<input 
type="submit" name="submit" value="' . lang('Add') . '">');
!       $GLOBALS['phpgw']->template->set_var('form_button_2','</form><form 
method="POST" action="' . $GLOBALS['phpgw']->link('/polls/admin.php') . 
'"><input type="submit" name="submit" value="' . lang('Cancel') . '">');
! 
!       $poll_select = '<select name="poll_id">';
!       $GLOBALS['phpgw']->db->query("select * from 
phpgw_polls_desc",__LINE__,__FILE__);
!       while ($GLOBALS['phpgw']->db->next_record())
!       {
!               $poll_select .= '<option value="' . 
$GLOBALS['phpgw']->db->f('poll_id') . '"';
!               if ($poll_id == $GLOBALS['phpgw']->db->f('poll_id'))
!               {
!                       $poll_select .= ' selected';
!               }
!               $poll_select .= '>' . 
stripslashes($GLOBALS['phpgw']->db->f('poll_title')) . '</option>';
!       }
!       $poll_select .= '</select>';
! 
!       add_template_row($GLOBALS['phpgw']->template,lang('Which 
poll'),$poll_select);
!       add_template_row($GLOBALS['phpgw']->template,lang('Answer'),'<input 
name="answer">');
! 
!       $GLOBALS['phpgw']->template->pfp('out','form');
!       $GLOBALS['phpgw']->common->phpgw_footer();
! ?>

Index: admin_editanswer.php
===================================================================
RCS file: /cvsroot/phpgroupware/polls/admin_editanswer.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** admin_editanswer.php        21 Dec 2001 14:59:46 -0000      1.6
--- admin_editanswer.php        15 Nov 2002 09:07:42 -0000      1.7
***************
*** 1,70 ****
! <?php
!   /**************************************************************************\
!   * phpGroupWare - Polls                                                     *
!   * http://www.phpgroupware.org                                              *
!   * --------------------------------------------                             *
!   *  This program is free software; you can redistribute it and/or modify it *
!   *  under the terms of the GNU General Public License as published by the   *
!   *  Free Software Foundation; either version 2 of the License, or (at your  *
!   *  option) any later version.                                              *
!   \**************************************************************************/
! 
!   /* $Id$ */
! 
!       $phpgw_info = array();
!       $GLOBALS['phpgw_info']['flags'] = array(
!               'admin_only'              => True,
!               'currentapp'              => 'polls',
!               'enable_nextmatchs_class' => True,
!               'admin_header'            => True
!       );
!       include('../header.inc.php');
! 
!       $GLOBALS['phpgw']->template->set_file(array('admin' => 
'admin_form.tpl'));
!       $GLOBALS['phpgw']->template->set_block('admin','form','form');
!       $GLOBALS['phpgw']->template->set_block('admin','row','row');
! 
!       if ($submit)
!       {
!               $GLOBALS['phpgw']->db->query("update phpgw_polls_data set 
poll_id='$poll_id',option_text='"
!                       . addslashes($answer) . "' where 
vote_id='$vote_id'",__LINE__,__FILE__);
!               $GLOBALS['phpgw']->template->set_var('message',lang('Answer has 
been updated'));
!       }
!       else
!       {
!               $GLOBALS['phpgw']->template->set_var('message','');
!       }
! 
!       $GLOBALS['phpgw']->db->query("select * from phpgw_polls_data where 
vote_id='$vote_id'");
!       $GLOBALS['phpgw']->db->next_record();
!       $answer_value = $GLOBALS['phpgw']->db->f('option_text');
!       $poll_id = $GLOBALS['phpgw']->db->f('poll_id');
! 
!       $GLOBALS['phpgw']->template->set_var('header_message',lang('Edit 
answer'));
!       $GLOBALS['phpgw']->template->set_var('td_message','&nbsp;');
!       
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
!       
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/polls/admin_editanswer.php','vote_id='
 . $vote_id));
!       $GLOBALS['phpgw']->template->set_var('form_button_1','<input 
type="submit" name="submit" value="' . lang('Edit') . '">');
!       $GLOBALS['phpgw']->template->set_var('form_button_2','</form><form 
method="POST" action="' . 
$GLOBALS['phpgw']->link('/polls/admin.php','show=answers')
!               . '"><input type="submit" name="submit" value="' . 
lang('Cancel') . '">'
!       );
! 
!       $poll_select = '<select name="poll_id">';
!       $GLOBALS['phpgw']->db->query("select * from 
phpgw_polls_desc",__LINE__,__FILE__);
!       while ($GLOBALS['phpgw']->db->next_record())
!       {
!               $poll_select .= '<option value="' . 
$GLOBALS['phpgw']->db->f('poll_id') . '"';
!               if ($poll_id == $GLOBALS['phpgw']->db->f('poll_id'))
!               {
!                       $poll_select .= ' selected';
!               }
!               $poll_select .= '>' . $GLOBALS['phpgw']->db->f('poll_title') . 
'</option>';
!       }
!       $poll_select .= '</select>';
! 
!       add_template_row($p,lang('Which poll'),$poll_select);
!       add_template_row($p,lang('Answer'),'<input name="answer" value="' . 
$answer_value . '">');
! 
!       $GLOBALS['phpgw']->template->pparse('out','form');
!       $GLOBALS['phpgw']->common->phpgw_footer();
! ?>
--- 1,70 ----
! <?php
!   /**************************************************************************\
!   * phpGroupWare - Polls                                                     *
!   * http://www.phpgroupware.org                                              *
!   * --------------------------------------------                             *
!   *  This program is free software; you can redistribute it and/or modify it *
!   *  under the terms of the GNU General Public License as published by the   *
!   *  Free Software Foundation; either version 2 of the License, or (at your  *
!   *  option) any later version.                                              *
!   \**************************************************************************/
! 
!   /* $Id$ */
! 
!       $phpgw_info = array();
!       $GLOBALS['phpgw_info']['flags'] = array(
!               'admin_only'              => True,
!               'currentapp'              => 'polls',
!               'enable_nextmatchs_class' => True,
!               'admin_header'            => True
!       );
!       include('../header.inc.php');
! 
!       $GLOBALS['phpgw']->template->set_file(array('admin' => 
'admin_form.tpl'));
!       $GLOBALS['phpgw']->template->set_block('admin','form','form');
!       $GLOBALS['phpgw']->template->set_block('admin','row','row');
! 
!       if ($submit)
!       {
!               $GLOBALS['phpgw']->db->query("update phpgw_polls_data set 
poll_id='$poll_id',option_text='"
!                       . addslashes($answer) . "' where 
vote_id='$vote_id'",__LINE__,__FILE__);
!               $GLOBALS['phpgw']->template->set_var('message',lang('Answer has 
been updated'));
!       }
!       else
!       {
!               $GLOBALS['phpgw']->template->set_var('message','');
!       }
! 
!       $GLOBALS['phpgw']->db->query("select * from phpgw_polls_data where 
vote_id='$vote_id'");
!       $GLOBALS['phpgw']->db->next_record();
!       $answer_value = stripslashes($GLOBALS['phpgw']->db->f('option_text'));
!       $poll_id = $GLOBALS['phpgw']->db->f('poll_id');
! 
!       $GLOBALS['phpgw']->template->set_var('header_message',lang('Edit 
answer'));
!       $GLOBALS['phpgw']->template->set_var('td_message','&nbsp;');
!       
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
!       
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/polls/admin_editanswer.php','vote_id='
 . $vote_id));
!       $GLOBALS['phpgw']->template->set_var('form_button_1','<input 
type="submit" name="submit" value="' . lang('Edit') . '">');
!       $GLOBALS['phpgw']->template->set_var('form_button_2','</form><form 
method="POST" action="' . 
$GLOBALS['phpgw']->link('/polls/admin.php','show=answers')
!               . '"><input type="submit" name="submit" value="' . 
lang('Cancel') . '">'
!       );
! 
!       $poll_select = '<select name="poll_id">';
!       $GLOBALS['phpgw']->db->query("select * from 
phpgw_polls_desc",__LINE__,__FILE__);
!       while ($GLOBALS['phpgw']->db->next_record())
!       {
!               $poll_select .= '<option value="' . 
$GLOBALS['phpgw']->db->f('poll_id') . '"';
!               if ($poll_id == $GLOBALS['phpgw']->db->f('poll_id'))
!               {
!                       $poll_select .= ' selected';
!               }
!               $poll_select .= '>' . 
stripslashes($GLOBALS['phpgw']->db->f('poll_title')) . '</option>';
!       }
!       $poll_select .= '</select>';
! 
!       add_template_row($GLOBALS['phpgw']->template,lang('Which 
poll'),$poll_select);
!       add_template_row($GLOBALS['phpgw']->template,lang('Answer'),'<input 
name="answer" value="' . $answer_value . '">');
! 
!       $GLOBALS['phpgw']->template->pparse('out','form');
!       $GLOBALS['phpgw']->common->phpgw_footer();
! ?>

Index: admin_editquestion.php
===================================================================
RCS file: /cvsroot/phpgroupware/polls/admin_editquestion.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** admin_editquestion.php      30 Apr 2002 00:15:17 -0000      1.7
--- admin_editquestion.php      15 Nov 2002 09:07:42 -0000      1.8
***************
*** 1,58 ****
! <?php
!   /**************************************************************************\
!   * phpGroupWare - Polls                                                     *
!   * http://www.phpgroupware.org                                              *
!   * --------------------------------------------                             *
!   *  This program is free software; you can redistribute it and/or modify it *
!   *  under the terms of the GNU General Public License as published by the   *
!   *  Free Software Foundation; either version 2 of the License, or (at your  *
!   *  option) any later version.                                              *
!   \**************************************************************************/
! 
!   /* $Id$ */
! 
!       $GLOBALS['phpgw_info'] = array();
!       $GLOBALS['phpgw_info']['flags'] = array(
!               'admin_only'              => True,
!               'currentapp'              => 'polls',
!               'enable_nextmatchs_class' => True,
!               'admin_header'            => True
!       );
!       include('../header.inc.php');
! 
!       $GLOBALS['phpgw']->template->set_file(array('admin' => 
'admin_form.tpl'));
!       $GLOBALS['phpgw']->template->set_block('admin','form','form');
!       $GLOBALS['phpgw']->template->set_block('admin','row','row');
! 
!       $poll_id = get_var('poll_id',Array('POST','GET'));
! 
!       if(get_var('edit',Array('POST')))
!       {
!               $question = get_var('question',Array('POST'));
!               $GLOBALS['phpgw']->db->query("update phpgw_polls_desc set 
poll_title='" . addslashes($question)
!                       . "' where poll_id='$poll_id'",__LINE__,__FILE__);
!               $GLOBALS['phpgw']->template->set_var('message',lang('Question 
has been updated'));
!       }
!       else
!       {
!               $GLOBALS['phpgw']->template->set_var('message','');
!       }
! 
!       $GLOBALS['phpgw']->db->query("select * from phpgw_polls_desc where 
poll_id='$poll_id'",__LINE__,__FILE__);
!       $GLOBALS['phpgw']->db->next_record();
! 
!       $GLOBALS['phpgw']->template->set_var('header_message',lang('Edit poll 
question'));
!       $GLOBALS['phpgw']->template->set_var('td_message','&nbsp;');
!       
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
!       $GLOBALS['phpgw']->template->set_var('poll_id',$poll_id);
!       
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/polls/admin_editquestion.php','poll_id='
 . $poll_id));
!       $GLOBALS['phpgw']->template->set_var('form_button_1','<input 
type="submit" name="edit" value="' . lang('Edit') . '">');
!       $GLOBALS['phpgw']->template->set_var('form_button_2','</form><form 
method="POST" action="' . 
$GLOBALS['phpgw']->link('/polls/admin.php','show=questions')
!               . '"><input type="submit" name="submit" value="' . 
lang('Cancel') . '">'
!       );
! 
!       add_template_row($GLOBALS['phpgw']->template,lang('Poll 
question'),'<input name="question" value="' . 
$GLOBALS['phpgw']->db->f('poll_title') . '">');
! 
!       $GLOBALS['phpgw']->template->pparse('out','form');
!       $GLOBALS['phpgw']->common->phpgw_footer();
! ?>
--- 1,58 ----
! <?php
!   /**************************************************************************\
!   * phpGroupWare - Polls                                                     *
!   * http://www.phpgroupware.org                                              *
!   * --------------------------------------------                             *
!   *  This program is free software; you can redistribute it and/or modify it *
!   *  under the terms of the GNU General Public License as published by the   *
!   *  Free Software Foundation; either version 2 of the License, or (at your  *
!   *  option) any later version.                                              *
!   \**************************************************************************/
! 
!   /* $Id$ */
! 
!       $GLOBALS['phpgw_info'] = array();
!       $GLOBALS['phpgw_info']['flags'] = array(
!               'admin_only'              => True,
!               'currentapp'              => 'polls',
!               'enable_nextmatchs_class' => True,
!               'admin_header'            => True
!       );
!       include('../header.inc.php');
! 
!       $GLOBALS['phpgw']->template->set_file(array('admin' => 
'admin_form.tpl'));
!       $GLOBALS['phpgw']->template->set_block('admin','form','form');
!       $GLOBALS['phpgw']->template->set_block('admin','row','row');
! 
!       $poll_id = get_var('poll_id',Array('POST','GET'));
! 
!       if(get_var('edit',Array('POST')))
!       {
!               $question = get_var('question',Array('POST'));
!               $GLOBALS['phpgw']->db->query("update phpgw_polls_desc set 
poll_title='" . addslashes($question)
!                       . "' where poll_id='$poll_id'",__LINE__,__FILE__);
!               $GLOBALS['phpgw']->template->set_var('message',lang('Question 
has been updated'));
!       }
!       else
!       {
!               $GLOBALS['phpgw']->template->set_var('message','');
!       }
! 
!       $GLOBALS['phpgw']->db->query("select * from phpgw_polls_desc where 
poll_id='$poll_id'",__LINE__,__FILE__);
!       $GLOBALS['phpgw']->db->next_record();
! 
!       $GLOBALS['phpgw']->template->set_var('header_message',lang('Edit poll 
question'));
!       $GLOBALS['phpgw']->template->set_var('td_message','&nbsp;');
!       
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
!       $GLOBALS['phpgw']->template->set_var('poll_id',$poll_id);
!       
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/polls/admin_editquestion.php','poll_id='
 . $poll_id));
!       $GLOBALS['phpgw']->template->set_var('form_button_1','<input 
type="submit" name="edit" value="' . lang('Edit') . '">');
!       $GLOBALS['phpgw']->template->set_var('form_button_2','</form><form 
method="POST" action="' . 
$GLOBALS['phpgw']->link('/polls/admin.php','show=questions')
!               . '"><input type="submit" name="submit" value="' . 
lang('Cancel') . '">'
!       );
! 
!       add_template_row($GLOBALS['phpgw']->template,lang('Poll 
question'),'<input name="question" value="' . 
stripslashes($GLOBALS['phpgw']->db->f('poll_title')) . '">');
! 
!       $GLOBALS['phpgw']->template->pparse('out','form');
!       $GLOBALS['phpgw']->common->phpgw_footer();
! ?>

Index: admin_settings.php
===================================================================
RCS file: /cvsroot/phpgroupware/polls/admin_settings.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** admin_settings.php  30 Apr 2002 00:15:17 -0000      1.9
--- admin_settings.php  15 Nov 2002 09:07:42 -0000      1.10
***************
*** 1,61 ****
! <?php
!   /**************************************************************************\
!   * phpGroupWare - Polls                                                     *
!   * http://www.phpgroupware.org                                              *
!   * --------------------------------------------                             *
!   *  This program is free software; you can redistribute it and/or modify it *
!   *  under the terms of the GNU General Public License as published by the   *
!   *  Free Software Foundation; either version 2 of the License, or (at your  *
!   *  option) any later version.                                              *
!   \**************************************************************************/
! 
!   /* $Id$ */
! 
!       $GLOBALS['phpgw_info'] = array();
!       $GLOBALS['phpgw_info']['flags'] = array(
!               'admin_only'              => True,
!               'currentapp'              => 'polls',
!               'enable_nextmatchs_class' => True,
!               'admin_header'            => True
!       );
!       include('../header.inc.php');
! 
!       if(get_var('submit',Array('POST')))
!       {
!               $settings = get_var('settings',Array('POST'));
!               $GLOBALS['phpgw']->db->query('delete from 
phpgw_polls_settings',__LINE__,__FILE__);
! 
!               while(list($name,$value) = each($settings))
!               {
!                       $GLOBALS['phpgw']->db->query("insert into 
phpgw_polls_settings values ('$name','$value')",__LINE__,__FILE__);
!               }
!               echo '<center>' . lang('Settings updated') . '</center>';
!       }
!       else
!       {
!               $GLOBALS['phpgw']->db->query('select * from 
phpgw_polls_settings',__LINE__,__FILE__);
!               while ($GLOBALS['phpgw']->db->next_record())
!               {
!                       $settings[$GLOBALS['phpgw']->db->f('setting_name')] = 
$GLOBALS['phpgw']->db->f('setting_value');
!               }
!       }
! 
!       echo '<form action="' . 
$GLOBALS['phpgw']->link('/polls/admin_settings.php') . '" method="POST">';
!       echo '<table border="0">';
!       echo '<tr><td>' . lang('Allow users to vote more then once') . '</td>'
!               . '    <td><input type="checkbox" 
name="settings[allow_multiable_votes]"' . ($settings['allow_multiable_votes']?' 
checked':'') . ' value="True"></td></tr>';
!       echo '<tr><td>' . lang('Select current poll') . '</td>'
!               . '    <td><select name="settings[currentpoll]">';
!       $GLOBALS['phpgw']->db->query('select * from phpgw_polls_desc order by 
poll_title',__LINE__,__FILE__);
!       while ($GLOBALS['phpgw']->db->next_record())
!       {
!               echo '<option value="' . $GLOBALS['phpgw']->db->f('poll_id') . 
'"'
!                       . ($settings['currentpoll'] == 
$GLOBALS['phpgw']->db->f('poll_id')?' selected':'') 
!                       . '>' . $GLOBALS['phpgw']->db->f('poll_title') . 
'</option>';
!       }
!       echo '</select></td></tr>';
! 
!       echo '<tr><td colspan="2"><input type="submit" name="submit" value="' . 
lang('Submit') . '"></td></tr>';
!       echo '</table></form>';
!       $GLOBALS['phpgw']->common->phpgw_footer();
! ?>
--- 1,61 ----
! <?php
!   /**************************************************************************\
!   * phpGroupWare - Polls                                                     *
!   * http://www.phpgroupware.org                                              *
!   * --------------------------------------------                             *
!   *  This program is free software; you can redistribute it and/or modify it *
!   *  under the terms of the GNU General Public License as published by the   *
!   *  Free Software Foundation; either version 2 of the License, or (at your  *
!   *  option) any later version.                                              *
!   \**************************************************************************/
! 
!   /* $Id$ */
! 
!       $GLOBALS['phpgw_info'] = array();
!       $GLOBALS['phpgw_info']['flags'] = array(
!               'admin_only'              => True,
!               'currentapp'              => 'polls',
!               'enable_nextmatchs_class' => True,
!               'admin_header'            => True
!       );
!       include('../header.inc.php');
! 
!       if(get_var('submit',Array('POST')))
!       {
!               $settings = get_var('settings',Array('POST'));
!               $GLOBALS['phpgw']->db->query('delete from 
phpgw_polls_settings',__LINE__,__FILE__);
! 
!               while(list($name,$value) = each($settings))
!               {
!                       $GLOBALS['phpgw']->db->query("insert into 
phpgw_polls_settings values ('$name','$value')",__LINE__,__FILE__);
!               }
!               echo '<center>' . lang('Settings updated') . '</center>';
!       }
!       else
!       {
!               $GLOBALS['phpgw']->db->query('select * from 
phpgw_polls_settings',__LINE__,__FILE__);
!               while ($GLOBALS['phpgw']->db->next_record())
!               {
!                       $settings[$GLOBALS['phpgw']->db->f('setting_name')] = 
$GLOBALS['phpgw']->db->f('setting_value');
!               }
!       }
! 
!       echo '<form action="' . 
$GLOBALS['phpgw']->link('/polls/admin_settings.php') . '" method="POST">';
!       echo '<table border="0">';
!       echo '<tr><td>' . lang('Allow users to vote more then once') . '</td>'
!               . '    <td><input type="checkbox" 
name="settings[allow_multiable_votes]"' . ($settings['allow_multiable_votes']?' 
checked':'') . ' value="True"></td></tr>';
!       echo '<tr><td>' . lang('Select current poll') . '</td>'
!               . '    <td><select name="settings[currentpoll]">';
!       $GLOBALS['phpgw']->db->query('select * from phpgw_polls_desc order by 
poll_title',__LINE__,__FILE__);
!       while ($GLOBALS['phpgw']->db->next_record())
!       {
!               echo '<option value="' . $GLOBALS['phpgw']->db->f('poll_id') . 
'"'
!                       . ($settings['currentpoll'] == 
$GLOBALS['phpgw']->db->f('poll_id')?' selected':'') 
!                       . '>' . 
stripslashes($GLOBALS['phpgw']->db->f('poll_title')) . '</option>';
!       }
!       echo '</select></td></tr>';
! 
!       echo '<tr><td colspan="2"><input type="submit" name="submit" value="' . 
lang('Submit') . '"></td></tr>';
!       echo '</table></form>';
!       $GLOBALS['phpgw']->common->phpgw_footer();
! ?>

Index: admin_viewquestion.php
===================================================================
RCS file: /cvsroot/phpgroupware/polls/admin_viewquestion.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** admin_viewquestion.php      30 Apr 2002 00:15:17 -0000      1.8
--- admin_viewquestion.php      15 Nov 2002 09:07:42 -0000      1.9
***************
*** 1,59 ****
! <?php
!   /**************************************************************************\
!   * phpGroupWare - Polls                                                     *
!   * http://www.phpgroupware.org                                              *
!   * --------------------------------------------                             *
!   *  This program is free software; you can redistribute it and/or modify it *
!   *  under the terms of the GNU General Public License as published by the   *
!   *  Free Software Foundation; either version 2 of the License, or (at your  *
!   *  option) any later version.                                              *
!   \**************************************************************************/
! 
!   /* $Id$ */
! 
!       $phpgw_info = array();
!       $GLOBALS['phpgw_info']['flags'] = array(
!               'admin_only'              => True,
!               'currentapp'              => 'polls',
!               'enable_nextmatchs_class' => True,
!               'admin_header'            => True
!       );
!       include('../header.inc.php');
! 
!       $poll_id = get_var('poll_id',Array('GET'));
! 
!       $GLOBALS['phpgw']->template->set_file(array('admin' => 
'admin_form.tpl'));
!       $GLOBALS['phpgw']->template->set_block('admin','form','form');
!       $GLOBALS['phpgw']->template->set_block('admin','row','row');
! 
!       $GLOBALS['phpgw']->db->query("select poll_title from phpgw_polls_desc 
where poll_id='$poll_id'");
!       $GLOBALS['phpgw']->db->next_record();
!       $poll_title = $GLOBALS['phpgw']->db->f('poll_title');
! 
!       $GLOBALS['phpgw']->template->set_var('message','');
!       $GLOBALS['phpgw']->template->set_var('header_message',lang('View 
poll'));
!       $GLOBALS['phpgw']->template->set_var('td_message','&nbsp;');
!       
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
!       
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/polls/admin_editquestion.php'));
!       $GLOBALS['phpgw']->template->set_var('poll_id',$poll_id);
!       $GLOBALS['phpgw']->template->set_var('form_button_1','<input 
type="submit" name="submit" value="' . lang('Edit') . '">');
!       $GLOBALS['phpgw']->template->set_var('form_button_2','</form><form 
method="POST" action="'
!               . 
$GLOBALS['phpgw']->link("/polls/admin_deletequestion.php","poll_id=$poll_id") . 
'"><input type="submit" name="submit" value="' . lang('Delete') . '">');
! 
!       add_template_row($GLOBALS['phpgw']->template,lang('Poll 
question'),$GLOBALS['phpgw']->strip_html($poll_title));
! 
!       $GLOBALS['phpgw']->db->query("select * from phpgw_polls_data where 
poll_id='$poll_id'");
!       while ($GLOBALS['phpgw']->db->next_record())
!       {
!               if (! $title_shown)
!               {
!                       $title = lang('Answers');
!                       $title_shown = True;
!               }
!               
add_template_row($GLOBALS['phpgw']->template,$title,$GLOBALS['phpgw']->strip_html($GLOBALS['phpgw']->db->f('option_text')));
!               $title = '&nbsp;';
!       }
! 
!       $GLOBALS['phpgw']->template->pparse('out','form');
!       $GLOBALS['phpgw']->common->phpgw_footer();
! ?>
--- 1,59 ----
! <?php
!   /**************************************************************************\
!   * phpGroupWare - Polls                                                     *
!   * http://www.phpgroupware.org                                              *
!   * --------------------------------------------                             *
!   *  This program is free software; you can redistribute it and/or modify it *
!   *  under the terms of the GNU General Public License as published by the   *
!   *  Free Software Foundation; either version 2 of the License, or (at your  *
!   *  option) any later version.                                              *
!   \**************************************************************************/
! 
!   /* $Id$ */
! 
!       $phpgw_info = array();
!       $GLOBALS['phpgw_info']['flags'] = array(
!               'admin_only'              => True,
!               'currentapp'              => 'polls',
!               'enable_nextmatchs_class' => True,
!               'admin_header'            => True
!       );
!       include('../header.inc.php');
! 
!       $poll_id = get_var('poll_id',Array('GET'));
! 
!       $GLOBALS['phpgw']->template->set_file(array('admin' => 
'admin_form.tpl'));
!       $GLOBALS['phpgw']->template->set_block('admin','form','form');
!       $GLOBALS['phpgw']->template->set_block('admin','row','row');
! 
!       $GLOBALS['phpgw']->db->query("select poll_title from phpgw_polls_desc 
where poll_id='$poll_id'");
!       $GLOBALS['phpgw']->db->next_record();
!       $poll_title = stripslashes($GLOBALS['phpgw']->db->f('poll_title'));
! 
!       $GLOBALS['phpgw']->template->set_var('message','');
!       $GLOBALS['phpgw']->template->set_var('header_message',lang('View 
poll'));
!       $GLOBALS['phpgw']->template->set_var('td_message','&nbsp;');
!       
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
!       
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/polls/admin_editquestion.php'));
!       $GLOBALS['phpgw']->template->set_var('poll_id',$poll_id);
!       $GLOBALS['phpgw']->template->set_var('form_button_1','<input 
type="submit" name="submit" value="' . lang('Edit') . '">');
!       $GLOBALS['phpgw']->template->set_var('form_button_2','</form><form 
method="POST" action="'
!               . 
$GLOBALS['phpgw']->link("/polls/admin_deletequestion.php","poll_id=$poll_id") . 
'"><input type="submit" name="submit" value="' . lang('Delete') . '">');
! 
!       add_template_row($GLOBALS['phpgw']->template,lang('Poll 
question'),$GLOBALS['phpgw']->strip_html($poll_title));
! 
!       $GLOBALS['phpgw']->db->query("select * from phpgw_polls_data where 
poll_id='$poll_id'");
!       while ($GLOBALS['phpgw']->db->next_record())
!       {
!               if (! $title_shown)
!               {
!                       $title = lang('Answers');
!                       $title_shown = True;
!               }
!               
add_template_row($GLOBALS['phpgw']->template,$title,$GLOBALS['phpgw']->strip_html($GLOBALS['phpgw']->db->f('option_text')));
!               $title = '&nbsp;';
!       }
! 
!       $GLOBALS['phpgw']->template->pparse('out','form');
!       $GLOBALS['phpgw']->common->phpgw_footer();
! ?>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]