$filestable = 'files'; $DB->delete_records($filestable, array('contenthash' => $hash)); } } if (!$DB->update_record('block_nsreas', $fromform)) { print_error('updateerror', 'block_nsreas'); } else { } // if (!$DB->update_record('block_nsreas', $fromform)) { // print_error('updateerror', 'block_nsreas'); // } } else { $fromform->click_count = 0; if (!$DB->insert_record('block_nsreas', $fromform)) { print_error('inserterror', 'block_nsreas'); } } redirect($url); } else { $site = get_site(); echo $OUTPUT->header(); if ($id) { $simplehtmlpage = $DB->get_record('block_nsreas', array('id' => $id)); $simplehtml->set_data($simplehtmlpage); $simplehtml->display(); } else { $simplehtml->display(); } } } echo $OUTPUT->footer();
<?php require_once '../../config.php'; require_once 'nsreas_form.php'; $PAGE->set_context(context_system::instance()); $PAGE->set_url('/blocks/nsreas/index.php'); $PAGE->requires->jquery(); $PAGE->requires->jquery_plugin('ui'); $PAGE->requires->jquery_plugin('ui-css'); global $CFG; global $DB; print_object($DB); $accountform = new nsreas_form(); echo $OUTPUT->header(); ?> <h3>InformaciĆ³n adicional del curso</h3> <?php $accountform->display(); echo $OUTPUT->footer();