forked from FeeiCN/grw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel_note.php
executable file
·55 lines (50 loc) · 1.04 KB
/
model_note.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
<?php
class model_note extends FeiModel
{
var $pk = "id";
var $table = "note";
public function view($data)
{
$id = intval($data['id']);
$con = array(
'userid' => $_SESSION['Fei_Userid'],
'id' => $id
);
if ($info = $this->find($con)) {
return $info;
} else {
return FALSE;
}
}
public function add($data)
{
$row = array(
'userid' => $_SESSION['Fei_Userid'],
'title' => $data['note_title'],
'content' => $data['note_content'],
'keywords' => $data['note_keywords']
);
return $this->create($row);
}
public function edit($data)
{
$con = array(
'userid' => $_SESSION['Fei_Userid'],
'id' => $data['note_id']
);
$row = array(
'title' => $data['note_title'],
'content' => $data['note_content'],
'keywords' => $data['note_keywords']
);
return $this->update($con, $row);
}
public function del($data)
{
$con = array(
'userid' => $_SESSION['Fei_Userid'],
'id' => $data['id']
);
return $this->delete($con);
}
}