<?php
// +----------------------------------------------------------------------+
// | PHP version 4                                                        |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2005 Snapshot Inc.                                |
// +----------------------------------------------------------------------+
// | License                                                              |
// | GNU General Public License                                           |
// +----------------------------------------------------------------------+
// | Authors: Mai Kawasaki                                                |
// +----------------------------------------------------------------------+
//
// $Id: IndexAction.class.php,v 1.1 2005/06/20 09:31:24 snapshot Exp $
//
// Description:
// 2005/05/18
//

/** 
*	IndexAction.class.php
*	Mai Kawasaki
*	2005/05/18
*/

require_once(OPT_DIR.'u-learning/config.php');
require_once(OPT_DIR.'u-learning/action/SecureStudentAction.class.php');
require_once(OPT_DIR.'u-learning/data/Admin.class.php');
require_once(OPT_DIR.'u-learning/data/Student.class.php');

/** 
*	IndexAction
*/
class IndexAction extends SecureStudentAction {
    function execute (&$controller, &$request, &$user) {

		// ブラウザの判別
		$type = $this->getUserAgentType();
		$request->setAttribute('type', $type);
		
		$DB = $request->getAttribute('DB');
		// 教員情報取得
		$aid = $user->getAttribute('aid');
		$admin = new Admin($aid, $DB);
		// 学生情報、学生科目情報取得
		$uid = $user->getAttribute('uid');
		$student = new Student($aid, $uid, $DB);
    	$subjects_user = $student->getSubjectStudent($DB);
		

		$request->setAttribute('admin', $admin);
		$request->setAttribute('student', $student);
		$request->setAttribute('subjects_user', $subjects_user);
		
		
		return VIEW_SUCCESS;
    }
	

}

?>