Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8981481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:20:50+00:00 2026-06-15T20:20:50+00:00

I have a calendar event using fullcalendar jQuery would I implement in codeigniter 1.7.2

  • 0

I have a calendar event using fullcalendar jQuery would I implement in codeigniter 1.7.2

When I would implement such a function fullcalendar getEvenByCategory, even not appear at all

This is my controller [kalender.php]

function json_kategori($id) {
    header("Content-Type: application/json");
    echo $this->MKalender->jsonEventsByKategori();
}

function kategori($id) {
    $query = $this->db->query("
            SELECT
                COUNT(*) as jml from kalender
            WHERE
                `IDKategori` = '$id'
            ");
    foreach ($query->result() as $row) {
        $row = $row->jml;
    }
    $config['base_url'] = base_url() . 'kalender/kategori/' . $id . '/';
    $config['total_rows'] = $row;
    $config['per_page'] = '4';
    $config['uri_segment'] = 4;
    $config['first_link'] = 'Awal';
    $config['last_link'] = 'Akhir';
    $config['next_link'] = 'Selanjutnya';
    $config['prev_link'] = 'Sebelumnya';
    $this->pagination->initialize($config);
    $data['kalender'] = $this->MKalender->getAllKalenderByKategori($id,
                    $config['per_page'], $this->uri->segment(4));

    $data['kategori'] = $this->MKategoriKalender->getKategori($id);
    $data['title'] = $data['kategori']['kategori'];
    $data['main'] = 'kalender/kalender_kategori';
    $this->load->vars($data);
    $this->load->view('layout/template');
}

this is my model [mkalender.php]

function jsonEventsByKategori($catid) {
    $sql = "
        SELECT
                *
        FROM
                kalender
        WHERE
                IDKategori = $catid
        ORDER BY
                TanggalMulai";
    $query = $this->db->query($sql);
    // echo $sql;
    return $query->result_array();
    $jsonevents = array();
    foreach ($query as $entry) {
        $jsonevents[] = array(
            'id' => $entry->IDKalender,
            'start' => $entry->TanggalMulai,
            'end' => $entry->TanggalAkhir,
            'title' => $entry->judul,
            'body' => $entry->konten,
            'multi' => 0,
            'allDay' => false,
            'extension_id' => 2
        );
    }
    return json_encode($jsonevents);
}

in this my view [kalender/kalender_kategori.php]

<script type='text/javascript'>
$(document).ready(function() {
    var date = new Date();
    var d = date.getDate();
    var m = date.getMonth();
    var y = date.getFullYear();
    $('#calendar').fullCalendar({
        firstDay:'1',
        theme:true,
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,agendaWeek,agendaDay'
        },
        editable: true,
        events: '<?= base_url(); ?>kalender/json_kategori'
    });
});</script>

<div id="main"><div id='calendar'></div></div>

so my question is, how the application code in the model to display calendar events by category events?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T20:20:51+00:00Added an answer on June 15, 2026 at 8:20 pm

    1) you are missing a paremeter whn jsonEventsByKategori is called.

    function json_kategori($id) {
      header("Content-Type: application/json");
       echo $this->MKalender->jsonEventsByKategori(jsonEventsByKategori); //here
    }
    

    2)In your model, since you have already returned the result_array…. the jsonevents[] part will not be executed… so u can return the result_array() in model and do the foreach loop in controller…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have embedded the fullcalendar jquery control by using this code: $(document).ready(function() { var
I am trying to implement jquery full calendar with json event updates. I have
I am building an event calendar and using the sortable function in jQuery. My
I have a jquery fullcalendar . I would like to trigger jquery QTip (or
I am using jquery mobile datepicker, i need to capture the calendar click event,
I am using a jquery calendar called fullcalendar. When a user clicks a day
I'm using the jquery fullcalendar, and gave it events: '/calendar/1' to call the events
I am using the jQuery Fullcalendar plugin. On the same page, I have a
I have a calendar application and it loads all of the event data using
I am using fullCalendar and jquery. I have started by using the Dragging External

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.