-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalendar.php
52 lines (47 loc) · 1.21 KB
/
calendar.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
<?
class Calendar extends CI_Controller{
public function __construct(){
parent::__construct();
$this->load->database();
$this->load->model('cpms/calModel');
}
public function calInsert(){
$id=$this->calModel->addId();
if(count($id)!=0)
$id=($id[0]->id)+1;
else
$id=1;
echo $id;
$title=$this->input->post('title');
$start=$this->input->post('start');
$end=$this->input->post('end');
$color=$this->input->post('color');
$user=$this->input->post('user');
$this->calModel->calInsert($id,$title,$start,$end,$color,$user);
}
public function calView(){
$user=$this->input->post('user');
$result=$this->calModel->calView($user);
for($i=0;$i<count($result);$i++){
echo $result[$i]->id."<br>";
echo $result[$i]->title."<br>";
echo $result[$i]->start."<br>";
echo $result[$i]->end."<br>";
echo $result[$i]->color."<br>";
}
}
public function calUpdate(){
$id=$this->input->post('id');
$start=$this->input->post('start');
$end=$this->input->post('end');
$this->calModel->calUpdate($id,$start,$end);
}
public function calDelete(){
$id=$this->input->post('id');
$this->calModel->calDelete($id);
}
public function select(){
$this->load->view('cpms/select');
}
}
?>