开发者

Jquery Frontier Calendar

I'm using Frontier Jquery Calendar. This calendar is using fo开发者_StackOverflow社区r creating events/agenda. Now I want when user create event from calendar, then these event store in DB. I don't do how to do that. Any one can guide me? thanks,


I don't see any input function from the calendar's screenshot or doc, so I think you need to:

  1. Provide a means for user to input new event details.
  2. Capture the result and store them into database.

Since the question is simple I'll point you to a simple answer: http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php

If you specifically want nice integration with the nice calendar using nice ajax, nice json, and nice css, you'll have to break it down into more specifc questions, as you can write several books with these topics.


if you want to just insert data using php you can use a form on its add event form and send that data to a php file using post method and then in that php file you can easily insert that post data in your database using php.

but if u want to add data without even reloading of page you can use ajax call in this.addAgendaItem function in jquery-frontier-cal-1.3.2.js(or whatever version of plugin file you r using) like this

this.addAgendaItem = function(calId,title,startDate,endDate,allDay,data,displayProp){
        if(calId != null && title != null && startDate != null && endDate != null && allDay != null){
            // make sure start date comes before end date
            if(DateUtil.secondsDifferenceDirection(startDate,endDate) < 0){
                alert("Sorry, you can't create an event that ends before it starts");
                return;
            }
           $.ajax({
                type: 'POST',
                url: "/*your php file path*/ ",
                async: false,
                data: { /*Send data to using ajax*/ },
                success: function (data) {
                 //handle on success
                },
                error: function (xhr, textStatus, errorThrown) {
                 //handle on error
               }

            });
            calId = stripNumberSign(calId);
            var hashData = new Hashtable();
            if(data != null){
                for(var key in data){
                    hashData.put(key,data[key]);
                }
            }
            var agi = new CalendarAgendaItem(title,startDate,endDate,allDay,hashData);
            if(displayProp != null){
                if(displayProp.backgroundColor != null){
                    agi.setBackgroundColor(displayProp.backgroundColor);
                }
                if(displayProp.foregroundColor != null){
                    agi.setForegroundColor(displayProp.foregroundColor);
                }
            }
            var calObj = myCalendars.get(calId);
            calObj.addAgendaItem(agi);      
        }
    };

you can handle this ajax call as you want.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜