예제 #1
0
function getAllLecturesForVideo($start, $end)
{
    $conn = getConnection();
    $query = "SELECT * FROM lecture WHERE start_datetime >= '" . $start . "' AND start_datetime\t<= '" . $end . "'";
    $result = mysql_query($query);
    $list = array();
    while ($member = mysql_fetch_array($result)) {
        $temp = getLecture($member['ID']);
        array_push($list, $temp);
    }
    if (count($list) != 0) {
        return $list;
    }
    return NULL;
}
예제 #2
0
function updateLecture($chapter, $teacher, $start_datetime, $end_datetime, $userID, $content, $homework, $extra, $id, $status)
{
    $conn = getConnection();
    $Obj = getLecture($id);
    $Obj->setModuleID($chapter);
    $Obj->setContent($content);
    $Obj->setTeacherID($teacher);
    $Obj->setStartDatetime($start_datetime);
    $Obj->setEndDatetime($end_datetime);
    $Obj->setExtra($extra);
    $Obj->setHomework($homework);
    $Obj->setCreatedBy($userID);
    $Obj->setActiveFlag($status);
    $result = $Obj->update();
    if ($result) {
        $message = "Lecture Updated Successfully :";
    } else {
        $message = "Lecture Updation Failed : ";
    }
    return $message;
}