Sorry that was old code that is all taken out. Here is the code I am using.
function init() {
var user = $(’#cName’).val();
var sections=[
{key:1, label:“Men’s Cut”},
{key:2, label:“Color”},
{key:3, label:“Women’s Cut”},
{key:4, label:“Wax”},
{key:5, label:“Child Cut (under 3 yrs old)”},
{key:6, label:“Nails - Pedicure”},
{key:7, label:“Nails - Manicure”},
{key:8, label:“Other”}
];
if (!user.match('admin')){
scheduler.config.limit_start = new Date();
scheduler.config.limit_end = new Date(2012,12,31);
scheduler.config.limit_view = true;
// scheduler.config.drag_move = false;
} else {
scheduler.config.limit_start = new Date(2012, 1, 1);
scheduler.config.limit_end = new Date(2013,1,31);
scheduler.config.collision_limit = 2;
}
scheduler.config.multi_day = true;
scheduler.config.xml_date="%Y-%m-%d %H:%i";
scheduler.config.first_hour= 10;
scheduler.config.last_hour = 20;
scheduler.config.hour_date="%h:%i %A";
scheduler.config.wide_form = true;
scheduler.config.event_duration = 30;
scheduler.config.auto_end_date = true;
scheduler.config.limit_time_select = true;
scheduler.config.time_step = 30;
scheduler.locale.labels.section_description ="Client";
//scheduler.templates.week_date_class=function(date,today){
// return "custom_color";
// }
scheduler.config.details_on_dblclick=true;
scheduler.config.details_on_create=true;
scheduler.config.lightbox.sections=[
{name: "description", height: 20, map_to: "clientName", type: "textarea"},
{name: "custom2", height: 20, map_to: "phone", type: "textarea"},
{name:"custom", height:33, type:"select", options:sections, map_to:"section_id", focus:true }, {name:"time", height:72, type:"time", map_to:"start_time"}
];
scheduler.templates.lightbox_header = function(start, end, event){
return event.text;
}
scheduler.locale.labels.section_custom="Service";
scheduler.locale.labels.section_custom2="Phone";
scheduler.blockTime(0, "fullday");
scheduler.blockTime(1, "fullday");
scheduler.attachEvent("onEventCollision", function (event_id){
if (!user.match('admin'))
alert("Sorry, I'm Booked at that Time");
else
alert("A Client is already booked at that time");
deleteEvent(scheduler.getEvent(event_id));
});
scheduler.init('scheduler_here',new Date(),"month");
scheduler.setLoadMode("month");
// Loads data from a configured database conection.
scheduler.load("data.php");
var dp = new dataProcessor("data.php");
dp.init(scheduler);
}; // end init()