コード例 #1
0
ファイル: Movies2.php プロジェクト: rsanders16/CinZip
function getNext()
{
    $nextpage = $_GET['page'] + 1;
    $curpage = $_GET['page'];
    if (showNext($curpage)) {
        return "<a href=\"popular.php?page={$nextpage}\">Next</a>";
    }
}
コード例 #2
0
ファイル: learnWord.php プロジェクト: Ericyao7/reciteWord
$template->assign("NEWWORD", "");
$template->assign("DEFINITION", "");
$checkpoint;
if (isset($_POST["classification"])) {
    $userID = $_SESSION['userID'];
    $class = $_POST["classification"];
    $_SESSION['class'] = $_POST["classification"];
    //$class = 2;
    $checkpoint = getLearnCheckPoint($userID, $class);
    showCurrentWord($checkpoint, $class);
}
if (isset($_POST["learnNext"])) {
    $userID = $_SESSION['userID'];
    $class = $_SESSION['class'];
    $checkpoint = getLearnCheckPoint($userID, $class);
    $wordID = showNext($checkpoint, $class);
    if ($wordID == null) {
        $template->assign("NEWWORD", "");
        $template->assign("DEFINITION", "");
        $template->assign("MESSAGE", "Congratulation,you have learn all the words!");
    } else {
        saveLearnWord($userID, $wordID, $class);
        updateCheckPoint($userID, $class, $checkpoint);
    }
}
if (isset($_POST["restart"])) {
    $userID = $_SESSION['userID'];
    $class = $_SESSION['class'];
    restartLearn($userID, $class);
    $checkpoint = getLearnCheckPoint($userID, $class);
    showCurrentWord($checkpoint, $class);