echo '<form>'; echo '<input type="hidden" name="sesskey" value="' . $USER->sesskey . '" />'; echo '<table>'; $itemnr = 0; foreach ($feedbackitems as $feedbackitem) { //value holen $value = get_record_select('feedback_value', 'completed =' . $feedbackcompleted->id . ' AND item=' . $feedbackitem->id); echo '<tr>'; if ($feedbackitem->hasvalue == 1) { $itemnr++; echo '<td valign="top">' . $itemnr . '.) </td>'; } else { echo '<td> </td>'; } if (isset($value->value)) { print_feedback_item($feedbackitem, $value->value, true); } echo '</tr>'; } echo '<tr><td colspan="2" align="center">'; echo '</td></tr>'; echo '</table>'; echo '</form>'; print_simple_box_end(); } } /// Finish the page /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// print_footer($course);
$countreq = count_records('feedback_item', 'feedback', $feedback->id, 'required', 1); if ($countreq > 0) { echo '<tr><td colspan="3"><font color="red">(*)' . get_string('items_are_required', 'feedback') . '</font></td></tr>'; } foreach ($feedbackitems as $feedbackitem) { //value holen //value aus POST-Daten wiederherstellen $frmvaluename = $feedbackitem->typ . '_' . $feedbackitem->id; $value = isset($formdata->{$frmvaluename}) ? $formdata->{$frmvaluename} : NULL; echo '<tr>'; if ($feedbackitem->hasvalue == 1) { $itemnr++; echo '<td valign="top">' . $itemnr . '.) </td>'; } else { echo '<td> </td>'; } print_feedback_item($feedbackitem, $value); echo '</tr>'; echo '<tr><td> </td></tr>'; } echo '</table>'; echo '<input type="hidden" name="id" value="' . $id . '" />'; echo '<input type="hidden" name="feedbackid" value="' . $feedback->id . '" />'; echo '<input type="hidden" name="completedid" value="' . (isset($feedbackcompleted->id) ? $feedbackcompleted->id : '') . '" />'; echo '<input type="hidden" name="savevalues" value="1" />'; echo '<button type="submit">' . get_string('save_entries', 'feedback') . '</button>'; echo '</form>'; if ($course->id == 1) { echo '<form name="frm" action="' . $CFG->wwwroot . '" method="post" onsubmit=" ">'; } else { echo '<form name="frm" action="' . $CFG->wwwroot . '/course/view.php?id=' . $course->id . '" method="post" onsubmit=" ">'; }
<div style="clear:both"> </div> <?php echo '</div>'; print_simple_box_end(); $templateitems = get_records('feedback_item', 'template', $templateid, 'position'); if (is_array($templateitems)) { $templateitems = array_values($templateitems); } if (is_array($templateitems)) { $itemnr = 0; echo '<p align="center">' . get_string('preview', 'feedback') . '</p>'; print_simple_box_start('center', '75%'); echo '<div align="center"><table>'; foreach ($templateitems as $templateitem) { echo '<tr>'; if ($templateitem->hasvalue == 1) { $itemnr++; echo '<td valign="top">' . $itemnr . '.) </td>'; } else { echo '<td> </td>'; } print_feedback_item($templateitem); echo '</tr>'; echo '<tr><td> </td></tr>'; } echo '</table></div>'; print_simple_box_end(); } else { print_simple_box(get_string('no_items_available_at_this_template', 'feedback'), "center"); } print_footer($course);
$itemnr = 0; $helpbutton = helpbutton('preview', get_string('preview', 'feedback'), 'feedback', true, false, '', true); print_heading($helpbutton . get_string('preview', 'feedback')); print_simple_box_start('center', '80%'); echo '<div align="center"><table>'; //print the inserted items foreach ($feedbackitems as $feedbackitem) { echo '<tr>'; //Items ohne value sind nur zur Beschriftung if ($feedbackitem->hasvalue == 1) { $itemnr++; echo '<td valign="top">' . $itemnr . '.) </td>'; } else { echo '<td> </td>'; } print_feedback_item($feedbackitem); echo '<td>'; if ($feedbackitem->position > 1) { //schalter item hochschieben echo '<form action="' . me() . '" method="post">'; echo '<input type="hidden" name="sesskey" value="' . $USER->sesskey . '" />'; echo '<input title="' . get_string('moveup_item', 'feedback') . '" type="image" src="' . $CFG->pixpath . '/t/up.gif" hspace="1" height=11 width=11 border=0 />'; echo '<input type="hidden" name="moveupitem" value="' . $feedbackitem->id . '" />'; echo '<input type="hidden" name="id" value="' . $id . '" />'; echo '</form>'; } else { echo ' '; } echo '</td>'; echo '<td>'; if ($feedbackitem->position < $lastposition - 1) {