Php Jquery边界日历

Php Jquery边界日历,php,jquery,Php,Jquery,我正在使用。此日历用于创建事件/议程。现在我想当用户从日历创建事件时,这些事件存储在数据库中。我不知道该怎么做。有人能指引我吗?谢谢,我在日历的屏幕截图或文档中看不到任何输入功能,因此我认为您需要: 为用户提供输入新事件详细信息的方法 捕获结果并将其存储到数据库中 因为问题很简单,我会给你一个简单的答案: 如果您特别希望使用漂亮的ajax、漂亮的json和漂亮的css与漂亮的日历进行漂亮的集成,那么您必须将其分解为更具体的问题,你可以写几本关于这些主题的书。如果你只想用php插入数据,你可以在它

我正在使用。此日历用于创建事件/议程。现在我想当用户从日历创建事件时,这些事件存储在数据库中。我不知道该怎么做。有人能指引我吗?谢谢,

我在日历的屏幕截图或文档中看不到任何输入功能,因此我认为您需要:

  • 为用户提供输入新事件详细信息的方法
  • 捕获结果并将其存储到数据库中
  • 因为问题很简单,我会给你一个简单的答案:


    如果您特别希望使用漂亮的ajax、漂亮的json和漂亮的css与漂亮的日历进行漂亮的集成,那么您必须将其分解为更具体的问题,你可以写几本关于这些主题的书。

    如果你只想用php插入数据,你可以在它的add event表单上使用一个表单,并使用post方法将数据发送到一个php文件,然后在该php文件中,你可以使用php轻松地将post数据插入数据库

    但是如果你想添加数据而不需要重新加载页面,你可以在jquery-frontier-cal-1.3.2.js(或者你使用的插件文件的任何版本)中使用ajax调用
    this.addAgendaItem
    函数

    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);      
            }
        };
    
    this.addAgendaItem=函数(calId、title、startDate、endDate、allDay、data、displayProp){
    如果(calId!=null&&title!=null&&startDate!=null&&endDate!=null&&allDay!=null){
    //确保开始日期早于结束日期
    if(DateUtil.secondsDifferenceDirection(startDate,endDate)<0){
    警报(“抱歉,您无法创建在事件开始之前结束的事件”);
    回来
    }
    $.ajax({
    键入:“POST”,
    url:“/*您的php文件路径*/”,
    async:false,
    数据:{/*使用ajax*/}将数据发送到,
    成功:功能(数据){
    //把握成功
    },
    错误:函数(xhr、textStatus、errorshown){
    //错误处理
    }
    });
    calId=条带编号符号(calId);
    var hashData=new Hashtable();
    如果(数据!=null){
    for(var输入数据){
    put(key,data[key]);
    }
    }
    var agi=新的CalendarAgendaItem(标题、开始日期、结束日期、全天、哈希数据);
    如果(displayProp!=null){
    如果(displayProp.backgroundColor!=null){
    agi.setBackgroundColor(displayProp.backgroundColor);
    }
    如果(displayProp.foregroundColor!=null){
    agi.setForegroundColor(displayProp.foregroundColor);
    }
    }
    var calObj=myCalendars.get(calId);
    calObj.addAgendaItem(agi);
    }
    };
    
    您可以根据需要处理这个ajax调用