chengkun
2025-05-22 1a8aea45ebb1582c9f65d9e8dcd520002f83ae12
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
 
class show_controller extends company{
    function index_action(){
        $companyM        =    $this->MODEL('company');
        
        $where['uid']    =    $this->uid;
        //分页链接
        $urlarr['page']    =    '{{page}}';
        $urlarr['c']    =    "show";
        $pageurl        =    Url('member',$urlarr);
        
        //提取分页
        $pageM            =    $this  -> MODEL('page');
        $pages            =    $pageM -> pageList('company_show',$where,$pageurl,$_GET['page']);
        
        //分页数大于0的情况下 执行列表查询
        if($pages['total'] > 0){
            
            $where['limit']            =    $pages['limit'];
            $where['orderby']        =    'sort,desc';
            
            $List                    =    $companyM->getCompanyShowList($where,array('field'=>'`title`,`id`,`picurl`'));
            $this->yunset("rows",$List);
        }
        $sessionid    =    session_id();
        $this->yunset("sessionid",$sessionid);
        $this->public_action();
        $this->company_satic();
        $this->com_tpl('show');
    }
    function del_action(){
        $companyM    =    $this->MODEL('company');
        $logM        =    $this->MODEL('log');
        
        if($_GET['id']){
            
            $oid    =    $companyM->delCompanyShow($_GET['id'],array('uid'=>$this->uid));
            
            if($oid){
                
                $logM->member_log("删除企业环境展示",16,3);//会员日志
                
                $this->layer_msg('删除成功!',9,0,"index.php?c=show");
                
            }else{
                
                $this->layer_msg('删除失败!',8,0,"index.php?c=show");
                
            }
        }
    }
    
    function showpic_action(){
        $companyM    =    $this->MODEL('company');
        
        if($_GET['id']){
            
            $this->public_action();
            
            $picurl    =    $companyM->getCompanyShowInfo((int)$_GET['id'],array('uid'=>$this->uid,'field'=>'`picurl`,`title`,`sort`','type'=>'showpic'));
            $this->yunset("picurl",$picurl);
            $this->yunset("uid",$this->uid);
            $this->yunset("id",$_GET['id']);
            $this->com_tpl('editshow');
        }
    }
    
    function addshow_action(){
        $this->public_action();
        $this->yunset("uid",$this->uid);
        $this->com_tpl('addshow');
    }
    
    function upshow_action(){
        
        $companyM            =    $this->MODEL('company');
 
        if($_FILES['uimage']){
            $data['file']        =    $_FILES['uimage'];
        }
        $data['uid']        =    $this->uid;
        $data['title']        =    $_POST['title'];
        $data['id']            =    (int)$_POST['id'];
        $data['sort']        =    $_POST['showsort'];
        $data['r_status']    =    $this -> comInfo['info']['r_status'];
        $return                =    $companyM->setShow($data);
        
        $this->layer_msg($return['msg'],$return['errcode']);
        
    }
    
    function save_action(){
        $companyM             =     $this->MODEL('company');
        
        $data['file']        =    $_FILES['file'];
            
        $data['uid']        =    $this->uid;
        
        $data['r_status']    =    $this -> comInfo['info']['r_status'];
        
        $return                =    $companyM->setShow($data);
        
        $arr                =    array('jsonrpc'=>'2.0', 'id'=>$return['id'] );
        
        echo json_encode($arr);die;
        
    }
}
?>