Hi, i have a incorrect XML popup error on Internet explorer only and can’t figure it out. On firefox and Chrome, no problem at all. Do you have any idea?
HTML file:
<!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="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
//$(document).ready(function(){
//$('.dhx_combo_input').bind('click', function() {
//alert("1");
//});
//});
</script>
<script src="../../codebase/dhtmlxscheduler.js" type="text/javascript" charset="utf-8"></script>
<script src="../../codebase/ext/dhtmlxscheduler_year_view.js"></script>
<script src='../../codebase/ext/dhtmlxscheduler_minical.js' type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="../../codebase/ext/dhtmlxscheduler_ext.css" type="text/css">
<link rel="stylesheet" href="../../codebase/dhtmlxscheduler.css" type="text/css">
<script src="../../codebase/ext/dhtmlxscheduler_editors.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="../../codebase/dhtmlxcombo/codebase/dhtmlxcombo.css">
<script src="../../codebase/dhtmlxcombo/codebase/dhtmlxcommon.js"></script>
<script src="../../codebase/dhtmlxcombo/codebase/dhtmlxcombo.js"></script>
<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 mycheckfun(rd)
{
//alert("hello");
//alert(rd);
}
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()
}
});
}
function init() {
///////////////////-------------added by sushma ////////////////
var sections=[
{key:'Business', label:"Business"},
{key:'Quote', label:"Quote"},
{key:'Personal', label:"Personal"}
];
scheduler.locale.labels.unit_tab = "Unit"
scheduler.locale.labels.section_custom="Select";
scheduler.config.multi_day = true;
scheduler.config.auto_end_date = true;
scheduler.config.event_duration = 60;
scheduler.config.first_hour=4;
scheduler.config.details_on_create=true;
scheduler.config.details_on_dblclick=true;
scheduler.config.xml_date="%Y-%m-%d %H:%i";
scheduler.config.prevent_cache = true;
/////////////////////////////////////////////////////////////
scheduler.config.lightbox.sections=[
{name:"session", height:20, map_to:"session_name", type:"textarea" , focus:true},
{name:"type", height:20, type:"select", options:sections, map_to:"type" },
{name:"subtype", height:20, type:"select", map_to:"session_type",options:scheduler.serverList("session_type") },
{name:"clients", map_to:"client_id", type:"combo", image_path: "../../codebase/dhtmlxcombo/codebase/imgs/", filtering: true, script_path: "php/complete.php", cache: true },
{name:"place", height:20, type:"textarea", map_to:"session_location" },
{name:"time", height:70, type:"calendar_time", map_to:"auto"},
{name:"notes", height:80, type:"textarea", map_to:"session_notes" }
]
scheduler.locale.labels.section_session="Event Name";
scheduler.locale.labels.section_notes="Notes";
scheduler.locale.labels.section_type="Type";
scheduler.locale.labels.section_subtype="Sub Type";
scheduler.locale.labels.section_place="Place";
scheduler.locale.labels.section_clients="Clients";
//top label of calendar
scheduler.templates.calendar_month = scheduler.date.date_to_str("%F %Y");
//week label of calendar
scheduler.templates.calendar_scale_date = scheduler.date.date_to_str("%D");
//date value on the event's details form
scheduler.templates.calendar_time = scheduler.date.date_to_str("%d-%m-%Y");
scheduler.templates.event_class = function(s,e,ev){
if (ev.type == 'Personal') return "Personal";
if (ev.type == 'Business') return "Business";
if (ev.type == 'Quote') return "Quote";
return "";
}
//scheduler.locale.labels.section_radiotype="Select";
//scheduler.config.details_on_create=true;
//scheduler.config.details_on_dblclick=true;
var d = new Date();
var curr_date = d.getDate();
var curr_month = d.getMonth();
var curr_year = d.getFullYear();
scheduler.config.xml_date="%Y-%m-%d %H:%i";
scheduler.init('scheduler_here',new Date(curr_year,curr_month,1),"year");
scheduler.setLoadMode("year");
scheduler.load("php/events.php");
var dp = new dataProcessor("php/events.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"> </div>
<div class="dhx_cal_next_button"> </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()"> </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 class="dhx_cal_tab" name="year_tab" style="right:12px;"></div>
</div>
<div class="dhx_cal_header">
</div>
<div class="dhx_cal_data">
</div>
</div>
</body>
And complete.php
<?php
header("Content-type:text/xml");
ini_set('max_execution_time', 600);
session_start();
include ('../../common/config.php');
print("<?xml version=\"1.0\"?>");
$link = mysql_pconnect($server, $user, $pass);
$db = mysql_select_db ($db_name);
if (!isset($_GET["pos"])) $_GET["pos"]=0;
$data = null;
if(isset($_GET["mask"]))
$data = getAutoCompleteData($_GET["mask"]);
else if(isset($_GET["id"]))
$data = getSelectedValue($_GET["id"]);
if($data)
renderOutput($data);
mysql_close($link);
function getAutoCompleteData($mask){
$sql = "SELECT DISTINCT full_name, id FROM clients Where user_id = '".$_SESSION['user_id']."' AND full_name like '".mysql_real_escape_string($mask)."%'";
$sql.= " Order By full_name LIMIT ". mysql_real_escape_string($_GET["pos"]).",20";
return mysql_query ($sql);
}
function getSelectedValue($id){
$sql = "SELECT full_name, id FROM clients Where user_id = '".$_SESSION['user_id']."' AND id = '".mysql_real_escape_string($id)."'";
return mysql_query ($sql);
}
function renderOutput($sqlResult){
if ( $_GET["pos"]==0)
print("<complete>");
else
print("<complete add='true'>");
if($sqlResult){
while($row=mysql_fetch_array($sqlResult)){
print("<option value=\"".$row["id"]."\">");
print($row["full_name"]);
print("</option>");
}
}else{
echo mysql_errno().": ".mysql_error()." at ".__LINE__." line in ".__FILE__." file<br>";
}
print("</complete>");
}
Thanks for your help
Seby