-
Notifications
You must be signed in to change notification settings - Fork 0
/
teach.php
59 lines (52 loc) · 1.83 KB
/
teach.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
class app
{
public $G;
//初始化信息
public function __construct(&$G)
{
$this->G = $G;
$this->ev = $this->G->make('ev');
$this->session = $this->G->make('session');
$this->files = $this->G->make('files');
$this->user = $this->G->make('user','user');
$_user = $this->session->getSessionUser();
$this->_user = $this->user->getUserById($_user['sessionuserid']);
$this->_user['teacher_subjects'] = unserialize($this->_user['teacher_subjects']);
$group = $this->user->getGroupById($_user['sessiongroupid']);
if(!$this->_user['teacher_subjects'])
{
if($this->ev->get('userhash'))
exit(json_encode(array(
'statusCode' => 300,
"message" => "您不具备管理权限",
"callbackType" => 'forward',
"forwardUrl" => "index.php?exam-app"
)));
else
{
header("location:index.php?exam-app");
exit;
}
}
//生产一个对象
$this->teachsubjects = implode(',',$this->_user['teacher_subjects']);
$this->tpl = $this->G->make('tpl');
$this->db = $this->G->make('pepdo');
$this->pg = $this->G->make('pg');
$this->html = $this->G->make('html');
$this->apps = $this->G->make('apps','core');
$this->basic = $this->G->make('basic','exam');
$this->area = $this->G->make('area','exam');
$this->section = $this->G->make('section','exam');
$this->favor = $this->G->make('favor','exam');
$this->exam = $this->G->make('exam','exam');
$this->tpl->assign('ols',array(1=>'一','二','三','四','五','六','七','八','九','十','十一','十二','十三','十四','十五','十六','十七','十八','十九','二十'));
$this->tpl->assign('action',$this->ev->url(2)?$this->ev->url(2):'exams');
$this->tpl->assign('_user',$this->_user);
$this->tpl->assign('userhash',$this->ev->get('userhash'));
$apps = $this->apps->getAppList();
$this->tpl->assign('apps',$apps);
}
}
?>