Hi,
I’m experiencing a strange behavior while creating new schedule.
I’ve my scheduler and when I create new schedule (double clicking to the day cell) through the default ligthbox. At Save time I create an entry into my database then I call scheduler load function. The scheduler is correctly refreshed, but I see to entries into the scheduler, see attachments.
One is from the database, the 2nd don’t know from where (into the database I’ve just one insert).
The load function is:
scheduler.attachEvent("onEventSave",function(id,data,is_new_event){
var date_to_str = scheduler.date.date_to_str(scheduler.config.api_date);
var param = "idm="+id+"&title="+data.text+"&ds="+date_to_str(data.start_date)+"&de="+date_to_str(data.end_date);
$.get("data/calendarEventManage.php?act=ins&"+param, function(data) {
alert(data);
scheduler.load("xml/calendarLoad.php");
return true;
});
})
calendarLoad.php is:
<?php
header("Content-type: text/xml");
session_start();
require("../db/conn.php");
require("../php/general_functions.php");
$uid = $_SESSION["uid"];
//$uid = 1;
//create the XML
echo('<?xml version="1.0" encoding="UTF-8"?>');
echo('<data>');
$sql = "SELECT m.id_meeting, m.id_customer, c.company_name, m.title, ".
" m.date_start, m.date_end, m.note ".
" FROM v_meeting m, v_customer_list c ".
" WHERE m.id_user = $uid ".
" AND date_start > now() ".
" AND c.id_customer = m.id_customer";
$asset = mysql_query ($sql);
if($asset){
while($row=mysql_fetch_array($asset)){
echo(' <event id="'.$row['id_meeting'].'">');
$text = $row['title'];
if($row['company_name'] != "") {
$text = $row['company_name'].' - '.$text;
}
echo(' <text><![CDATA['.$text.']]></text>');
echo(' <start_date>'.getSchedulerFormatFromMYSQL($row['date_start']).'</start_date>');
echo(' <end_date>'.getSchedulerFormatFromMYSQL($row['date_end']).'</end_date>');
echo(' <details><![CDATA['.$row['note'].']]></details>');
echo(' </event>');
}
}
echo('</data>');
?>
Thanks in advance,
Samuel