chengkun
2025-05-26 8f3df543230cd4403368b39b9bbe5726d11a0284
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
<?php
 
class admin_resume_controller extends adminCommon{
    function index_action(){  
        $resumeM    =   $this -> MODEL('resume');
        if(trim($_GET['keyword'])){
            $where['name']        =    array('like',trim($_GET['keyword']));
            $urlarr['keyword']    =    $_GET['keyword'];
        }
        if($_GET['status']){
            $status                =    intval($_GET['status']);
            if($status==2){
                $where['r_status']    =    2;
            }else{
                $where['state']    =    $status == 4 ? 0 : $status;
            }
            $urlarr['status']    =    $status;
        }
        $urlarr['c']    =    $_GET['c'];
        $urlarr['page']    =    "{{page}}";
        $pageurl        =    Url($_GET['m'],$urlarr,'admin');
        $pageM    =    $this  -> MODEL('page');
        $pages    =    $pageM -> pageList('resume_expect',$where,$pageurl,$_GET['page']);
        if($pages['total'] > 0){
            $where['orderby']    =    'lastupdate';
            $where['limit']        =    $pages['limit'];
            $rows                =    $resumeM -> getList($where);
        }
        $CacheM=$this->MODEL('cache');
        $CacheList=$CacheM->GetCache(array('city','job','user'));
        $this->yunset($CacheList);
        extract($CacheList);
        if(is_array($rows)){
            foreach($rows['list'] as $k=>$v){               
                $city_classid=@explode(",",$v['city_classid']);
                $city_class_name=array();
                if(is_array($city_classid)){
                    $i=0;
                    foreach($city_classid as $key=>$val){
                        if($city_name[$val]){
                            $cityname[$key]=$val;
                            if($val!=""){
                                $i=$i+1;
                            }
                            $city_class_name[]=$city_name[$val];
                        }
                    }
                    $rows['list'][$k]['citynum']=$i;
                    $rows['list'][$k]['cityid_n']=$city_name[$cityname[0]];
                }
 
                $job_classid=@explode(",",$v['job_classid']);
                $job_class_name=array();
                if(is_array($job_classid)){
                    $i=0;
                    foreach($job_classid as $key=>$val){
                        $jobname[$key]=$val;
                        if($val!=""){
                            $i=$i+1;
                        }
                        $job_class_name[]=$job_name[$val];
                    }
                    $rows['list'][$k]['jobnum']=$i;
                    $rows['list'][$k]['job_post_n']=$job_name[$jobname[0]];
                }                
                $rows['list'][$k]['job_class_name']=@implode('、',$job_class_name);
            }
        }
        $this -> yunset('rows',$rows['list']);
        $this->yunset("headertitle","简历管理");
        $this->yunset('backurl','index.php?c=user');
        $this->yuntpl(array('wapadmin/admin_resume'));
    }
    function saveresume_action(){
        $ResumeM    =    $this->MODEL('resume');
        if($_GET['e']){
            $eid    =    (int)$_GET['e'];
            $return    =    $ResumeM->getInfo(array('eid'=>$eid,'uid'=>$_GET['uid'],'tb'=>'all','needCache'=>1));
            $setarr =    array(
            'row'             =>   $return['expect'],
            'edu'             =>   $return['edu'],
            'other'           =>   $return['other'],
            'project'         =>   $return['project'],
            'skill'           =>   $return['skill'],
            'training'        =>   $return['training'],
            'work'            =>   $return['work'],
            'resume'          =>   $return['resume'],
            'industry_index'  =>   $return['cache']['industry_index'],
            'industry_name'   =>   $return['cache']['industry_name'],
            'userdata'        =>   $return['cache']['userdata'],
            'userclass_name'  =>   $return['cache']['userclass_name'],
            );
            $this->yunset($setarr);
        }
        $this->yunset($this->MODEL('cache')->GetCache(array('job','city','user')));
        $this->yunset("uid",$_GET['uid']);
        $this->yunset("eid",$_GET['e']);
        if($_GET['return_url']){
            $this->yunset("return_url",'myresume');
        }else{
            $this->yunset("return_url",'resume');
        }                
        $this->yunset("headertitle","简历管理");
        $this->yunset('backurl','index.php?c=admin_resume');
        $this->yuntpl(array('wapadmin/admin_saveresume'));
    }
    function saveinfo_action(){
        $resumeM    =    $this->MODEL('resume');
        $uid           =  intval($_POST['uid']);
        $rData      =  array(
            'name'         =>      $_POST['name'],
            'sex'          =>      $_POST['sex'],
            'edu'          =>      $_POST['edu'],
            'living'       =>      $_POST['living'],
            'exp'          =>      $_POST['exp'],
            'birthday'     =>      $_POST['birthday'],
            'telphone'     =>      $_POST['telphone'],
            'telhome'     =>      $_POST['telhome'],
            'email'        =>      $_POST['email'],
        );    
        $return   =  $resumeM -> upResumeInfo(array('uid'=>$uid),array('rData'=>$rData));
        if($return['errcode']==9){
            $arr    =    $resumeM -> getResumeInfo(array('uid'=>$uid));
             echo json_encode($arr);die;
        }else{
            echo 0;die;
        }    
    }
    function saveexpect_action(){
        $resumeM    =    $this->MODEL('resume');
        if($_POST['submit']){
            $eid    =    intval($_POST['eid']);
            $uid    =    intval($_POST['uid']);
            if($eid){
                $expectDate    =    array(
                    'name'            =>    $_POST['name'],
                    "hy"            =>    $_POST['hy'],
                    "job_classid"    =>    $_POST['job_classid'],
                    "minsalary"        =>    $_POST['minsalary'],
                    "maxsalary"        =>    $_POST['maxsalary'],
                    "city_classid"    =>    $_POST['city_classid'],
                    "report"        =>    $_POST['report'],
                    "type"            =>    $_POST['type'],
                    "jobstatus"        =>    $_POST['jobstatus'],
                    "lastupdate"    =>    time(),
                );
            }
            $return   =  $resumeM -> upInfo(array('id'=>$eid), array('eData'=>$expectDate,'utype'=>'admin'));
            if($return['id']){
                $arr  =  $resumeM -> getExpect(array('id'=>$eid),array('needCache'=>1));    
                echo json_encode($arr);die;
            }else{
                echo 0;die;
            }
        }
    }
    function skill_action(){
        $resumeM    =   $this -> MODEL('resume');
        if($_POST['submit']){
            $id            =   intval($_POST['id']);
            if($_FILES['pic']['tmp_name']){
                $upArr    =  array(
                    'file'      =>  $_FILES['pic'],
                    'dir'       =>  'user',    
                );
                $uploadM    =  $this -> MODEL('upload');
                $pic        =  $uploadM -> newUpload($upArr);
                if (!empty($pic['msg'])){
                    $this->ACT_layer_msg($pic['msg'],8);
                }elseif (!empty($pic['picurl'])){
                    $pictures    =    $pic['picurl'];
                }
            }
            if(isset($pictures)){
                $_POST['pic']    =    $pictures;
            }
            $postData    =    array(
                'uid'        =>    intval($_POST['uid']),
                'eid'        =>    intval($_POST['eid']),
                'name'        =>    $_POST['name'],
                'longtime'    =>    $_POST['longtime'],
                'ing'        =>    $_POST['user_ing_name'],
                'pic'        =>    $_POST['pic'],
            );
            if(intval($_POST['id'])){
                $row    =    $resumeM -> getResumeSkill(array(id=>$_POST['id']));
                if($row['pic'] && $_POST['pic']==''){
                    $postData['pic']    =    $row['pic'];
                }
                $return     =    $resumeM -> addResumeSkill($postData,array('where'=>array('id'=>intval($_POST['id'])),'utype'=>'admin'));
            }else{
                $return  =  $resumeM -> addResumeSkill($postData,array('utype'=>'admin'));
                $id      =  $return['id'];
            }
            $skill    =    $resumeM -> getResumeSkill(array('id'=>$id));
            $data['msg']=$return['msg'];
            $data['url']='index.php?c=admin_resume&a=saveresume&uid='.$_POST['uid'].'&e='.$_POST['eid'].'';
            $this->yunset("layer",$data);
        }
        $this->yuntpl(array('wapadmin/admin_saveresume'));
    }
    function work_action(){
        $resumeM    =   $this -> MODEL('resume');
        $id            =   intval($_POST['id']);
        $postData    =    array(
            'uid'        =>    intval($_POST['uid']),
            'eid'        =>    intval($_POST['eid']),
            'name'        =>  $_POST['name'],
            'sdate'        =>    strtotime($_POST['sdate']),
            'edate'        =>  strtotime($_POST['edate']),
            'title'        =>  $_POST['title'],
            'content'    =>    trim($_POST['content'])
        );
        if(intval($_POST['id'])){
            $return     =    $resumeM -> addResumeWork($postData,array('where'=>array('id'=>intval($_POST['id'])),'utype'=>'admin'));
        }else{
            $return  =  $resumeM -> addResumeWork($postData,array('utype'=>'admin'));
            $id      =  $return['id'];
        }
        $work    =    $resumeM -> getResumeWork(array('id'=>$id));
        echo json_encode($work);die;
    }
    function project_action(){
        $resumeM    =   $this -> MODEL('resume');
        $id            =   intval($_POST['id']);
        $postData    =    array(
            'uid'        =>    intval($_POST['uid']),
            'eid'        =>    intval($_POST['eid']),
            'name'        =>  $_POST['name'],
            'sdate'        =>    strtotime($_POST['sdate']),
            'edate'        =>  strtotime($_POST['edate']),
            'title'        =>  $_POST['title'],
            'content'    =>    trim($_POST['content'])
        );
        if(intval($_POST['id'])){
            $return     =    $resumeM -> addResumeProject($postData,array('where'=>array('id'=>intval($_POST['id'])),'utype'=>'admin'));
        }else{
            $return  =  $resumeM -> addResumeProject($postData,array('utype'=>'admin'));
            $id      =  $return['id'];
        }
        $project     =    $resumeM -> getResumeProject(array('id'=>$id));
        echo json_encode($project);die;
    }
    function edu_action(){
        $resumeM    =   $this -> MODEL('resume');
        $id            =   intval($_POST['id']);
        $postData    =    array(
            'uid'        =>    intval($_POST['uid']),
            'eid'        =>    intval($_POST['eid']),
            'name'        =>  $_POST['name'],
            'sdate'        =>    strtotime($_POST['sdate']),
            'edate'        =>  strtotime($_POST['edate']),
            'title'        =>  $_POST['title'],
            'education'    =>    $_POST['education'],
            'specialty' =>  $_POST['specialty'],
        );
        if(intval($_POST['id'])){
            $return     =    $resumeM -> addResumeEdu($postData,array('where'=>array('id'=>intval($_POST['id'])),'utype'=>'admin'));
        }else{
            $return  =  $resumeM -> addResumeEdu($postData,array('utype'=>'admin'));
            $id      =  $return['id'];
        }
        $edu    =    $resumeM -> getResumeEdu(array('id'=>$id));
        echo json_encode($edu);die;
    }
    function training_action(){
        $resumeM    =   $this -> MODEL('resume');
        $id            =   intval($_POST['id']);
        $postData    =    array(
            'uid'        =>    intval($_POST['uid']),
            'eid'        =>    intval($_POST['eid']),
            'name'        =>  $_POST['name'],
            'sdate'        =>    strtotime($_POST['sdate']),
            'edate'        =>  strtotime($_POST['edate']),
            'title'        =>  $_POST['title'],
            'content'    =>    trim($_POST['content'])
        );
        if(intval($_POST['id'])){
            $return     =    $resumeM -> addResumeTrain($postData,array('where'=>array('id'=>intval($_POST['id'])),'utype'=>'admin'));
        }else{
            $return  =  $resumeM -> addResumeTrain($postData,array('utype'=>'admin'));
            $id      =  $return['id'];
        }
        $train    =    $resumeM -> getResumeTrain(array('id'=>$id));
        echo json_encode($train);die;
    }
    function other_action()
    {
        $resumeM    =   $this -> MODEL('resume');
        $id            =   intval($_POST['id']);
        $postData    =    array(
            'uid'        =>    intval($_POST['uid']),
            'eid'        =>    intval($_POST['eid']),
            'name'        =>  $_POST['name'],
            'content'    =>    trim($_POST['content'])
        );
        if(intval($_POST['id'])){
            $return     =    $resumeM -> addResumeOther($postData,array('where'=>array('id'=>intval($_POST['id'])),'utype'=>'admin'));
        }else{
            $return  =  $resumeM -> addResumeOther($postData,array('utype'=>'admin'));
            $id      =  $return['id'];
        }
        $other    =    $resumeM -> getResumeOther(array('id'=>$id));
        echo json_encode($other);die;
    }
    
    function evalute_action(){
        $resumeM   =   $this -> MODEL('resume');
        if($_POST["submit"]){    
            $eid    =    (int)$_POST['eid'];
            $id        =    (int)$_POST['id'];
            $uid    =    $_POST['uid'];                    
            if(!$id){                               
                $nid    =    $resumeM -> upResumeInfo(array('uid'=>$uid),array('rData'=>array('description'=>$_POST['evalute_content'])));
                if($nid){                              
                    $data['msg']="自我评价添加成功!";
                    $data['url']='index.php?c=admin_resume&a=saveresume&uid='.$uid.'&e='.$eid.'';
                    $this->yunset("layer",$data);
                }else{
                    $data['msg']="自我评价添加失败!";
                    $data['url']='index.php?c=admin_resume&a=saveresume&uid='.$uid.'&e='.$eid.'';
                    $this->yunset("layer",$data);                       
                }        
            }                                   
        }
        $this->yuntpl(array('wapadmin/admin_saveresume'));
    }
    function resume_ajax_action(){
        $resumeM   =   $this -> MODEL('resume');
        $id           =   intval($_POST['id']);
        $table        =   'resume_'.$_POST['type'];
        $info      =   $resumeM -> getFb($table,$id);
        echo json_encode($info);die;
    }
    function resume_del_action(){
        $resumeM  =  $this -> MODEL('resume');
        $table    =  trim($_GET['type']);
        $tables   =  array('skill','work','project','edu','training','other');
        if(in_array($table,$tables)){   
            $id       =  (int)$_GET['id'];  
            $eid      =  (int)$_GET['e'];
            $return   =  $resumeM -> delFb($table,array('id'=>$id,'eid'=>$eid));
            $return?$this->layer_msg('删除成功!',9):$this->layer_msg('删除失败!',8);
        }        
    }
    function logout_action(){
        $this->adminlogout();
        $this->layer_msg("您已成功退出!",9,0,"index.php");
    }
 
    function status_action(){//简历审核
        $resumeM   =   $this -> MODEL('resume');
        $postData      =   array(
            'state'        =>  intval($_POST['status']),
            'statusbody'   =>  trim($_POST['statusbody'])
        );
        $return  =  $resumeM -> statusResume($_POST['id'],array('post'=>$postData));
        if ($_POST['lasturl']!=''){
            $lasturl    =    $this->post_trim($_POST['lasturl']);
        }else{
            $lasturl    =    $_SERVER['HTTP_REFERER'];
        }
        if($return){
            $this->layer_msg('操作(ID:'.$_POST['id'].')设置成功!',9,0,$lasturl);
        }else{
            $this->layer_msg('设置失败!',8);
        }
    }
}
?>