forked from wecenter/wecenter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
work.php
84 lines (72 loc) · 1.94 KB
/
work.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
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
<?php
/*
+--------------------------------------------------------------------------
| WeCenter [#RELEASE_VERSION#]
| ========================================
| by WeCenter Software
| © 2011 - 2014 WeCenter. All Rights Reserved
| http://www.wecenter.com
| ========================================
| Support: [email protected]
|
+---------------------------------------------------------------------------
*/
if (!defined('IN_ANWSION'))
{
die;
}
class work_class extends AWS_MODEL
{
public function add_work_experience($uid, $start_year, $end_year, $company_name, $job_id)
{
return $this->insert('work_experience', array(
'uid' => intval($uid),
'start_year' => intval($start_year),
'end_year' => intval($end_year),
'company_name' => htmlspecialchars($company_name),
'job_id' => intval($job_id),
'add_time' => time()
));
}
public function get_jobs_list()
{
if ($jobs = $this->fetch_all('jobs', null, 'id ASC'))
{
foreach ($jobs as $key => $val)
{
$job_list[$val['id']] = $val['job_name'];
}
}
return $job_list;
}
public function get_work_experience_list($uid)
{
return $this->fetch_all('work_experience', 'uid = ' . intval($uid), 'start_year DESC');
}
public function del_work_experience($work_id, $uid)
{
return $this->delete('work_experience', 'uid = ' . intval($uid) . ' AND work_id = ' . intval($work_id));
}
public function update_work_experience($update_data, $work_id, $uid)
{
if (! $uid OR ! $work_id)
{
return false;
}
return $this->update('work_experience', $update_data, 'uid = ' . intval($uid) . ' AND work_id = ' . intval($work_id));
}
public function remove_job($job_id)
{
return $this->delete('jobs', 'id = ' . intval($job_id));
}
public function add_job($job_name)
{
return $this->insert('jobs', array(
'job_name' => htmlspecialchars($job_name)
));
}
public function update_job($id, $data)
{
return $this->update('jobs', $data, 'id = ' . intval($id));
}
}