3

I am new with dhtmlxscheduler. I have created some demo schedulers. As everyone knows, we can make custom lightbox and send data accordingly, however, what I really want to know is how to send a default variable's data to database from php. Well, I know it sounds messy. Let me make it clear. Below is my scheduler.html:

<!DOCTYPE html>
<head>
    <meta charset="UTF-8">
    <title>How to start</title>
    <link rel="stylesheet" href="dhtmlxScheduler/codebase/dhtmlxscheduler.css" type="text/css">
    <style type="text/css" media="screen">
        html, body{
            margin:0px;
            padding:0px;
            height:100%;
            overflow:hidden;
        }
    </style>
</head>
<script>
    function init() {

        scheduler.config.multi_day = true;
        scheduler.config.xml_date="%Y-%m-%d %H:%i";
        var d = new Date();
        var m = d.getMonth();
        var y = d.getFullYear();
        scheduler.config.limit_start = new Date(y,m,1);
        scheduler.config.limit_end = new Date (2100,0,1);
        scheduler.init('scheduler_here', new Date(), "month");
        //scheduler.load("dhtmlxScheduler/demo_php/data.php");





        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:[
                {key:"Call", label:"Call"},
                {key:"Appointment", label:"Appointment"},
                {key:"Both", label:"Both"}
            ]},
            {name:"time", height:72, type:"time", map_to:"auto"},
        ];
        scheduler.load("dhtmlxScheduler/samples/01_initialization_loading/data/types.php", function(){
            scheduler.showLightbox(2);
        });

        var dp = new dataProcessor("dhtmlxScheduler/samples/01_initialization_loading/data/types.php");
        dp.enableUTFencoding(true);
        dp.init(scheduler);

     
       
    function show_minical(){
        if (scheduler.isCalendarVisible())
            scheduler.destroyCalendar();
        else
            scheduler.renderCalendar({
                position:"dhx_minical_icon",
                date:scheduler._date,
                navigation:true,
                handler:function(date,calendar){
                    scheduler.setCurrentView(date);
                    scheduler.destroyCalendar()
                }
            });
    }
</script>
<body onload="init();return false;">
<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_minical_icon" id="dhx_minical_icon" onclick="show_minical()">&nbsp;</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>


<script src="dhtmlxScheduler/codebase/dhtmlxscheduler.js" type="text/javascript"></script>
<script src="dhtmlxScheduler/codebase/ext/dhtmlxscheduler_limit.js" type="text/javascript"></script>
<script src="dhtmlxScheduler/codebase/ext/dhtmlxscheduler_minical.js" type="text/javascript"></script>
<script src="dhtmlxScheduler/codebase/ext/dhtmlxscheduler_collision.js"></script>
</body>
</html>

And this is my types.php:

<?php
require_once('../../common/connector/scheduler_connector.php');
include('../../common/config.php');


$doctor_id=1;


$scheduler = new schedulerConnector($res, $dbtype);

$scheduler->render_table("tevents", "event_id","start_date,end_date,event_name,type","extra");

?>

What I actually want to do is to insert the value of $doctor_id to the "extra" column of "tevents" table. What am I supposed to do ?

Thanks in advance !!!

Plabon Dutta
  • 4,101
  • 3
  • 22
  • 29

0 Answers0