<?php include '../../config.php'; include 'lib.php'; include 'model.php'; $model = new library_Model(); $funcion = $model->get_function(); header("Content-type: text/plain"); header("Content-Disposition: attachment; filename=funcion.txt"); // do your Db stuff here to get the content into $content $saltoLinea = "\r\n"; foreach ($funcion as $k) { print $k->funcion . $saltoLinea; }
$data = new moodle_url('/local/library/descarga.php'); $context = get_context_instance(CONTEXT_SYSTEM); $PAGE->requires->js('/local/library/js/ext/jquery-1.7.2.min.js'); $PAGE->requires->js('/local/library/js/test.js'); $PAGE->requires->js('/local/library/js/jquery-ui-1.10.4.custom.min.js'); $PAGE->requires->js('/local/library/js/library.js'); $PAGE->requires->css('/local/library/css/colorbox.css'); $PAGE->requires->css('/local/library/css/jquery-ui-1.10.4.custom.css'); $admin = has_capability('local/auto:control', $context) || is_siteadmin(); //if(!$admin) redirect(new moodle_url('/')); $name = get_string('createqst', 'local_library'); $PAGE->set_context($context); $PAGE->navbar->add($name); $PAGE->set_title($name); $PAGE->set_heading($name); $model = new library_Model(); $admisselector = new local_library_newcat($url, array('id' => $i)); $potentialadmisselector = new local_library_newqst($url, array('id' => $i)); $lote = new local_library_lote($url, array('id' => $i)); $name_update = new local_library_name($url, array('id' => $i)); if ($data = $potentialadmisselector->get_data()) { $users = $model->get_users($data->funcion); $record = array(); $record['rolid'] = $data->funcion; $record['libraryid'] = $i; $record['userid'] = $USER->id; $record['timecreate'] = time(); $entryid = $DB->insert_record('local_library_rol', $record, true); foreach ($users as $user) { $recor = array(); $recor['userid'] = $user->userid;
error_reporting(-1); $i = required_param('i', PARAM_INT); $PAGE->set_url('/local/library/edit.php'); require_login(); $url = new moodle_url('/local/library/edit.php', array('i' => $i)); $context = context_system::instance(); $admin = is_siteadmin(); if (!$admin) { redirect(new moodle_url('/')); } $name = get_string('createpoll', 'local_library'); $PAGE->set_context($context); $PAGE->navbar->add($name); $PAGE->set_title($name); $PAGE->set_heading($name); $model = new library_Model(); $edata = ''; if (!empty($i)) { $edata = $model->get_librarys($i); } $mform = new local_library_library($url, $edata); if ($data = $mform->get_data()) { $record = array(); $record['name'] = $data->name; $record['fullname'] = 'curso'; $record['userid'] = $USER->id; $record['category'] = $data->category; $record['timecreate'] = time(); $record['timemodified'] = time(); if (empty($i)) { $record['state'] = 0;
<?php include '../../config.php'; include 'model.php'; $url = new moodle_url('/local/library/category.php'); $PAGE->set_url($url); require_login(); $context = context_system::instance(); $admin = is_siteadmin(); $name = get_string('pluginname', 'local_library'); $PAGE->set_context($context); $PAGE->navbar->add($name); $PAGE->set_title($name); $PAGE->set_heading($name); $model = new library_Model(); $categorys = $model->get_all_category(); echo $OUTPUT->header(); $newlink = new moodle_url('/local/library/editcat.php', array('id' => 0)); $newslink = new moodle_url('/local/library/index.php'); echo html_writer::start_tag('div'); echo html_writer::tag('a', 'Agregar Categoria', array('href' => $newlink, 'style' => 'margin-bottom:10px;display:inline-block;', 'class' => 'fb-btn')); echo html_writer::end_tag('div'); echo html_writer::start_tag('div'); echo html_writer::tag('a', 'Biblioteca', array('href' => $newslink, 'style' => 'margin-bottom:10px;display:inline-block;', 'class' => 'fb-btn')); echo html_writer::end_tag('div'); echo html_writer::start_tag('table', array('class' => 'table table-striped"', 'align' => 'center')); echo html_writer::start_tag('thead'); echo html_writer::start_tag('tr'); echo html_writer::tag('td', 'Nombre'); echo html_writer::tag('td', 'Opciones'); echo html_writer::end_tag('tr');
<?php include '../../config.php'; include 'model.php'; $PAGE->set_url('/local/library/index.php'); require_login(); $context = context_system::instance(); $admin = is_siteadmin(); $name = get_string('pluginname', 'local_library'); $PAGE->set_context($context); $PAGE->navbar->add($name); $PAGE->set_title($name); $PAGE->set_heading($name); $model = new library_Model(); $category = $model->get_category(); //$roles = $model->get_roles($USER->id); /*$PAGE->requires->css('/local/library/css/ventanas-modales.css'); $PAGE->requires->css('/local/library/css/library-styles.css'); $PAGE->requires->js('/local/library/js/ext/jquery-1.7.2.min.js'); $PAGE->requires->js('/local/library/js/test.js'); $PAGE->requires->js('/local/library/js/ventanas-modales.js');*/ $PAGE->requires->css('/local/library/css/colorbox.css'); $PAGE->requires->css('/local/library/css/library-styles.css'); $PAGE->requires->css('/local/library/source/jquery.fancybox.css?v=2.1.5'); $PAGE->requires->js('/local/library/lib/jquery-1.10.1.min.js'); $PAGE->requires->js('/local/library/lib/jquery.mousewheel-3.0.6.pack.js'); $PAGE->requires->js('/local/library/source/jquery.fancybox.js?v=2.1.5'); $PAGE->requires->js('/local/library/js/test.js'); echo $OUTPUT->header(); $html = '';
<?php include '../../config.php'; include 'form.php'; include 'lib.php'; include 'model.php'; $i = required_param('i', PARAM_INT); $s = required_param('s', PARAM_INT); $context = get_context_instance(CONTEXT_SYSTEM); $admin = has_capability('local/auto:control', $context) || is_siteadmin(); if (!$admin) { redirect(new moodle_url('/')); } $model = new library_Model(); $model->edit_poll($i, array('state' => $s)); redirect(new moodle_url('/local/library/index.php'));
<?php include '../../config.php'; include 'model.php'; $idCurso = $_POST['idCurso']; $model = new library_Model(); $ruta = '/var/www/html/bcp/local/library'; $model->del_poll($idCurso); unlink($ruta . '/files/' . $idCurso); echo new moodle_url('/local/library/index.php');