當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TemplatePower::showUnAssigned方法代碼示例

本文整理匯總了PHP中TemplatePower::showUnAssigned方法的典型用法代碼示例。如果您正苦於以下問題:PHP TemplatePower::showUnAssigned方法的具體用法?PHP TemplatePower::showUnAssigned怎麽用?PHP TemplatePower::showUnAssigned使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TemplatePower的用法示例。


在下文中一共展示了TemplatePower::showUnAssigned方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: TemplatePower

<?php

require_once 'config.inc.php';
$tpl_main = new TemplatePower('template/master.html');
$tpl_main->prepare();
// see if the login form was submitted
if (isset($_POST['login'])) {
    $user = stripslashes($_POST['username']);
    $pass = stripslashes($_POST['password']);
    $goto = $_POST['redirect'];
    if ($_AUTH->login($user, $pass)) {
        include_once $goto;
        die;
    } else {
        $tpl = new TemplatePower('template/error.html');
        $tpl->assignGlobal('error_message', 'Invalid username / password.' . $user);
    }
    // display the default login form
} else {
    $tpl = new TemplatePower('template/login.html');
    $tpl->assignGlobal('redirect', $_GET['redirect']);
}
$tpl->prepare();
$tpl->showUnAssigned(false);
$tpl_main->assign('content', $tpl->getOutputContent());
$tpl_main->showUnAssigned(false);
$tpl_main->printToScreen();
開發者ID:alecbenson,項目名稱:TurnoutWeb-Patches,代碼行數:27,代碼來源:login.php

示例2: get_user_courses

    // pull the template together
    $tpl->prepare();
    // display the selected course
    if (isset($course)) {
        $c = get_user_courses($_DB);
        $course = $c[0]['courseID'];
        set_course_template($_DB, $tpl, $course);
    }
    // add the remaining components to the template
    $tpl->assignGlobal('course_select_box', gen_course_select_box($_DB));
    $tpl->assignGlobal('username', $_SESSION['userName']);
}
// for all of the pages, put the content into the main template
$tpl->showUnAssigned(false);
$tpl_main->assignGlobal("content", $tpl->getOutputContent());
$tpl_main->showUnAssigned(false);
$tpl_main->printToScreen();
/**
 * Return a list of courses that the user is enrolled in
 *
 * @db the MySQL database connection
 *
 **/
function get_user_courses($db)
{
    $user = $_SESSION['userID'];
    $db->sql_query("SELECT * FROM courses WHERE courseID = ( SELECT course FROM studentstocourses WHERE student =  '{$user}' ) ");
    return $db->sql_fetchrowset();
}
/**
 * Return a HTML combo box populated with the courses that the user is in
開發者ID:alecbenson,項目名稱:TurnoutWeb-Patches,代碼行數:31,代碼來源:students.php


注:本文中的TemplatePower::showUnAssigned方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。