Hi,
Thanks for the fantastic Scheduler component, it works really nicely and its been a really enjoyable experience setting it up.
I have added the php scheduler component to my web application and I have it correctly displaying from the mysql database calendar events based on whichever user is logged into the system. I did this by adding a id_user column to the events table and then also modifying my events_rec.php to use the id_user value for a filter:
index.html
modSchedHeight();
scheduler.config.xml_date="%Y-%m-%d %H:%i";
scheduler.config.first_hour = 8;
scheduler.config.multi_day = true;
scheduler.config.date_step = "5"
scheduler.config.details_on_create=true;
scheduler.config.details_on_dblclick=true;
<?PHP
if ($isLoggedOn) {
?>
scheduler.config.readonly=false;
<?PHP
} else {
?>
scheduler.config.readonly=true;
<?PHP
}
?>
scheduler.init('scheduler_here', new Date(),"month");
scheduler.templates.event_class=function(s,e,ev){ return ev.custom?"custom":""; };
scheduler.templates.event_bar_text=function(start,end,event){ var text=event.text.substr(0,20); return "<span title='"+event.text+"'>"+text+"</span>";}
scheduler.templates.event_class=function(start,end,event){ if (start < (new Date())) { return "past_event"; } else { return ""; } };
scheduler.load("events_rec.php?user_id=<?PHP echo $userID ?>");
var dp = new dataProcessor("events_rec.php");
dp.init(scheduler);
events_rec.php
$userid=htmlspecialchars($_GET["user_id"]);
$scheduler->filter("id_user", $userid);
$scheduler->render_table("events_rec","event_id","start_date,end_date,text,rec_type,event_pid,event_length,id_user");
My Question is, how can i make sure that whenever an event is created, the id_user is populated with the correct user_id value?
Many Thanks
Graham Little