Events not displaying on scheduler

Hello,
I am new to dhtmlx and I am using dhtmlx connector to extract events from an oracle database and display them on dhtmlxsheduler. The events do not display on the calendar. The code I am using and an extract of the xml retrieved is shown below.
Connector code

<?php require("E:\web\dhtmlxSuite\dhtmlxConnector_php\codebase\scheduler_connector.php"); require("E:\web\dhtmlxSuite\dhtmlxConnector_php\codebase\db_oracle.php"); include ("E:\web\dhtmlxSuite\system.inc.php"); $res = oci_connect($UID,$PWD,$SID); $schedulerConn = new SchedulerConnector($res,"ORACLE"); $schedulerConn->enable_log("temp.log",true); $schedulerConn->render_sql("SELECT TO_CHAR(STARTTIME,'DD-Mon-YYYY HH24:MI:SS')starttime,TO_CHAR(FINISHTIME,'DD-Mon-YYYY HH24:MI:SS')finishtime,MODULEID,ROOMID FROM TT_TEST","SLOTID","STARTTIME,FINISHTIME,MODULEID,ROOMID"); ?>

index.html

 
 
	<script type="text/javascript" charset="utf-8">
	scheduler.config.xml_date="%j-%M-%Y %G:%i";
	scheduler.init('scheduler_here',null,"week");
	scheduler.load("connector1.php");
	</script>

xml retrieved

  • <start_date>
  • </start_date>
  • <end_date>
  • </end_date>
  • <start_date>
  • </start_date>
  • <end_date>
  • </end_date>

Any guidance would be very much appreciated.

Hi,

Have you checked your paths?

Perhaps adding an absolute path for scheduler.load("connector1.php"); might help.

Also, please enable logging if you haven’t done so. I have found this output invaluable in my debugging.

$scheduler->enable_log("log.txt",true);

Thanks,

Tim

Try to change in sql code
DD-Mon-YYYY
as
DD-MM-YYYY

and in js code
scheduler.config.xml_date="%j-%M-%Y %G:%i";
as
scheduler.config.xml_date="%j-%m-%Y %G:%i";

Hello Thanks very much for your help. The events are now displaying on the calendar but not displaying all the data. The scheduler does not appear to be picking up all the data so the moduleid shows but not the roomid and firefox does not display correctly which makes me wonder if there is an error in the code somewhere. Code is now as below:
connector.php

<?php
   require("E:\web\dhtmlxSuite\dhtmlxConnector_php\codebase\scheduler_connector.php");
   require("E:\web\dhtmlxSuite\dhtmlxConnector_php\codebase\db_oracle.php");
   include ("E:\web\dhtmlxSuite\system.inc.php");
	 
   $res = oci_connect($UID,$PWD,$SID);
   $schedulerConn = new SchedulerConnector($res,"ORACLE");
   $schedulerConn->enable_log("E:\ACS\dhtmlxSuite\dhtmlxConnector_php\temp.log",true);
   $schedulerConn->render_sql("SELECT TO_CHAR(STARTTIME,'DD-MM-YYYY H24:MI')                    
   starttime,TO_CHAR(FINISHTIME,'DD-MM-YYYY HH24:MI')finishtime,MODULEID,ROOMID               FROM TT_TEST2","SLOTID","STARTTIME,FINISHTIME,MODULEID,ROOMID");
?>

Index.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
  <script src="codebase\dhtmlxcommon.js"></script>
  <script src="codebase\dhtmlxscheduler.js" type="text/javascript" charset="utf-8"></script>
  <link rel="stylesheet" href="codebase\dhtmlxscheduler.css" type="text/css" charset="utf-8">
	 
</head>
   <div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%;'>
     <div class="dhx_cal_navline">
       <div class="dhx_cal_prev_button">&nbsp;</div>
       <div class="dhx_cal_next_button">&nbsp;</div>
       <div class="dhx_cal_today_button"></div>
       <div class="dhx_cal_date"></div>
       <div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>
       <div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>
       <div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
  </div>
      <div class="dhx_cal_header"></div>
      <div class="dhx_cal_data"></div>	
 </div>
		
<script type="text/javascript" charset="utf-8">
scheduler.config.xml_date="%j-%m-%Y %H:%i";
scheduler.init('scheduler_here',null,"week");
scheduler.load("connector1.php");
</script>

examples of xml data is as shown below

  • <start_date>
  • </start_date>
  • <end_date>
  • </end_date>
  • <start_date>
  • </start_date>
  • <end_date>
  • </end_date>
- - - - - - - - Events show up in correct places but with only moduleid, no roomid in Internet explorer and in firefox just a blue screen is displayed. Any help would be much appreciated.

Change the render command as

“STARTTIME,FINISHTIME,TEXT,MODULEID,ROOMID”);

Scheduler expects that 3 first fields will be start, end times and text value, any custom fields can start from 4th position.

Also, you may need to redefine event_text template on the client side, if you have not text property and wont to show some info based on module or room id.

Thanks very much for your help. I did as you suggested but now the calendar doesn’t show any events. I have tried several versions of the event text template but can’t get any to work.

[code]

 
 
	<script type="text/javascript" charset="utf-8">
	scheduler.config.xml_date="%j-%m-%Y %H:%i";
	scheduler.config.multi_day = true;
	scheduler.config.first_hour=6;
	scheduler.config.last_hour=22;
	scheduler.config.hour_size_px=50;
	scheduler.templates.event_text=function(start,end,event)
	{
	return event.text+event.SUBJECT+event.TYPE+event.ROOM+event.NAME;
	}
	scheduler.config.readonly = true;
	scheduler.init('scheduler_here',null,"month");
	scheduler.load("connector6.php");
	</script>

[/code]
I have also tried

scheduler.templates.event_text=function(start,end,event)
		{
		return event.text + event.SUBJECT + event.TYPE + event.ROOM + event.NAME;
		}

and

scheduler.templates.event_text=function(start,end,event) { return "Module:<b> "+event.text+"</b><br>"+"Subject:<b> "+event.SUBJECT+"</b><br>"+"Type:<b> "+event.TYPE+"</b><br>"+"Room:<b> "+event.ROOM+"</b><br>"+"Lecturer:<b> "+event.NAME; }
xml data example is shown below

  • <start_date>
  • </start_date>
  • <end_date>
  • </end_date>

Any help would be much appreciated. Thanks