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]