3 public $typ =
"checkBoxSingle";
17 $name =
"mit der ID {$this->ID}";
18 if( (isset($this->dispName) ) AND ( $this->dispName !=
"") ){
20 }
else if ( (isset($this->
name) ) AND ( $this->
name !=
"") ){
29 if( $this->
value == $true_val){
32 if( ($this->
get_data(
"count_true") >= $max) ){
33 return "Das Feld <b>$name</b> ist leider nicht mehr verfügbar! Bitte wähle ein Anderes.";
43 if(
$name ==
"count_true" ){
44 if( isset($this->data[
"count_true"]) ){
45 return $this->data[
"count_true"];
49 }
else if(
$name ==
"count_false" ){
50 if( isset($this->data[
"count_false"]) ){
51 return $this->data[
"count_false"];
61 if(
$name ==
"count_true"){
63 $this->data[
"count_true"] = intval(
$value);
65 }
else if(
$name ==
"count_false"){
67 $this->data[
"count_false"] = intval(
$value);
85 if($true_val ==
""){$true_val=
"Ja";}
86 if($false_val ==
""){$false_val=
"Nein";}
89 echo
"<td><label for='checkboxsingle_value_true'>Wert bei angewählter Checkbox</label></td>";
90 echo
"<td><input type='text' name='checkboxsingle_value_true' id='checkboxsingle_value_true' value='$true_val' /></td>";
93 echo
"<td><label for='checkboxsingle_value_false'>Wert bei <b>ab</b>gewählter Checkbox</label></td>";
94 echo
"<td><input type='text' name='checkboxsingle_value_false' id='checkboxsingle_value_false' value='$false_val'/></td>";
101 if( isset($_POST[
"checkboxsingle_value_true"]) ){
102 $err = $this->
set_config(
"true",$_POST[
"checkboxsingle_value_true"]);
110 if( isset($_POST[
"checkboxsingle_value_false"]) ){
111 $err = $this->
set_config(
"false",$_POST[
"checkboxsingle_value_false"]);
129 $allowed = array(
"pieChart",
"barChart",
"doughnutChart");
130 $allowed_names = array(
"Kreisdiagramm",
"Säulendiagramm",
"Ringdiagramm");
135 $allowed = array(
"pieChart",
"barChart",
"doughnutChart");
143 if($cnf ==
true ){ $ckd =
"checked='checked'"; }
144 echo
"<input type='checkbox' name='show_charts' value='true' id='show_charts' $ckd/>
145 <label for='how_charts'>Aswertung der Frage nach dem Ausfüllen der Umfrage anzeigen</label>";
149 if( (isset($_POST[
"show_charts"])) AND ($_POST[
"show_charts"]==
"true") ){
167 echo
"<label for='checkboxsingle_max'>Maximum </label>";
168 echo
"<input type='text' name='checkboxsingle_max' id='checkboxsingle_max' value='$max' />";
173 if( isset($_POST[
"checkboxsingle_max"]) ){
195 if( $font_bold ==
true){ $font_bold =
"font-weight:bold"; }
else{ $font_bold=
""; }
196 if($this->is_required){
197 $req =
"<span class='required_asterisk'>*</span>";
202 echo
"<input type='checkbox' name='{$this->name}' id='{$this->name}' value='true' /> ";
203 echo
"<label for='{$this->name}' style='$font_bold' >$req {$this->dispName}</label><br/>";
204 echo
"</div>".PHP_EOL;
210 $font_family= $this->
get_config(
"font-family");
213 if( $font_family !=
""){ $font_family =
"font-family:".$font_family; }
214 if( $font_size !=
""){ $font_size =
"font-size:".$font_size; }
215 if( $font_bold ==
true){ $font_bold =
"font-weight:bold"; }
else{ $font_bold=
""; }
217 if( $this->
value == $true_val){
218 $checked =
"checked='checked'";
219 }
else{ $checked =
"";}
221 if($this->is_required){
222 $req =
"<span class='required_asterisk'>*</span>";
228 if( ($this->
get_data(
"count_true") >= $max) AND ($max != -1) ){
229 $active_style =
"disabled_widget_text";
231 if( $this->
value !== $true_val ){
232 $active =
"disabled='disabled'";
236 }
else{$active=
"";$active_style=
"";}
238 echo
"<div class='widget_container checkBoxSingle_widget' style='$font_family;$font_size'>";
239 echo
"<input type='checkbox' name='{$this->name}' id='{$this->name}' value='true' {$checked} $active /> ";
240 echo
"<label for='{$this->name}' class='widget_question $active_style' style='$font_bold' > $req {$this->dispName}</label><br/>";
241 echo
"</div>".PHP_EOL;
251 if( (!isset($this->
name)) OR ($this->
name ==
"") ){
255 if( (isset($_POST[ $this->
name ])) AND ($_POST[ $this->name ] ==
"true") ){
260 $this->
value = $true_val;
262 $this->
value = $false_val;
276 `{$this->name}` AS 'values',
277 COUNT(`{$this->name}`) AS count
278 FROM `umfragen`.`{$this->pollID}_results`
280 $res =
$db->get_sql_all_assoc($sql);
283 if( is_array($res) ){
284 foreach( $res as $row ){
287 if( $row[
"values" ] == $val_true){
289 $this->
set_data(
"count_true" , intval($row[
"count"]) );
290 }
else if( $row[
"values" ] == $val_false){
291 $this->
set_data(
"count_false" , intval($row[
"count"]) );
304 $required_classes = array(
"pieChart",
"doughnutChart",
"barChart");
305 foreach($required_classes as
$c ){
306 if( !class_exists($c) ){
307 throw new exception(
"Chart classes not loaded. Please include chart.class.php");
312 if( $type ==
"barChart" ){
315 }
else if( $type ==
"pieChart" ){
318 }
else if( $type ==
"doughnutChart" ){
330 $data = array(
"labels" => array() ,
"datasets" => array( array() ) );
363 if( $type ==
"barChart" ){
365 }
else if( $type ==
"pieChart" ){
367 }
else if( $type ==
"doughnutChart" ){
385 if( isset($this->
chart) ){
392 echo
"<td style='background-color:$color;width:1em;height:1em'> </td>";
394 echo
"<td>{$cnf} <span style='color:#810000'>({$this->get_data("count_true
")})</span></td>";
398 echo
"<td style='background-color:$color;width:1em;height:1em'> </td>";
400 echo
"<td>{$cnf} <span style='color:#810000'>({$this->get_data("count_false
")})</span></td>";
415 if( isset($this->
chart) ){
431 if( !isset($this->
chart) ){
434 if( isset($this->
chart) ){
435 $this->
chart->display();
440 if( !isset($this->
chart) ){
443 if( isset($this->
chart) ){
444 echo
"<h3>{$this->dispName}</h3>";
447 $this->
chart->display();
449 echo
"<td style='padding-left:30px'>";
452 echo
"</tr></table>";