chengkun
2025-05-23 a6f7b382623096b6a00924f418447cf5204e825e
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?php
 
class show_controller extends user{
    //上传个人作品
    function index_action(){
        $resumeM            =    $this->MODEL('resume');
        if($_GET['eid']){
            
        
            $where['uid']    =    $this->uid;
            $where['eid']    =    $_GET['eid'];
            
            //分页链接
            $urlarr['c']    =    $_GET['c'];
            $urlarr['eid']    =    $_GET['eid'];
            $urlarr['page']    =    '{{page}}';
            $pageurl        =    Url('member',$urlarr);
            
            //提取分页
            $pageM            =    $this  -> MODEL('page');
            $pages            =    $pageM -> pageList('resume_show',$where,$pageurl,$_GET['page'],'8');
            
            //分页数大于0的情况下 执行列表查询
            if($pages['total'] > 0){
                
                $where['orderby']    =    'sort,desc';
                
                $where['limit']        =    $pages['limit'];
                
                $List                =    $resumeM->getResumeShowList($where,array('field'=>'`title`,`id`,`picurl`'));
                
                $this->yunset("rows",$List);
            }
            
            $this->public_action();
            $this->user_tpl('show');
        }else{
            header("location:"."index.php?c=resume");
        }
    }
    function del_action(){
        $resumeM    =    $this->MODEL('resume');
        if($_GET['id']){
            $return    =    $resumeM->delShow(intval($_GET['id']),array('uid'=>$this->uid,'usertype'=>$this->usertype));
            
            $this->layer_msg($return['msg'],$return['errcode'],0,$_SERVER['HTTP_REFERER']);
        }
    }
    //修改个人作品
    function showpic_action(){
        $resumeM    =    $this->MODEL('resume');
        if($_GET['id']){
            
            
            $picurl    =    $resumeM->getResumeShowInfo(array('id'=>intval($_GET['id']),'uid'=>$this->uid),array('field'=>'`eid`,`picurl`,`title`,`sort`'));
            
            $this->yunset("picurl",$picurl);
            
            $this->yunset("uid",$this->uid);
            $this->yunset("id",$_GET['id']);
            $this->yunset("id",$_GET['id']);
            
            $this->public_action();
            $this->yunset("js_def",2);
            $this->user_tpl('editshow');
        }
    }
    //添加个人作品
    function addshow_action(){
        $this->public_action();
        $this->user_tpl('addshow');
    }
    //保存修改个人作品
    function upshow_action()
    {
        $resumeM    =    $this->MODEL('resume');
        $rinfo        =    $resumeM->getResumeInfo(array('uid'=>$this->uid),array('field'=>'r_status'));
        $post        =    array(
            'title'        =>    $_POST['title'],
            'sort'        =>    $_POST['showsort'],
            'status'    =>  $rinfo['r_status']==0?1:$this->config['rshow_photo_status'],
        );
        $data    =    array(
            'post'        =>    $post,
            'uid'        =>    $this->uid,
            'usertype'    =>    $this->usertype,
            'id'        =>    intval($_POST['id']),
            'file'        =>    $_FILES['file'],
            'utype'        =>  'user'
        );
        $return        =    $resumeM->addResumeShow($data);
        
        $this->ACT_layer_msg($return['msg'],$return['errcode'],"index.php?c=show&eid=".$_POST['eid']);
    }
    //保存添加个人作品
    function save_action(){
        
        if (!empty($_FILES)){
            $resumeM    =    $this->MODEL('resume');
            $rinfo        =    $resumeM->getResumeInfo(array('uid'=>$this->uid),array('field'=>'r_status'));
            $post        =    array(
                'title'      =>  $this->stringfilter($_FILES['file']['name']),
                'status'  =>  $rinfo['r_status']==0?1:$this->config['rshow_photo_status'],
                'eid'      =>  intval($_POST['usershowid']),
            );
            
            $data    =    array(
                'post'        =>    $post,
                'uid'        =>    $this->uid,
                'usertype'    =>    $this->usertype,
                'file'        =>    $_FILES['file'],
                'utype'        =>  'user'
            );
            
            $id       =  $resumeM->addResumeShow($data);
            
            $arr      =     array(
                'jsonrpc'=>'2.0',
                'id'=>$id
            );
            echo json_encode($arr);die;
        }
    }
}
?>