Adding more fields to the scheduler

I’m having a hard time understanding how to insert the fields i added in the custom form to the database.
I want to be able to save these fields to my ACCESS database.
Where should i make the changes in the code so my custom fields will be added to the database (same way the default fields are added)?
Help much appreciated!

scheduler.html

[code]
scheduler.config.init_date = new Date();

		scheduler.config.form = [
	
			{view:"text",		label:scheduler.locale.labels.label_event, id:"text", name:'text'},
			{view:"datetext",	label:scheduler.locale.labels.label_start,	id:'start_date',name:'start_date', dateFormat:scheduler.config.form_date},
			{view:"datetext",	label:scheduler.locale.labels.label_end,	id:'end_date',name:'end_date', dateFormat:scheduler.config.form_date},
			{view:"text",label:scheduler.locale.labels.label_username,id:"username", name:'username'},
			{view:"text",label:scheduler.locale.labels.label_familyname,id:"familyname", name:'familyname' },
			{view:"toggle",   id:'allDay',     label:"", align: "right", value:"0", options: [
             {value:"0",label:scheduler.locale.labels.label_time},               
             {value:"1",label:scheduler.locale.labels.label_allday}
			]},
			{view:"textarea",label:scheduler.locale.labels.label_details, id:"details", name:'details'}
		];
	
		dhx.ready(function(){
	        dhx.ui.fullScreen();
			dhx.ui({
			   		view: "scheduler",
					id: "scheduler",
					save: "scripts/myConnector.php"
			});
			//$$("scheduler").clearAll();
			$$("scheduler").load("scripts/myConnector.php","scheduler");
			
		});
	</script>[/code]

myConnector.php

[code]<?php
require(“connectors/scheduler_connector.php”);
require(“connectors/db_pdo.php”);

$connection = new PDO("odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=../../db/HMS.mdb");

$scheduler = new schedulerConnector($connection,“PDO”);

//$scheduler->enable_log(“log.txt”,true);

$scheduler->render_table(“SELECT * from Activities WHERE familyName = '”.$_COOKIE[‘familyName’]."’",“ActivityId”,“StartDate,EndDate,ActivityName,details,UserName,FamilyName”);

?>
[/code]

The 1st, 2nd and the 3rd fields in the 3rd paramerer of the render_table method will be converted in start_date, end_date and text xml tags. Others fields will be sent as they are. Therefore, you need to use UserName instead of username and FamilyName instead of familyname in the form config.

You may run myConnector.php in browser and check the structure of generated xml.

Thank you! It works!
but there seems to be a problem with updating and deleting when i use the SELECT query in the render_table:

$scheduler->render_table("SELECT * from Activities WHERE FamilyName = '".$_COOKIE['familyName']."'","ActivityId","StartDate,EndDate,ActivityName,details,UserName,FamilyName");

but if i use :

$scheduler->render_table("Activities'","ActivityId","StartDate,EndDate,ActivityName,details,UserName,FamilyName");

everythings works.

How do i run a query to get specific events according to the FamilyName field?

Also how can i add the UserName and FamilyName fields when i view an event? It’s only available in the form.

forget the second question:

I just have the problem with the SELECT query in the render_table.
How can i fix that?

I get this error when updating:

nevermind! the problem was SELECT *
I just wrote SELECT ActivityID,etc…
and it worked! can’t belive that was the problem!

It wasn’t getting the id from the database.

Hi,

  • and list of fields must behave the same. We have just tested similar sample to yours - the scheduler’s been correctly updated.

However, we glad to know that you solved the problem )