예제 #1
0
    exit;
}
$time = 0;
if (!empty($_POST)) {
    $time = intval($_POST['hh']) * 60 + intval($_POST['mm']);
}
if (@$_POST['add']) {
    Admin::checkAccess(AdminAccess::ACCESS_CREATE);
    $playlist->addRecord(array('time' => $time, 'video_id' => $_POST['video_id'], 'playlist_id' => $_GET['playlist_id']));
    header("Location: playlist.php?playlist_id=" . @$_GET['playlist_id']);
    exit;
}
if (!empty($id)) {
    if (@$_POST['edit']) {
        Admin::checkAccess(AdminAccess::ACCESS_EDIT);
        $playlist->updateRecord(array('time' => $time, 'video_id' => $_POST['video_id']), $id);
        header("Location: playlist.php?playlist_id=" . @$_GET['playlist_id']);
    } elseif (@$_GET['del']) {
        Admin::checkAccess(AdminAccess::ACCESS_DELETE);
        $playlist->delRecord($id);
        header("Location: playlist.php?playlist_id=" . @$_GET['playlist_id']);
    }
    exit;
}
if (@$_GET['edit'] && !empty($id)) {
    $action_name = 'edit';
    $action_value = _('Save');
    $edit_record = $playlist->getRecord($id);
}
$records = $playlist->getAllRecordsByPlaylistId($_GET['playlist_id']);
function time_to_hhmm($time)