jQuery Fullcalendar Integration with Codeigniter and MySQL

Event Calendar is an important feature of web applications to allow users to add, edit, and display events in a Calendar. A FullCalendar is an open-source jQuery Library and that provides to create an event in the calendar and you can easily customize the library event. It also supports event resizing to extend or change event duration. In this tutorial, we will explain how to integrate FullCalendar in Codeigniter and jQuery with display events. This is a very simple example, you can just copy-paste, and change according to your requirements.
In this tutorial, you will learn to how create CRUD (create, read, update, delete) operation REST API with Slim Framework. This is a very simple example, you can just copy paste, and change according to your requirement.
Before started to implement the FullCalendar in Codeigniter, jQuery and MySQL, look files structure:
  • integrate-fullcalendar-in-codeigniter
    • application
      • config
        • autoload.php
        • database.php
        • constants.php
        • routes.php
      • controllers
        • Event.php
      • models
        • Event_model.php
      • views
        • calendar
          • index.php
        • templates
          • header.php
          • footer.php
    • system
    • index.php
    • assets
      • css
        • style.css
      • packages
Download FullCalendar Library click here.
Step 1: Create the database and Table
For this tutorial, you need a MySQL database with the following table:
Step 2: Create Model
Create a model file named Event_model.php inside “application/models” folder.
Step 3: Create controllers
Create a controllers file named Event.php inside “application/controllers” folder.
  • The Event controller handles the calendar process.
  • __construct() – Loads the required library, helper and model.
  • index() – load calendar data.
  • loadEventData() – Ajax request and get event data.
Include Bootstrap, jQuery and FullCalendar plugin in header and footer
Header
Footer
Step 4:Create a view(header)
Create a view file named header.php inside “application/views/templates” folder.
This view contains the header section of the webpage. The Bootstrap library is used to provide a better UI, so, include it in the header section.
Step 5: Create a view(footer)
Create a view file named footer.php inside “application/views/templates” folder.
This view contains the footer section of the webpage.
Step 6: Create views
Create a views file named index.php inside “application/views/calendar folder.
Step 7: Load Calendar
We will also need to use jQuery code in views index.php in "application/views/calendar" directory to load calendar data