class.php
1: <?php
2: /****************************************************************************
3: * DRBPoll
4: * http://www.dbscripts.net/poll/
5: *
6: * Copyright � 2007-2009 Don B
7: ****************************************************************************/
8:
9: // Valid control types
10: $CONTROL_COMBOBOX = 1;
11: $CONTROL_RADIOBUTTONS = 2;
12:
13: // This class is used to define the polls and their possible values
14: // See config.php for usage.
15: class Poll {
16:
17: // Values in poll
18: var $values = array();
19: var $urls = array();
20:
21: // Poll question
22: var $question;
23:
24: // Return to page
25: var $returnToURL = "..";
26:
27: // Legend
28: var $legend = "";
29:
30: // Control type ($CONTROL_COMBOBOX or $CONTROL_RADIOBUTTONS)
31: var $control_type;
32:
33: // Contructor
34: function Poll() {
35: global $CONTROL_RADIOBUTTONS;
36: $this->control_type = $CONTROL_RADIOBUTTONS;
37: }
38:
39: function add_value($id, $description, $url = NULL) {
40: $this->values[$id] = $description;
41: $this->urls[$id] = $url;
42: }
43:
44: }
45:
46: ?>