summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry <dmitry@dhtmlx.com>2012-05-17 13:24:52 +0200
committerDmitry <dmitry@dhtmlx.com>2012-05-17 13:24:52 +0200
commit79a70baf13ecfac2c93d64586628232383e4caef (patch)
tree04ed59438bc172c5512a06e89adb061914f093f7
parent871fbee2abdb4fe23d230e690b6078bd2c9ca86a (diff)
downloadconnector-php-79a70baf13ecfac2c93d64586628232383e4caef.zip
connector-php-79a70baf13ecfac2c93d64586628232383e4caef.tar.gz
connector-php-79a70baf13ecfac2c93d64586628232383e4caef.tar.bz2
add json options sample
-rw-r--r--samples/scheduler/06_json_connector_options.html57
-rw-r--r--samples/scheduler/06_json_connector_options.php16
2 files changed, 73 insertions, 0 deletions
diff --git a/samples/scheduler/06_json_connector_options.html b/samples/scheduler/06_json_connector_options.html
new file mode 100644
index 0000000..d795a3b
--- /dev/null
+++ b/samples/scheduler/06_json_connector_options.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ <title></title>
+</head>
+ <script src="../dhtmlx/dhtmlxscheduler.js" type="text/javascript" charset="utf-8"></script>
+ <link rel="stylesheet" href="../dhtmlx/dhtmlxscheduler.css" type="text/css" title="no title" charset="utf-8">
+
+<style type="text/css" media="screen">
+ html, body{
+ margin:0px;
+ padding:0px;
+ height:100%;
+ overflow:hidden;
+ }
+</style>
+
+<script type="text/javascript" charset="utf-8">
+ function init() {
+ scheduler.config.multi_day = true;
+ scheduler.config.prevent_cache = true;
+ scheduler.config.xml_date="%Y-%m-%d %H:%i";
+ scheduler.init('scheduler_here',new Date(2010,2,1),"month");
+
+
+ scheduler.locale.labels.section_type = "Type";
+ scheduler.config.lightbox.sections = [
+ {name:"description", height:200, map_to:"text", type:"textarea" , focus:true},
+ {name:"type", height:21, map_to:"type", type:"select",
+ options:scheduler.serverList("type")},
+ {name:"time", height:72, type:"time", map_to:"auto"}
+ ];
+ scheduler.load("06_json_connector_options.php", "json");
+
+ var dp = new dataProcessor("06_json_connector_options.php");
+ dp.init(scheduler);
+ }
+</script>
+
+<body onload="init();">
+ <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>
+</body> \ No newline at end of file
diff --git a/samples/scheduler/06_json_connector_options.php b/samples/scheduler/06_json_connector_options.php
new file mode 100644
index 0000000..09c3d30
--- /dev/null
+++ b/samples/scheduler/06_json_connector_options.php
@@ -0,0 +1,16 @@
+<?php
+ include ('../../codebase/data_connector.php');
+ include ('../../codebase/scheduler_connector.php');
+ include ('../config.php');
+ $res=mysql_connect($mysql_server,$mysql_user,$mysql_pass);
+ mysql_select_db($mysql_db);
+
+ $list = new JSONOptionsConnector($res);
+ $list->render_table("types","typeid","typeid(value),name(label)");
+
+ $scheduler = new JSONSchedulerConnector($res);
+// $scheduler->enable_log("log.txt",true);
+
+ $scheduler->set_options("type", $list);
+ $scheduler->render_table("tevents","event_id","start_date,end_date,event_name,type");
+?> \ No newline at end of file