I am trying to create a scheduler app that pulls not just the events but a list of employees (used as Unit View headers and to populate some options in the lightbox) from the table. However, I’m running into a problem that has me stumped.
I have been trying to follow the example set out in this page http://docs.dhtmlx.com/scheduler/units_view.html ; however, the line
breaks the script.
Here’s the complete code of the PHP file.
<?php
include('dhtmlxConnector_php/codebase/scheduler_connector.php');
$res = mysql_connect("127.0.0.1", "******", "******");
if(!$res)
{
print_r("DED");
exit;
}
mysql_select_db("scheduler");
$list = new OptionsConnector($res, "MySQLi");
$list->render_table("scheduler_employees","employee_id","employee_id(value),name(label)");
$calendar = new schedulerConnector($res);
$calendar->set_options("employees", $list);
$calendar->render_sql("Select scheduler_events.*, scheduler_employees.pin FROM scheduler_events JOIN scheduler_employees ON scheduler_employees.employee_id = scheduler_events.employee_id","a.id","start_date,end_date,state,type,text,pin,employee_id");
mysql_close($res);
?>
I’m sure I must be missing something. Any help would be appreciated!
Hello,
does it show any error message?
Try enabling connector logging, may be it will show something
docs.dhtmlx.com/connector__php__errors.html
You create connection using original PHP MySQL api:
$res = mysql_connect("127.0.0.1", "******", "******");
php.net/manual/en/book.mysql.php
Then you specify MySQLi as connection type, which does not match type you use
$list = new OptionsConnector($res, "MySQLi");
php.net/manual/en/book.mysqli.php
Try either using mysqli connection, or specify MySQL connection type
To use “MySQLi” you need one more extra include
include('dhtmlxConnector_php/codebase/scheduler_connector.php');
include('dhtmlxConnector_php/codebase/db_mysqli.php');
OK, thanks for the help, I managed to find where the problem was thanks to your inputs.
(I changed the code to use mysqli for one thing)
There are still a few problems, but I’m getting them figured out.
For live update mode, is the live_updates.js file included in any of the distribution packages, or is that one that needs to be written by the user?
OK, I found the live_updates.js file (had to download the demo).
I’m having a further problem, though. I and my coworker have been trying to set up Node.js for the live update mode. When we try to run the server.js script, however, we get the following error:
iisnode encountered an error when processing the request.
HRESULT: 0x2
HTTP status: 500
HTTP reason: Internal Server Error
You are receiving this HTTP 200 response because system.webServer/iisnode/@devErrorsEnabled configuration setting is ‘true’.
In addition to the log of stdout and stderr of the node.exe process, consider using debugging and ETW traces to further diagnose the problem.
The last 64k of the output generated by the node.exe process to stderr is shown below:
(node) sys is deprecated. Use util instead.
(node) util.puts is deprecated. Use console.log instead.
Oddly enough we get the ‘Server running’ console message right after it…
OK… We FINALLY got live updates working. Mostly.
When we add a new event in one instance, it doesn’t propagate to the other instance until we MOVE the event. Is there a way of fixing this?
Thanks! (PS: Any idea how to get the date to display in 12-hour format while using the dhtmlxscheduler_flat.css CSS file?)
Any idea how to get the date to display in 12-hour format
Check
docs.dhtmlx.com/scheduler/faq.ht … litarytime