Once again, thanks for getting back to me on this.
I ran your code and for some reason it’s not getting the types info properly. I usually use chrome, but I ran it through IE and I get the following message from webpage alert -
Fatal error: Class ‘SQLite3’ not found in /DHX/samples/common/config/php on line 7.
Anyway, I didn’t spend time trying to fix this because it’s a different issue and I didn’t want to go off on a tangent. I’m also pretty sure that your code will work.
So I implemented pretty much what you did on my code and it may have shed a little light on the issue in that it’s a slighly different scenario. I’ll explain -
I didn’t provide ALL the details when I sent you the connection.php file. It’s actually something like this -
connector.php:
<?php
require_once('../../../codebase/connector/scheduler_connector.php');
$res=mysql_connect("00.00.00.00","skooze","password");
mysql_select_db("skooze");
$list_personavail = new OptionsConnector($res);
$list_personavail->render_table("personavail_database","id","id(value),persons_id(value),start_date(value),end_date(value)");
$list_persons = new OptionsConnector($res);
$list_persons->render_table("person_database","id","id(value),name(value)");
$scheduler = new SchedulerConnector($res);
$scheduler->enable_log("temp.log",true);
$scheduler->set_options("personavail", $list_personavail);
$scheduler->set_options("persons", $list_persons);
$scheduler->render_table("skooze_massageappmnt","id","start_date,end_date,id,persons_id");
?>
So to clarify a little - the main events database is skooze_massageappmnt and there is a foreign key into the person_database table (persons_id). No problem using serverList with the person_database in order to have a selector in a lightbox to choose from the list of names (name) in person_database.
A separate table - personavail_database also has a foreign key (persons_id) into the person_database and this table holds the availabilities (start_date, end_date) that I want to use to mark the background.
As mentioned, I have implemented a similar loop to what you sent me as follows -
var time_spans = scheduler.serverList(“personavail”);
scheduler.init(‘scheduler_here’,new Date(),“month”);
scheduler.load("./data/connector_skoozetest.php", function (){
for (var i = 0; i < time_spans.length; i++) {
var tspan = time_spans[i];
alert("The holy grail: "+tspan);
};
… etc.
If I run the above, it does not even enter the loop. time_spans is undefined.
However, if I change schedule.serverList(“personavail”) to schedule.serverList(“persons”), then it does go into the loop and iterates based on the number of records in time_spans as it’s supposed to. So there’s an issue related to the foreign key stuff and the relationship to the main database I assume??
By the way, as an aside (and not the main issue) - when I set it to schedule.serverList(“persons”), the alert box prints - “The holy grail: [object Object]”. How do I get it to print the contents of tspan. I tried tspan.name without avail. Sorry about the noob question.
Thanks,
Irv