chengkun
2025-05-26 4462855c0033970c39ac8d0da704b7dc41eabbfe
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php
 
class subject_controller extends train{
    function index_action(){
            
        $TrainM    =    $this->MODEL('train');
        $LogM    =    $this->MODEL('log');
        
        if((int)$_GET['pause_status']){//设置显示状态
        
            $nid    =    $TrainM->upSubInfo(array('id'=>(int)$_GET['id'],'uid'=>$this->uid),array('pause_status'=>(int)$_GET['pause_status']));
            
            if($nid){
 
                $LogM->addMemberLog($this->uid,$this->usertype,"设置培训课程显示状态",21,3);
 
                $this->layer_msg('显示状态设置成功!',9,0,$_SERVER['HTTP_REFERER']);
 
            }else{
                $this->layer_msg('显示状态设置失败!',8,0,$_SERVER['HTTP_REFERER']);
            }
        }
        if($_GET['del']){
            $id        =    (int)$_GET['del'];
            $return    =    $TrainM->delsubInfo($id,array('uid'=>$this->uid,'usertype'=>$this->usertype));
            $this->layer_msg($return['msg'],$return['errcode'],0,$_SERVER['HTTP_REFERER']);
        }
        $status    =    intval($_GET['status']);
        if($status=="1"){
 
            $where['status']        =    0;
            $where['pause_status']    =    1;
            $urlarr['status']        =    $status;
        }elseif($status=="2"){
            
            $where['status']        =    2;
            $where['pause_status']    =    1;
            $urlarr['status']        =    $status;
        }else{
            $where['status']        =    1;
            $where['pause_status']    =    1;
        }
        $pstatus    =    $_GET['pstatus'];
 
        if($pstatus=="2"){
 
            $where['pause_status']    =    2;
            $urlarr['pstatus']        =    $pstatus;
        }    
        $where['uid']    =    $this->uid;
        $urlarr['c']    =    "subject";
        $urlarr['page']    =    "{{page}}";
        $pageurl        =    Url('member',$urlarr);
        $pageM            =    $this  -> MODEL('page');
        $pages            =    $pageM -> pageList('px_subject',$where,$pageurl,$_GET['page']);
    
        $where['limit']        =    $pages['limit'];
        $where['orderby']    =    array('id,desc');
 
        $rows    =    $TrainM->getSubList($where);
        
        if(is_array($rows)){
 
            foreach ($rows as $key=>$val){
                if($val['pic']){
                    $rows[$key]['pic']    =    $val['pic'];
                }else{
                    $rows[$key]['pic']    =    $this->config['sy_pxsubject_icon'];
                }
            }
        }
        $this->yunset("rows",$rows);
        $this->yunset("def","1");
 
        $this->train_satic();
 
        $this->train_tpl('subject');
    }
    function statusbody_action(){
        $TrainM    =    $this->MODEL('train');
        $id        =    intval($_POST['id']);
 
        if($id){
            $msg    =    $TrainM->getSubInfo(array('id'=>$id),array('field'=>'statusbody'));
            echo $msg['statusbody'];die;
        }
    }
}
?>