Skip to content

Commit

Permalink
membuat calendar jadwal dan event menggunakan fullcalendar
Browse files Browse the repository at this point in the history
  • Loading branch information
zdienos committed Feb 22, 2018
1 parent 7e34797 commit b90111a
Show file tree
Hide file tree
Showing 38 changed files with 2,507 additions and 645 deletions.
1 change: 0 additions & 1 deletion application/controllers/Jadwal.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
2 changes: 1 addition & 1 deletion application/models/M_jadwal.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
73 changes: 73 additions & 0 deletions application/models/M_jadwal_last_good.php
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;


}






}
2 changes: 1 addition & 1 deletion application/views/dashboard/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Dashboard
<i class="fa fa-dashboard"></i> Dashboard
</h1>
</section>

Expand Down
2 changes: 1 addition & 1 deletion application/views/identifikasi/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- Content Header (Page header) -->
<section class="content-header" style="padding-bottom: 30px;">
<h1 class="pull-left">
Data Identifikasi Pekerjaan
<i class="fa fa-wrench"></i> Identifikasi Pekerjaan
</h1>


Expand Down
Loading

0 comments on commit b90111a

Please sign in to comment.