Esempio n. 1
0
     $startitem = $breakresult * $page_number;
     $enditem = $startitem + $breakresult;
 }
 foreach ($values as $key => $value) {
     $item_count++;
     if ($item_count <= $startitem) {
         continue;
     }
     if ($item_count > $enditem) {
         break;
     }
     $tpl->unset_var("RESULT_CELL");
     $tpl->set_var("ANSWER_ID", $value['obj_id']);
     $result = $value["bid:questionary:input"];
     foreach ($header as $id => $header_element) {
         $question = $geo->get_id($id);
         switch ($question["type"]) {
             case QUESTIONARY_INPUT_SELECT:
             case QUESTIONARY_INPUT_RADIO:
                 $text = @$question["options"][$result[$header_element[0]]];
                 break;
             case QUESTIONARY_INPUT_CHECKBOX:
                 $text = "";
                 foreach ($result[$header_element[0]] as $option) {
                     $text .= @$question["options"][$option] . "<br>";
                 }
                 break;
             case QUESTIONARY_INPUT_TENDENCY:
             case QUESTIONARY_INPUT_GRADING:
                 $text = "";
                 foreach ($result[$header_element[0]] as $option) {
Esempio n. 2
0
    $tpl->parse("content", "error_not_allowed");
    out();
}
//parse author and creationtime
if ($resultcreator) {
    $tpl->set_var("CREATOR_NAME", $creator_name);
    $tpl->parse("CREATOR_ROW", "creator_row");
}
if ($resultcreationtime) {
    $tpl->set_var("CREATION_TIME", date("H:i:s - d.m.Y", $attributes[OBJ_CREATION_TIME]));
    $tpl->parse("CREATION_TIME_ROW", "creation_time_row");
}
$question_counter = 1;
foreach ($header_ids as $key => $name) {
    $question_name = "";
    $question = $geo->get_id($key);
    switch ($question["type"]) {
        case QUESTIONARY_INPUT_SELECT:
        case QUESTIONARY_INPUT_RADIO:
            $text = "";
            foreach ($question["options"] as $option_key => $option_name) {
                $text .= $tpl->get_var($option_key == $answer[$name] ? "check_on" : "check_off") . $option_name . "<br>";
            }
            break;
        case QUESTIONARY_INPUT_CHECKBOX:
            $text = "";
            foreach ($question["options"] as $option_key => $option_name) {
                $text .= $tpl->get_var(in_array($option_key, $answer[$name]) ? "check_on" : "check_off") . $option_name . "<br>";
            }
            break;
        case QUESTIONARY_INPUT_GRADING: