Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function get_agenda_sekolah() {
- $start = substr($this->input->get("start"), 0, 10);
- $end = substr($this->input->get("end"), 0, 10);
- $data = [];
- if (is_valid_date($start) && is_valid_date($end)) {
- $query = $this->db->query("
- SELECT post_title AS title
- , post_date AS `start`
- FROM posts
- WHERE post_type='agenda'
- AND post_date BETWEEN '$start' AND '$end'
- ");
- foreach ($query->result() as $row) {
- $data[] = [
- 'title' => $row->title,
- 'start' => $row->start
- ];
- }
- }
- echo json_encode($data);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement