jQuery FullCalendar下一个按钮不显示周视图事件(ajax)

I'm working on a calendar that fetches data from an immensely populated database (more than 10,000 records). This has made the application extremely slow to load.

In view of this, I am trying to implement via AJAX (json) a search for weeks.

I've already been able to load the current week via AJAX, but when I click the prev or next buttons, the adjacent weeks are empty.

From what I read in the documentation, these buttons would continue sending the startParam and endParam variables, but this is not happening.

My code is jammed and full of php patches, but it works perfectly, except for this slowness.

Jquery:

events:{
url: '../ajax/entrada_agenda.php',
type: 'GET',
dataType: 'json',
data: {
        startParam: <?=strtotime($FirstDayWeek)?>, 
        endParam: <?=strtotime($LastDayWeek)?>, 
    },
}

,

And in the PHP page I make a select with the dates sent (already converted to UNIX).

SELECT * FROM agenda_marcacao WHERE DATE(data_do_agendamento) >= '".$data_start."' AND DATE(data_do_agendamento) <= '".$data_end."'

$data_start and $data_end are variables populate like this:

$data_start = date("Y-m-d", $_GET['start']); 
$data_end = date("Y-m-d", $_GET['end']); 

Is there any way I can indicate on the prev and next buttons these start and end values for weeks?

Because of what I see, FullCalendar will not interpret that I want to pick up the events of the weeks only when prompted, not the entire database ...

Any help will be greatly appreciated, thanks :)

dthyxna3894
dthyxna3894 男人,谢谢你救我,生病从不使用网络工具,但现在,我可以看到我发布的内容,并且可以纠正...非常好,非常感谢(对不起英语不好)
一年多之前 回复
dongxiaolin2801
dongxiaolin2801 你应该在PHP中得到一个错误-date()期望第二个参数是一个整数,而不是一个字符串。见php.net/manual/en/function.date.php。您需要在代码中包含php.net/manual/en/function.strtotime.php。例如,请参阅stackoverflow.com/a/49658097/5947043
一年多之前 回复
duanduanxi9441
duanduanxi9441 感谢您的评论,$data_start和$data_end的变量填充如下:$data_start=date(“Y-m-d”,$_GET['start']);$data_end=date(“Y-m-d”,$_GET['end']);
一年多之前 回复
dongyanju1094
dongyanju1094 附:如果您向我们展示如何填充$data_start和$data_end,我们可能会知道您是否正确地从fullCalendar中获取值。另外,您是否检查了fullCalendar是否正在发送正确的值(通过观看浏览器的网络工具)?我认为你需要多调试一下,主要是。
一年多之前 回复
douhuigan8063
douhuigan8063 您的代码容易受到SQL注入攻击。您应该使用参数化查询和预准备语句来帮助防止攻击者通过使用恶意输入值来破坏您的数据库。bobby-tables.com给出了风险的解释,以及如何使用PHP/mysqli安全地编写查询的一些示例。切勿将未经过处理的数据直接插入SQL。现在编写代码的方式,有人可能会轻易窃取,错误更改甚至删除您的数据。
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐