Пример #1
0
function showCoachs()
{
    global $xoopsModule, $tpl, $db;
    $result = $db->query("SELECT * FROM " . $db->prefix("coach_coachs") . " ORDER BY name");
    $coachs = array();
    while ($row = $db->fetchArray($result)) {
        $coach = new TCCoach();
        $coach->assignVars($row);
        $coachs[] = array('id' => $coach->id(), 'name' => $coach->name(), 'image' => $coach->image(), 'created' => $coach->created());
    }
    xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> &raquo; " . _AS_TC_COACHSLOC);
    xoops_cp_header();
    include RMTemplate::get()->get_template("admin/coach_coachs.php", 'module', 'team');
    xoops_cp_footer();
}
Пример #2
0
$coach = new TCCoach($id);
if ($coach->isNew()) {
    redirect_header(TC_URL, 1, _MS_TC_ERRNOEXISTIS);
    die;
}
$xoopsOption['template_main'] = "coach_coach.html";
include 'header.php';
$tpl->assign('coach_title', $coach->name());
$tpl->assign('lang_comment', _MS_TC_COMMENT);
$tpl->assign('lang_data', _MS_TC_DATA);
$tpl->assign('lang_name', _MS_TC_NAME);
$tpl->assign('lang_team', _MS_TC_TEAM);
$tpl->assign('lang_date', _MS_TC_DATE);
$tpl->assign('lang_bio', _MS_TC_BIO);
$link = TC_URL . '/' . ($mc['urlmode'] ? 'coach/' . $coach->nameId() . '/' : 'coach.php?id=' . $coach->id());
$tpl->assign('coach', array('id' => $coach->id(), 'name' => $coach->name(), 'image' => $coach->image(), 'date' => formatTimestamp($coach->created(), 'string'), 'bio' => $coach->bio(), 'link' => $link));
$teams = $coach->teams();
$st = '';
foreach ($teams as $team) {
    $tlink = TC_URL . '/' . ($mc['urlmode'] ? 't/' . $team->nameId() . '/' : 'team.php?id=' . $team->id());
    $cat = $team->category(true);
    $st .= $st == '' ? "<a href='{$tlink}'>" . $team->name() . " <em>(" . $cat->name() . ")</em></a>" : ", <a href='{$tlink}'>" . $team->name() . " <em>(" . $cat->name() . ")</em></a>";
}
$tpl->assign('teams', $st);
$tpl->assign('xoops_pagetitle', sprintf(_MS_TC_PTITLE, $coach->name()));
$location = "<a href='" . TC_URL . "'>" . $xoopsModule->name() . "</a> &raquo; " . $coach->name();
$tpl->assign('coach_location', $location);
include 'footer.php';
?>

?>