-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
membuat calendar jadwal dan event menggunakan fullcalendar
- Loading branch information
Showing
38 changed files
with
2,507 additions
and
645 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?php | ||
defined('BASEPATH') OR exit('No direct script access allowed'); | ||
|
||
class M_jadwal extends CI_Model { | ||
|
||
|
||
/*Read the data from DB */ | ||
Public function getEvents() | ||
{ | ||
|
||
$sql = "SELECT * FROM tb_jadwal WHERE tb_jadwal.start BETWEEN ? AND ? ORDER BY tb_jadwal.start ASC"; | ||
return $this->db->query($sql, array($_GET['start'], $_GET['end']))->result(); | ||
|
||
} | ||
|
||
Public function getEventsAllDay() | ||
{ | ||
|
||
$sql = "SELECT * FROM tb_jadwal WHERE tb_jadwal.start ORDER BY tb_jadwal.start ASC"; | ||
return $this->db->query($sql)->result(); | ||
|
||
} | ||
|
||
/*Create new events */ | ||
|
||
Public function addEvent() | ||
{ | ||
|
||
$sql = "INSERT INTO tb_jadwal (title,tb_jadwal.start,tb_jadwal.end, description, color) VALUES (?,?,?,?,?)"; | ||
$this->db->query($sql, array($_POST['title'], $_POST['start'],$_POST['end'], $_POST['description'], $_POST['color'])); | ||
return ($this->db->affected_rows()!=1)?false:true; | ||
} | ||
|
||
/*Update event */ | ||
|
||
Public function updateEvent() | ||
{ | ||
|
||
$sql = "UPDATE tb_jadwal SET title = ?, description = ?, color = ? WHERE id = ?"; | ||
$this->db->query($sql, array($_POST['title'],$_POST['description'], $_POST['color'], $_POST['id'])); | ||
return ($this->db->affected_rows()!=1)?false:true; | ||
} | ||
|
||
|
||
/*Delete event */ | ||
|
||
Public function deleteEvent() | ||
{ | ||
|
||
$sql = "DELETE FROM tb_jadwal WHERE id = ?"; | ||
$this->db->query($sql, array($_GET['id'])); | ||
return ($this->db->affected_rows()!=1)?false:true; | ||
} | ||
|
||
/*Update event */ | ||
|
||
Public function dragUpdateEvent() | ||
{ | ||
//$date=date('Y-m-d h:i:s',strtotime($_POST['date'])); | ||
|
||
$sql = "UPDATE tb_jadwal SET tb_jadwal.start = ? ,tb_jadwal.end = ? WHERE id = ?"; | ||
$this->db->query($sql, array($_POST['start'],$_POST['end'], $_POST['id'])); | ||
return ($this->db->affected_rows()!=1)?false:true; | ||
|
||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.