<?php
// +----------------------------------------------------------------------+
// | PHP version 4                                                        |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2005 Snapshot Inc.                                |
// +----------------------------------------------------------------------+
// | License                                                              |
// | GNU General Public License                                           |
// +----------------------------------------------------------------------+
// | Authors: Takayuki Tanimoto <takayuki@snapshot.co.jp>                 |
// +----------------------------------------------------------------------+
//
// $Id: List_success.php,v 1.1 2005/06/20 09:31:27 snapshot Exp $
//
// Description:
// 2005/05/18
//
include(BASE_DIR."templates/header.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Uラーニング</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="files/css/main.css" type="text/css" />
<script src="files/js/main.js" type="text/javascript"></script>
<script src="files/js/dom.js" type="text/javascript"></script>
<script type="text/javascript">

var subdb = new Object();
<?php
foreach($template['subjects'] as $subject) {
?>
subdb[<?= $subject->sid ?>] = [
<?php
	for($i = 0; $i < count($subject->users); $i++) {
		if($i > 0) echo ',';
?>
{id:'<?= $subject->users[$i]->uid ?>', year:'<?= $subject->users[$i]->year ?>', name:'<?= $subject->users[$i]->name ?>', del:<?= $subject->users[$i]->del ?>}
<?php
	}
?>
];
<?php
}
?>

var allUsers = [
<?php
for($i = 0; $i < count($template['all_users']); $i++) {
	if($i > 0) echo ',';
?>
{id:'<?= $template['all_users'][$i]->uid ?>', year:'<?= $template['all_users'][$i]->year ?>', name:'<?= $template['all_users'][$i]->name ?>', del:<?= $template['all_users'][$i]->del ?>}
<?php
}
?>
];

var detailURL = '<?= TemplateUtils::createURL('User', 'Detail') ?>';
var deleteURL = '<?= TemplateUtils::createURL('User', 'List') ?>';

</script>
<script src="files/js/user_list.js" type="text/javascript"></script>
</head>
<body>
<div id="container">


<div id="header">
	<div class="menu">
		<div class="menu_right">
			<table>
				<tr>
					<td class="menu_focus"><a href="<?= htmlspecialchars(TemplateUtils::createLink('User','List')) ?>">学生管理</a></td>
					<td><a href="<?= htmlspecialchars(TemplateUtils::createLink('Subject','List')) ?>">科目編集</a></td>
					<td><a href="<?= htmlspecialchars(TemplateUtils::createLink('Config','Input')) ?>">設定</a></td>
					<td><a href="<?= htmlspecialchars(TemplateUtils::createLink('Login','Logout')) ?>">ログアウト</a></td>
				</tr>
			</table>
		</div>
        <div class="menu_login">
            ログイン : <?= htmlspecialchars($template['admin']->aid) ?>
        </div>
		<div class="menu_left">
			<table>
				<tr>
					<td><a href="<?= htmlspecialchars(TemplateUtils::createLink('Exam','List')) ?>">テスト</a></td>
					<td><a href="<?= htmlspecialchars(TemplateUtils::createLink('Results','Search')) ?>">成績</a></td>
				</tr>
			</table>
		</div>
	</div>
	<div class="div_clear"></div>
</div>


<div id="contents">
<?php
if(count($template['all_users'])) {
?>
	<div id="subject">
		<ul>
			<li class="sub_s">
				<a id="sub_0" href="javascript:selectSearchSubject(0);" class="sub_b_all">全て</a>
			</li>
<?php
    foreach ($template['subjects'] as $subject) {
?>
			<li class="sub_s">
				<a id="sub_<?= $subject->sid ?>" href="javascript:selectSearchSubject(<?= $subject->sid ?>);" class="sub_b_<?= TemplateUtils::subType($subject->sid) ?>"><?= htmlspecialchars($subject->name) ?></a>
			</li>
<?php
    }
?>
		</ul>
		<div class="div_clear">&#160;</div>
	</div>
	<div id="main">
		<div id="compose1">
			<div id="navi">
				<h1>学生</h1>
			</div>
			<div id="results" class="results">
			</div>
		</div>
	</div>
<?php
} else {
?>
    <div class="help">
    学生が登録されていません。<br />
    右上のメニューから設定を選択し、<br />
    学生アクセス用URLを確認してください。<br />
    学生はこのURLから登録できます。
    </div>
<?php
}
?>
	<div class="div_clear">&#160;</div>
</div>


<?php
include(BASE_DIR.'templates/admin_footer.php');
?>

<div class="div_clear">&nbsp;</div>


</div>
<?php
if(count($template['all_users'])) {
?>
<script type="text/javascript">
selectSearchSubject(0);
</script>
<?php
}
?>
</body>
</html>