Beispiel #1
0
 *
 * This software is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 * 
 * @package ezcast.ezadmin.test
 */
require_once '../commons/lib_database.php';
$course_name = "COURSE_MNEMO";
$user_name = "netid";
echo 'Preparing DB ...';
var_dump(db_prepare());
echo 'Testing courses_search ...' . PHP_EOL;
db_courses_search_compact('%', '%', true, true, true, true);
echo "All users of {$course_name} ..." . PHP_EOL;
var_dump(db_courses_search_compact($course_name, '%', true, true, false, true));
echo "All courses by {$user_name} ..." . PHP_EOL;
var_dump(db_courses_search_compact('%', $user_name, true, true, false, true));
echo "All users of {$course_name}, step 2 ..." . PHP_EOL;
var_dump(db_course_get_users($course_name));
Beispiel #2
0
function view_course_details()
{
    global $input;
    if (empty($input['course_code'])) {
        die;
    }
    if (isset($input['post'])) {
        $course_code = $input['course_code'];
        $course_name = $input['course_name'];
        $shortname = $input['shortname'];
        $in_recorders = $input['in_recorders'] ? 1 : 0;
        if (empty($course_name)) {
            $error = template_get_message('missing_course_name', get_lang());
        } else {
            db_course_update($course_code, $course_name, $shortname, $in_recorders);
            db_log(db_gettable('course'), 'Edited course ' . $input['course_ID'], $_SESSION['user_login']);
        }
    }
    $courseinfo = db_course_read($input['course_code']);
    $users = db_course_get_users($input['course_code']);
    // Manipulate info
    $course_code = $courseinfo['course_code'];
    $course_name = $courseinfo['course_name'];
    $shortname = $courseinfo['shortname'];
    $origin = $courseinfo['origin'];
    $has_albums = $courseinfo['has_albums'] != '0';
    $in_classroom = $courseinfo['in_recorders'] == '1';
    //$users = array();
    // Display page
    include template_getpath('div_main_header.php');
    include template_getpath('div_course_details.php');
    include template_getpath('div_main_footer.php');
}