Welcome Guest, Not a member yet? Register   Sign In
Simple Calendar
#1

[eluser]mihailt[/eluser]
Hi, recently i needed to have a simple calendar, so i took a look at CI calendaring class.
After playing with it for awhile i realized that i needed something different, a bit more flexible.
as a result came up with this library(couple of methods are extracted from CI_Calendar), code is kinda messy, and lots to be done yet, but it works.

Source code
#2

[eluser]mihailt[/eluser]
and the simple usage would be to call it in the method of needed controller:

Code:
function calendar(){
        $this->load->library('simplecalendar');
        $url = "bookingmanager/calendar";
        $this->simplecalendar->setConfigUrl($url);
        $this->simplecalendar->generateContent();
        echo $this->simplecalendar->generateCalendar();
    }

benefits are that you can do with calendar values anything you want:

Code:
function calendar(){
        $this->load->library('simplecalendar');
        $url = "bookingmanager/calendar";
        $this->simplecalendar->setConfigUrl($url);
        $this->simplecalendar->generateContent();

        $data = $this->simplecalendar->getWeeks();
        foreach($data as $key => $week){
                $newweel = array();
            foreach($week as $key => $day){
                $newweek[$key] = '<div id='.simplecalendar->day.$this->simplecalendar->month.$this->simplecalendar->year.'>' . $day . '</div>';
            }
            $newdata[] = $newweek;

        }
        $this->simplecalendar->setWeeks($newdata);
        echo $this->simplecalendar->generateCalendar();
    }

So i would like hear from you guys what do you think of it. Thanks




Theme © iAndrew 2016 - Forum software by © MyBB