diff --git a/application/controllers/Jadwal.php b/application/controllers/Jadwal.php index 974e02b..d07aedd 100644 --- a/application/controllers/Jadwal.php +++ b/application/controllers/Jadwal.php @@ -38,7 +38,6 @@ private function _cek_login() $this->load->view('template/header',$d_header); $this->load->view('template/leftside'); $this->load->view('jadwal/index'); - $this->load->view('template/footer_js'); $this->load->view('jadwal/ajax_scripts'); $this->load->view('template/footer'); } diff --git a/application/models/M_jadwal.php b/application/models/M_jadwal.php index 7be52d6..65a8377 100644 --- a/application/models/M_jadwal.php +++ b/application/models/M_jadwal.php @@ -18,7 +18,7 @@ class M_jadwal extends CI_Model { Public function addEvent() { - $sql = "INSERT INTO tb_jadwal (title,tb_jadwal.start,tb_jadwal.end, description, color) VALUES (?,?,?,?,?)"; + $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; } diff --git a/application/models/M_jadwal_last_good.php b/application/models/M_jadwal_last_good.php new file mode 100644 index 0000000..8014dac --- /dev/null +++ b/application/models/M_jadwal_last_good.php @@ -0,0 +1,73 @@ +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; + + + } + + + + + + +} diff --git a/application/views/dashboard/index.php b/application/views/dashboard/index.php index 385bb31..5ec3399 100755 --- a/application/views/dashboard/index.php +++ b/application/views/dashboard/index.php @@ -3,7 +3,7 @@

- Dashboard + Dashboard

diff --git a/application/views/identifikasi/index.php b/application/views/identifikasi/index.php index 58049bf..b622761 100644 --- a/application/views/identifikasi/index.php +++ b/application/views/identifikasi/index.php @@ -2,7 +2,7 @@

- Data Identifikasi Pekerjaan + Identifikasi Pekerjaan

diff --git a/application/views/jadwal/ajax_scripts.php b/application/views/jadwal/ajax_scripts.php index 5e05098..7d02234 100644 --- a/application/views/jadwal/ajax_scripts.php +++ b/application/views/jadwal/ajax_scripts.php @@ -1,168 +1,325 @@ + + + + + + + + + + + + + + + + + + + + + + + + -}); + + - -var base_url= ""; // Here i define the base_url - -// page is now ready, initialize the calendar... - -$('#calendar').fullCalendar({ - // put your options and callbacks here - header: { - left: 'prev,next today', - center: 'title', - right: 'month,' - }, - events: base_url+'jadwal/getEvents', - displayEventTime : false, - navLinks: true, // can click day/week names to navigate views - editable: true, - droppable: true, // this allows things to be dropped onto the calendar - eventReceive: function(event){ - start = event.start.format('YYYY-MM-DD HH:mm:ss'); - end = start; - $.post(base_url+'jadwal/addEvent', { - title: event.title, - description: '', - color: event.backgroundColor, - start: start, - end: end - }, function(result){ - swal('Jadwal sudah ditambah', {icon: "success", button:false, timer:1500}); - }); - }, - // Handle Existing Event Click - eventClick: function(calEvent, jsEvent, view) { - // Set currentEvent variable according to the event clicked in the calendar - currentEvent = calEvent; - // Open modal to edit or delete event - modal({ - // Available buttons when editing - buttons: { - delete: { - id: 'delete-event', - css: 'btn-danger', - label: 'Hapus' + + + + + + + + + + + diff --git a/application/views/jadwal/ajax_scripts_.php b/application/views/jadwal/ajax_scripts_.php deleted file mode 100644 index 439424d..0000000 --- a/application/views/jadwal/ajax_scripts_.php +++ /dev/null @@ -1,118 +0,0 @@ - diff --git a/application/views/jadwal/ajax_scripts_last_good.php b/application/views/jadwal/ajax_scripts_last_good.php new file mode 100644 index 0000000..bb645bb --- /dev/null +++ b/application/views/jadwal/ajax_scripts_last_good.php @@ -0,0 +1,216 @@ + diff --git a/application/views/jadwal/ajax_scripts_try.php b/application/views/jadwal/ajax_scripts_try.php new file mode 100644 index 0000000..4a3127c --- /dev/null +++ b/application/views/jadwal/ajax_scripts_try.php @@ -0,0 +1,232 @@ + diff --git a/application/views/jadwal/index.php b/application/views/jadwal/index.php index 9a5c18e..0181528 100644 --- a/application/views/jadwal/index.php +++ b/application/views/jadwal/index.php @@ -3,7 +3,7 @@

- Jadwal Kerja + Jadwal Kerja dan Event

@@ -12,15 +12,16 @@
-
+
-

Drag ke kalender

+

Pilih Item

-
Off
-
PH/Cuti
+
Off
+
PH/Cuti
+
Event
@@ -48,8 +49,7 @@ + @@ -47,9 +43,6 @@ - - - @@ -127,7 +120,7 @@ function isNumber(evt) { //pop up swal({ - title: "Anda yakin ingin menghapus datass?", + title: "Anda yakin ingin menghapus data?", icon: "warning", buttons: ["Tidak", "Ya"], dangerMode: true, diff --git a/application/views/template/header.php b/application/views/template/header.php index f529192..24b354a 100644 --- a/application/views/template/header.php +++ b/application/views/template/header.php @@ -13,9 +13,10 @@ + - - + + @@ -27,6 +28,23 @@