hi all,
There is a problem if i must only using those methods and without asp,xml,
How can i load and edit events?This problem I research for few days
I using Stupid way to load events ,here is my code :
Mysql Structure: actNo|actDate|startTime|endTime|actName|actPlace|userNo
function init() {
scheduler.locale.labels.timeline_tab = "Timeline"
scheduler.locale.labels.section_UserNo="User No.";
scheduler.locale.labels.section_actNo="Action No";
scheduler.locale.labels.section_actName="Action Name";
scheduler.locale.labels.section_actPlace="Location";
scheduler.locale.labels.section_holName="holName";
scheduler.locale.labels.section_holDate="holDate";
scheduler.locale.date.prototype=""
scheduler.locale.labels.date="%Y-%m-%d %H:%i%s";
scheduler.config.details_on_create=true;
scheduler.config.details_on_dblclick=true;
scheduler.config.xml_date="%Y-%m-%d %H:%i";
scheduler.init('scheduler_here',null,"week");
//===============
//Configuration
//===============
scheduler.createTimelineView({
name: "timeline",
x_unit: "minute",
x_date: "%H:%i",
x_step: 30,
x_size: 24,
x_start: 16,
x_length: 48,
y_unit: sections,
y_property: "section_id",
render:"bar"
});
var sections=[
{key:1, label:"1"},
{key:2, label:"2"},
{key:3, label:"3"},
{key:4, label:"4"}
];
//===============
//Data loading
//===============
scheduler.config.lightbox.sections=[
{name:"actNo", height:21, map_to:"actNo", type:"template" },
{name:"actPlace", height:130, map_to:"actPlace", type:"textarea" , focus:true},
{name:"actName", height:21, map_to:"actName", type:"textarea" , focus:true},
{name:"UserNo", height:23, type:"select", options:sections, map_to:"section_id" },
{name:"time", height:72, type:"time", map_to:"auto"}
]
<?php
$arrayRows=mysql_query("select * from schedule;");
while($arrayScheduleRows=mysql_fetch_array($arrayRows)){
$ScheduleRows_actNo=$arrayScheduleRows['actNo'];
$ScheduleRows_actDate=$arrayScheduleRows['actDate'];
$ScheduleRows_startTime=$arrayScheduleRows['startTime'];
$ScheduleRows_endTime=$arrayScheduleRows['endTime'];
$ScheduleRows_actName=$arrayScheduleRows['actName'];
$ScheduleRows_actPlace=$arrayScheduleRows['actPlace'];
$ScheduleRows_userNo=$arrayScheduleRows['userNo'];
?>
var arrayScheduleRows_actPlace='<?php echo $ScheduleRows_actPlace;?>';
var arrayScheduleRows_actNo=<?php echo $ScheduleRows_actNo;?>;
var arrayScheduleRows_actName='<?php echo $ScheduleRows_actName;?>';
var arrayScheduleRows_Start_date = '<?php echo $ScheduleRows_startTime;;?>';
var arrayScheduleRows_end_date = '<?php echo $ScheduleRows_endTime;?>';
scheduler.parse([
{actNo:arrayScheduleRows_actNo, actName:arrayScheduleRows_actName, actPlace:arrayScheduleRows_actPlace, start_date:arrayScheduleRows_Start_date, end_date:arrayScheduleRows_end_date},
],"json");
<?php }?>//=====loop parse
[b]Fail AddEvent[/b]
scheduler.attachEvent("onEventSave", function(actNo,actName,actPlace,start_date,end_date){
<?php mysql_query("insert into schedule (actNo,actDate,startTime,endTime,actName,actPlace,userNo) values (
'6',
'2012-04-04',
'start_date', <==== error if i change it to [b]' ". start_date." ',[/b]
'end_date',
'asd',
'asd',
'1')"); ?>
this._empty_lightbox(),this.hide_lightbox()
});
}
if there have other way to make it , please tell me :'(