Events Calendar
Loading Data...
Error loading data. Please try again.
';
// Display of tooltip options start here //
var config = v[13];
if(config.calendar_show_image != "0" && v[12] != ""){
image_tag = '

';
image_tag = image_tag.replace('image_name',v[12]);
// '+v[12]+'
str += image_tag;
}
if(config.calendar_show_date != "0" && v[14] != ""){
str += '
Date: '+v[14]+'';
}
if(config.calendar_show_time != "0" && v[22] != ""){
str += '
Time: '+v[22]+'';
}
if(config.calendar_show_location != "0" && v[18] != ""){
str += '
Location: '+v[18]+'';
}
if(config.calendar_show_moderator != "0" && v[20] != ""){
str += '
Moderator: '+v[20]+'';
}
if(config.calendar_show_price != "0" && v[15] != ""){
str += '
Price: '+v[15]+'';
}
if(config.calendar_show_capacity != "0" && v[16] != ""){
str += '
Capacity: '+v[16]+'';
}
if(config.calendar_show_registered != "0" && v[17] != ""){
str += '
Registered: '+v[17]+'';
}
if((config.calendar_show_available_spots == "1" ) && v[19] != ""){
str += '
Available: '+v[19]+'';
}
// Display of tooltip options end here //
return str;
}});
var cal_div = DTjQuery('#gridcontainer').find("#event_"+v[0]).parent(':visible').parent().css('backgroundColor',v[5]).css('backgroundColor',v[5]).parent().css('backgroundColor',v[5]).parent().css('backgroundColor',v[5])
opts = DTjQuery("#gridcontainer").BcalGetOp();
if(opts.view == 'month') {
cal_div.css('color',v[5])
}
})
switch(type)
{
case 1:
DTjQuery("#loadingpannel").hide();
DTjQuery("#txtdatetimeshow").text(p.datestrshow);
break;
case 2:
case 3:
case 4:
DTjQuery("#loadingpannel").html("Success!");
window.setTimeout(function(){ DTjQuery("#loadingpannel").hide();},2000);
DTjQuery("#txtdatetimeshow").text(p.datestrshow);
break;
}
}
function cal_onerror(type,data)
{
//console.log(type);
//console.log(data);
DTjQuery("#errorpannel").show();
}
function Edit(data)
{
var eurl="edit.php?id={0}&start={2}&end={3}&isallday={4}&title={1}";
if(data)
{
var url = StrFormat(eurl,data);
OpenModelWindow(url,{ width: 600, height: 400, caption:"Manage The Calendar",onclose:function(){
DTjQuery("#gridcontainer").reload();
}});
}
}
function View(data)
{
var str = "";
if(data[10] != ""){
window.location = data[10];
}
DTjQuery.each(data, function(i, item){
str += "[" + i + "]: " + item + "\n";
});
//hiAlert(str);
// DTjQuery.alerts.alert(str);
}
function Delete(data,callback)
{
DTjQuery.alerts.okButton="Ok";
DTjQuery.alerts.cancelButton="Cancel";
hiConfirm("Are You Sure to Delete this Event", 'Confirm',function(r){ r && callback(0);});
}
function wtd(p)
{
if (p && p.datestrshow) {
DTjQuery("#txtdatetimeshow").text(p.datestrshow);
}
DTjQuery("#caltoolbar div.fcurrent").each(function() {
DTjQuery(this).removeClass("fcurrent");
})
DTjQuery("#showdaybtn").addClass("fcurrent");
}
//to show day view
DTjQuery("#showdaybtn").click(function(e) {
//document.location.href="#day";
DTjQuery("#caltoolbar div.fcurrent").each(function() {
DTjQuery(this).removeClass("fcurrent");
})
DTjQuery(this).addClass("fcurrent");
var p = DTjQuery("#gridcontainer").swtichView("day").BcalGetOp();
DTjQuery(".add_date").each(function(k,v){
DTjQuery.data(this,'calview','day');
})
if (p && p.datestrshow) {
DTjQuery("#txtdatetimeshow").text(p.datestrshow);
}
});
//to show week view
DTjQuery("#showweekbtn").click(function(e) {
//document.location.href="#week";
DTjQuery("#caltoolbar div.fcurrent").each(function() {
DTjQuery(this).removeClass("fcurrent");
})
DTjQuery(this).addClass("fcurrent");
var p = DTjQuery("#gridcontainer").swtichView("week").BcalGetOp();
DTjQuery(".add_date").each(function(k,v){
DTjQuery.data(this,'calview','week');
})
if (p && p.datestrshow) {
DTjQuery("#txtdatetimeshow").text(p.datestrshow);
}
});
//to show month view
DTjQuery("#showmonthbtn").click(function(e) {
//document.location.href="#month";
DTjQuery("#caltoolbar div.fcurrent").each(function() {
DTjQuery(this).removeClass("fcurrent");
})
DTjQuery(this).addClass("fcurrent");
var p = DTjQuery("#gridcontainer").swtichView("month").BcalGetOp();
DTjQuery(".add_date").each(function(k,v){
DTjQuery.data(this,'calview','month');
})
if (p && p.datestrshow) {
DTjQuery("#txtdatetimeshow").text(p.datestrshow);
}
});
DTjQuery("#showreflashbtn").click(function(e){
DTjQuery("#gridcontainer").reload();
});
//Add a new event
DTjQuery("#faddbtn").click(function(e) {
var url ="edit.php";
OpenModelWindow(url,{ width: 500, height: 400, caption: "Create New Calendar"});
});
//go to today
DTjQuery("#showtodaybtn").click(function(e) {
var p = DTjQuery("#gridcontainer").gotoDate().BcalGetOp();
if (p && p.datestrshow) {
DTjQuery("#txtdatetimeshow").text(p.datestrshow);
}
});
//previous date range
DTjQuery("#sfprevbtn").click(function(e) {
var p = DTjQuery("#gridcontainer").previousRange().BcalGetOp();
if (p && p.datestrshow) {
DTjQuery(".add_date").each(function(k,v){
var link = DTjQuery(this).attr('attr');
link += "&showday="+p.showday.format("m/d/yyyy");
DTjQuery(this).attr('href',link);
DTjQuery.data(this,'showday',p.showday.format("m/d/yyyy"));
})
DTjQuery("#txtdatetimeshow").text(p.datestrshow);
}
});
//next date range
DTjQuery("#sfnextbtn").click(function(e) {
var p = DTjQuery("#gridcontainer").nextRange().BcalGetOp();
if (p && p.datestrshow) {
DTjQuery(".add_date").each(function(k,v){
var link = DTjQuery(this).attr('attr');
link += "&showday="+p.showday.format("m/d/yyyy");
DTjQuery.data(this,'showday',p.showday.format("m/d/yyyy"));
DTjQuery(this).attr('href',link);
})
DTjQuery("#txtdatetimeshow").text(p.datestrshow);
}
});
DTjQuery(".add_date").click(function(){
var showday = DTjQuery.data(this, "showday");
var calview = DTjQuery.data(this, "calview");
//console.log(calview);
var link = DTjQuery(this).attr('attr');
if(showday != undefined){
link += "&showday="+showday;
}
if(calview != undefined){
link += "&calview="+calview;
}
DTjQuery(this).attr('href',link);
return true;
});
});