Commit bf3b5c45 authored by Clément Damiens's avatar Clément Damiens
Browse files

shopping cart && shopping cart && shoppingCart & shoppingCart

parent acaeaa5d
function addToShoppingCart(id, type, subType, ranges){
incCart=true;
if(typeof userId != "undefined" && userId != ""){
params=new Object;
params.name=element.name,
params.price=element.price
params.countQuantity=1;
if(typeof element.imgProfil != "undefined")
params.imgProfil=element.imgProfil;
if(typeof element.description != "undefined")
params.description=element.description;
if(typeof element.capacity != "undefined")
params.capacity=element.capacity;
if(notNull(subType))
params.type=subType;
if(typeof shoppingCart[type] == "undefined")
shoppingCart[type]=new Object;
if(type=="services" ){
if(typeof shoppingCart[type][subType]=="undefined")
shoppingCart[type][subType]=new Object;
if(typeof shoppingCart[type][subType][id]=="undefined")
shoppingCart[type][subType][id]=params;
else{
shoppingCart[type][subType][id]["countQuantity"]++;
incCart=false;
}
if(typeof ranges != "undefined" && notNull(ranges)){
if(typeof shoppingCart[type][subType][id]["reservations"] == "undefined")
shoppingCart[type][subType][id]["reservations"]=new Object;
if(typeof shoppingCart[type][subType][id]["reservations"][ranges.date] == "undefined"){
shoppingCart[type][subType][id]["reservations"][ranges.date] = {"countQuantity":1};
}else{
shoppingCart[type][subType][id]["reservations"][ranges.date]["countQuantity"]++;
incCart=false;
}
if(typeof ranges.hours != "undefined"){
ranges.hours.countQuantity=1;
if(typeof shoppingCart[type][subType][id]["reservations"][ranges.date]["hours"] == "undefined")
shoppingCart[type][subType][id]["reservations"][ranges.date]["hours"]=[];
if(jQuery.isEmptyObject(shoppingCart[type][subType][id]["reservations"][ranges.date]["hours"])){
shoppingCart[type][subType][id]["reservations"][ranges.date]["hours"].push(ranges.hours);
}else{
hoursInArray=false;
$.each(shoppingCart[type][subType][id]["reservations"][ranges.date]["hours"], function(e,v){
if(v.start==ranges.hours.start && v.end==ranges.hours.end){
shoppingCart[type][subType][id]["reservations"][ranges.date]["hours"][e]["countQuantity"]++;
hoursInArray=true;
}
});
if(!hoursInArray)
shoppingCart[type][subType][id]["reservations"][ranges.date]["hours"].push(ranges.hours);
}
}
}
}else{
if(typeof shoppingCart[type][id] == "undefined"){
shoppingCart[type][id]={};
shoppingCart[type][id]=params;
}else{
shoppingCart[type][id].countQuantity++;
incCart=false;
}
}
if(incCart)
countShoppingCart(true);
//console.log("element",mapElements[id]);
}else{
$('#modalLogin').modal("show");
}
}
function removeFromShoppingCart(id, type, deleteAll, subType, ranges){
incCart=false;
if(typeof userId != "undefined" && userId != ""){
if(type=="services" ){
if(shoppingCart[type][subType][id]["countQuantity"]==1 || (deleteAll && ranges==null)){
delete shoppingCart[type][subType][id];
incCart=true;
}else{
if(!deleteAll)
shoppingCart[type][subType][id]["countQuantity"]--;
if(typeof ranges != "undefined" && notNull(ranges)){
console.log(ranges);
if(deleteAll && typeof ranges.hours == "undefined"){
removeQuantityDate=shoppingCart[type][subType][id]["reservations"][ranges.date]["countQuantity"];
delete shoppingCart[type][subType][id]["reservations"][ranges.date];
}else{
if(shoppingCart[type][subType][id]["reservations"][ranges.date]["countQuantity"]==1){
delete shoppingCart[type][subType][id]["reservations"][ranges.date];
}else{
if(!deleteAll)
shoppingCart[type][subType][id]["reservations"][ranges.date]["countQuantity"]--;
if(typeof ranges.hours != "undefined"){
$.each(shoppingCart[type][subType][id]["reservations"][ranges.date]["hours"], function(e,v){
if(typeof v != "undefined"){
if(v.start==ranges.hours.start && v.end==ranges.hours.end){
if(deleteAll){
removeQuantityHours=shoppingCart[type][subType][id]["reservations"][ranges.date]["hours"][e]["countQuantity"];
shoppingCart[type][subType][id]["reservations"][ranges.date]["hours"].splice(e,1);
}else{
if(v.countQuantity==1){
shoppingCart[type][subType][id]["reservations"][ranges.date]["hours"].splic(e,1);
}
else{
shoppingCart[type][subType][id]["reservations"][ranges.date]["hours"][e]["countQuantity"]--;
}
}
}
}
});
if(typeof removeQuantityHours != "undefined"){
shoppingCart[type][subType][id]["reservations"][ranges.date]["countQuantity"]=shoppingCart[type][subType][id]["reservations"][ranges.date]["countQuantity"]-removeQuantityHours;
shoppingCart[type][subType][id]["countQuantity"]=shoppingCart[type][subType][id]["countQuantity"]-removeQuantityHours;
if(shoppingCart[type][subType][id]["reservations"][ranges.date]["countQuantity"]==0){
delete shoppingCart[type][subType][id]["reservations"][ranges.date];
}
if(shoppingCart[type][subType][id]["countQuantity"]==0){
delete shoppingCart[type][subType][id];
incCart=true;
}
}
}
}
}
if(typeof removeQuantityDate != "undefined"){
shoppingCart[type][subType][id]["countQuantity"]=shoppingCart[type][subType][id]["countQuantity"]-removeQuantityDate;
if(shoppingCart[type][subType][id]["countQuantity"]==0){
delete shoppingCart[type][subType][id];
incCart=true;
}
}
}
}
}else{
if(!deleteAll){
delete shoppingCart[type][id];
incCart=true;
}else{
if(shoppingCart[type][id].countQuantity==1){
incCart=true;
delete shoppingCart[type][id];
}else{
shoppingCart[type][id].countQuantity--;
}
}
}
if(incCart)
countShoppingCart(false);
}else{
$('#modalLogin').modal("show");
}
}
function countShoppingCart(pos){
//total=0;
//$.each(shoppingCart, function(k, v){
// total+=v.length;
//});
if(pos != "init"){
if(pos)
shoppingCart.countQuantity++;
else
shoppingCart.countQuantity--;
}
if(shoppingCart.countQuantity > 0){
$(".shoppingCart-count").html(shoppingCart.countQuantity);
$('.shoppingCart-count').removeClass('hide');
$('.shoppingCart-count').addClass('animated bounceIn');
$('.shoppingCart-count').addClass('badge-success');
$('.shoppingCart-count').removeClass('badge-tranparent');
}else{
$('.shoppingCart-count').addClass('hide');
$('.shoppingCart-count').removeClass('badge-success');
$('.shoppingCart-count').addClass('badge-tranparent');
}
}
\ No newline at end of file
......@@ -13,6 +13,7 @@ on garde les librairies specifique au module dans le module
'/js/sig/localisationHtml5.js',
'/js/floopDrawerRight.js',
'/js/sig/geoloc.js',
'js/default/shoppingCart.js',
//'/js/default/formInMap.js',
//'/js/default/formInMapOld.js',
'/js/default/globalsearch.js',
......
......@@ -165,136 +165,5 @@ HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesTheme, Yii::app()->requ
}
});
function addToShoppingCart(id, type, ranges){
incCart=true;
if(typeof userId != "undefined" && userId != ""){
params=new Object;
params.name=element.name,
params.price=element.price
params.countQuantity=1;
if(typeof element.imgProfil != "undefined")
params.imgProfil=element.imgProfil;
if(typeof element.description != "undefined")
params.description=element.description;
if(typeof shoppingCart[type] == "undefined")
shoppingCart[type]=new Object;
if(type=="services" ){
if(typeof shoppingCart[type][element.type]=="undefined")
shoppingCart[type][element.type]=new Object;
if(typeof shoppingCart[type][element.type][id]=="undefined")
shoppingCart[type][element.type][id]=params;
else{
shoppingCart[type][element.type][id]["countQuantity"]++;
incCart=false;
}
if(typeof ranges != "undefined" && notNull(ranges)){
if(typeof shoppingCart[type][element.type][id]["reservations"] == "undefined")
shoppingCart[type][element.type][id]["reservations"]=new Object;
if(typeof shoppingCart[type][element.type][id]["reservations"][ranges.date] == "undefined"){
shoppingCart[type][element.type][id]["reservations"][ranges.date] = {"countQuantity":1};
}else{
shoppingCart[type][element.type][id]["reservations"][ranges.date]["countQuantity"]++;
incCart=false;
}
if(typeof ranges.hours != "undefined"){
ranges.hours.countQuantity=1;
if(typeof shoppingCart[type][element.type][id]["reservations"][ranges.date]["hours"] == "undefined")
shoppingCart[type][element.type][id]["reservations"][ranges.date]["hours"]=[];
if(jQuery.isEmptyObject(shoppingCart[type][element.type][id]["reservations"][ranges.date]["hours"])){
shoppingCart[type][element.type][id]["reservations"][ranges.date]["hours"].push(ranges.hours);
}else{
hoursInArray=false;
$.each(shoppingCart[type][element.type][id]["reservations"][ranges.date]["hours"], function(e,v){
if(v.start==ranges.hours.start && v.end==ranges.hours.end){
shoppingCart[type][element.type][id]["reservations"][ranges.date]["hours"][e]["countQuantity"]++;
hoursInArray=true;
}
});
if(!hoursInArray)
shoppingCart[type][element.type][id]["reservations"][ranges.date]["hours"].push(ranges.hours);
}
}
}
}else{
if(typeof shoppingCart[type][id] == "undefined"){
shoppingCart[type][id]={};
shoppingCart[type][id]=params;
}else{
shoppingCart[type][id].countQuantity++;
incCart=false;
}
}
if(incCart)
countShoppingCart(true);
//console.log("element",mapElements[id]);
}else{
$('#modalLogin').modal("show");
}
}
function removeFromShoppingCart(id, type, ranges){
incCart=false;
if(typeof userId != "undefined" && userId != ""){
if(type=="services" ){
if(shoppingCart[type][element.type][id]["countQuantity"]==1){
delete shoppingCart[type][element.type][id];
incCart=true;
}else{
shoppingCart[type][element.type][id]["countQuantity"]--;
if(typeof ranges != "undefined" && notNull(ranges)){
if(shoppingCart[type][element.type][id]["reservations"][ranges.date]["countQuantity"]==1){
delete shoppingCart[type][element.type][id]["reservations"][ranges.date];
}else{
shoppingCart[type][element.type][id]["reservations"][ranges.date]["countQuantity"]--;
if(typeof ranges.hours != "undefined"){
$.each(shoppingCart[type][element.type][id]["reservations"][ranges.date]["hours"], function(e,v){
if(v.start==ranges.hours.start && v.end==ranges.hours.end){
if(v.countQuantity==1)
delete shoppingCart[type][element.type][id]["reservations"][ranges.date]["hours"][e];
else
shoppingCart[type][element.type][id]["reservations"][ranges.date]["hours"][e]["countQuantity"]--;
}
});
}
}
}
}
}else{
if(shoppingCart[type][id].countQuantity==1){
incCart=true;
delete shoppingCart[type][id];
}else{
shoppingCart[type][id].countQuantity--;
}
}
if(incCart)
countShoppingCart(false);
}else{
$('#modalLogin').modal("show");
}
}
function countShoppingCart(pos){
//total=0;
//$.each(shoppingCart, function(k, v){
// total+=v.length;
//});
if(pos)
shoppingCart.countQuantity++;
else
shoppingCart.countQuantity--;
if(shoppingCart.countQuantity > 0){
$(".shoppingCart-count").html(shoppingCart.countQuantity);
$('.shoppingCart-count').removeClass('hide');
$('.shoppingCart-count').addClass('animated bounceIn');
$('.shoppingCart-count').addClass('badge-success');
$('.shoppingCart-count').removeClass('badge-tranparent');
}else{
$('.shoppingCart-count').addClass('hide');
$('.shoppingCart-count').removeClass('badge-success');
$('.shoppingCart-count').addClass('badge-tranparent');
}
}
</script>
\ No newline at end of file
......@@ -48,7 +48,7 @@
.contentProduct .showDetail{
cursor: pointer;
}
.contentProduct .showDetail.rotate{
.contentProduct .showDetail > i.rotate{
transform: rotate(180deg);
-ms-transform: rotate(180deg);
-webkit-transform: rotate(180deg);
......@@ -60,6 +60,10 @@
.contentHoursSession{
border-top: 1px solid rgba(0,0,0,0.1);
}
.contentHoursSession h4{
line-height: 21px;
font-size: 16px;
}
</style>
<div class="headerTitleStanalone"></div>
<div class="col-md-10 col-md-offset-1 contentOnePage">
......@@ -68,6 +72,7 @@
</div>
<script type="text/javascript">
var totalCart=0;
var openDetails=[];
jQuery(document).ready(function() {
//if(typeof params.name != "undefined" && params.name != "")
str = "<div class='col-md-6 no-padding'>"+
......@@ -151,19 +156,38 @@
function getViewItem(key, data, type){
itemId=key;
itemType=type;
subType=null;
if(data.type != "undefined")
subType=data.type;
if(typeof data.reservations =="undefined"){
classRemove="";
classAdd="";
if(data.countQuantity==1)
classRemove="hide";
if(typeof data.capacity != "undefined" && data.countQuantity>=data.capacity)
classAdd="hide";
incQtt="<a href='javascript:;' class='letter-orange remove-session "+classRemove+"' onclick='removeInCart(\""+itemId+"\", \""+itemType+"\",false);'>"
+"<i class='fa fa-minus'></i></a>"
+'<span class="eventCountItem margin-left-5 margin-right-5">'
+'<i class="fa fa-shopping-cart"></i>'
+'<span class="inc-session topbar-badge badge animated bounceIn badge-transparent badge-success">'+data.countQuantity+'</span>'
+'</span>'
+"<a href='javascript:;' class='letter-orange add-session "+classAdd+"' onclick='addInCart(\""+itemId+"\", \""+itemType+"\", null);'><i class='fa fa-plus'></i></a>";
}else
incQtt="<span class='showDetail showDetail"+key+"' data-value='"+key+"''><i class='fa fa-2x fa-angle-down'></i></span>";
itemHtml="<div class='col-md-12 contentProduct contentProduct"+itemId+" text-left'>"+
"<div class='col-md-1'>"+data.imgProfil+"</div>"+
"<div class='col-md-5'>"+
"<h4 class='text-dark'>"+data.name+"</h4><br>"+
"<span>Quantity booked:"+data.countQuantity+"</span><br>";
if(typeof data.description != "undefined" && data.description != "")
if(typeof data.description != "undefined" && data.description != "")
itemHtml += "<span>"+data.description+"</span><br>";
itemHtml += "<a href='javascript:;' class='letter-blue' onclick='alert(\"What's the quoi???\")'> Save / Update</a>"+
"</div>"+
"<div class='col-md-2 text-center'><span>"+(data.price*data.countQuantity)+"</span></div>"+
"<div class='col-md-1 text-center'><span class='showDetail'><i class='fa fa-2x fa-angle-down'></i></span></div>"+
"<div class='col-md-1 text-center no-padding'>"+incQtt+"</div>"+
"<div class='col-md-2 text-center'><span>"+(data.price*data.countQuantity)+"</span></div>"+
"<div class='col-md-1 text-center'><span> <a href='javascript:;' class='text-red' onclick='removeInCart(\""+itemId+"\", \""+itemType+"\");'><i class='fa fa-trash'></i></a></span></div>";
"<div class='col-md-1 text-center'><span> <a href='javascript:;' class='text-red' onclick='removeInCart(\""+itemId+"\", \""+itemType+"\",true,\""+subType+"\");'><i class='fa fa-trash'></i></a></span></div>";
if(typeof data.reservations != "undefined"){
itemHtml += "<div class='col-md-12 col-sm-12 col-xs-12 dateHoursDetail'>";
// countDate=Object.keys(data.reservations).length;
......@@ -173,10 +197,26 @@
s=(value.countQuantity > 1) ? "s" : "";
itemHtml += "<div class='col-md-12 col-sm-12 col-xs-12 bookDate"+date+" shadow2 margin-bottom-10'>"+
"<div class='col-md-12 col-sm-12 col-xs-12 dateHeader'>"+
"<h4 class='pull-left margin-bottom-5 no-margin margin-right-10'><i class='fa fa-calendar'></i> "+date+"</h4>"+
"<span class='pull-left'>"+value.countQuantity+" reservation"+s+"</span>"+
"<h4 class='pull-left margin-bottom-5 no-margin col-md-5 col-sm-5 col-xs-5 no-padding'><i class='fa fa-calendar'></i> "+date+"</h4>";
if(typeof value.hours =="undefined"){
classRemove="";
classAdd="";
if(value.countQuantity==1)
classRemove="hide";
if(value.countQuantity>=data.capacity)
classAdd="hide";
incQtt="<a href='javascript:;' class='letter-orange remove-session "+classRemove+"' onclick='removeInCart(\""+itemId+"\", \""+itemType+"\",null,\""+subType+"\",\""+date+"\");'>"
+"<i class='fa fa-minus'></i></a>"
+'<span class="eventCountItem margin-left-5 margin-right-5">'
+'<i class="fa fa-shopping-cart"></i>'
+'<span class="inc-session topbar-badge badge animated bounceIn badge-transparent badge-success">'+value.countQuantity+'</span>'
+'</span>'
+"<a href='javascript:;' class='letter-orange add-session "+classAdd+"' onclick='addInCart(\""+itemId+"\", \""+itemType+"\",\""+subType+"\",\""+date+"\");'><i class='fa fa-plus'></i></a>";
}else
incQtt=value.countQuantity+" reservation"+s;
itemHtml += "<span class='pull-left text-center col-md-3 col-sm-3 col-xs-3'>"+incQtt+"</span>"+
"<div class='pull-right'>"+
"<a href='javascript:;' class='text-red' onclick='removeInCart(\""+itemId+"\", \""+itemType+"\",\""+date+"\");'>"+
"<a href='javascript:;' class='text-red' onclick='removeInCart(\""+itemId+"\", \""+itemType+"\",true,\""+subType+"\",\""+date+"\");'>"+
"<i class='fa fa-trash'></i> Remove this date</a>"+
"</div>"+
"</div>";
......@@ -187,12 +227,26 @@
//itemHtml += "<span>"+countSession+" session"+s+"</span><br/>";
$.each(value.hours, function(key, hours){
s=(hours.countQuantity > 1) ? "s" : "";
itemHtml += "<div class='col-md-12 col-sm-12 col-xs-12 margin-bottom-10 padding-5 contentHoursSession'>"+
"<h4 class='col-md-4 col-sm-4 col-xs-3 no-padding no-margin'><i class='fa fa-times'></i> "+hours.start+" - "+hours.end+"</h4>"+
"<span class='col-md-5 col-sm-5 col-xs-6'>"+hours.countQuantity+" reservation"+s+" on this session</span>"+
classRemove="";
classAdd="";
if(hours.countQuantity==1)
classRemove="hide";
if(hours.countQuantity>=data.capacity)
classAdd="hide";
incQtt="<a href='javascript:;' class='letter-orange "+classRemove+"' onclick='removeInCart(\""+itemId+"\", \""+itemType+"\",null,\""+subType+"\",\""+date+"\",\""+hours.start+"\",\""+hours.end+"\");'>"
+"<i class='fa fa-minus'></i></a>"
+'<span class="eventCountItem margin-left-5 margin-right-5">'
+'<i class="fa fa-shopping-cart"></i>'
+'<span class="inc-session topbar-badge badge animated bounceIn badge-transparent badge-success">'+hours.countQuantity+'</span>'
+'</span>'
+"<a href='javascript:;' class='letter-orange "+classAdd+"' onclick='addInCart(\""+itemId+"\", \""+itemType+"\",\""+subType+"\",\""+date+"\",\""+hours.start+"\",\""+hours.end+"\");'><i class='fa fa-plus'></i></a>";
itemHtml += "<div class='col-md-12 col-sm-12 col-xs-12 margin-bottom-5 padding-5 contentHoursSession'>"+
"<h4 class='col-md-4 col-sm-4 col-xs-3 no-padding no-margin'><i class='fa fa-clock-o'></i> "+hours.start+" - "+hours.end+"</h4>"+
"<span class='col-md-5 col-sm-5 col-xs-6 text-center'>"+incQtt+"</span>"+
"<div class='pull-right'>"+
"<a href='javascript:;' class='text-red' onclick='removeInCart(\""+itemId+"\", \""+itemType+"\",\""+date+"\",\""+hours.start+"\",\""+hours.end+"\");'>"+
"<i class='fa fa-trash'></i>"+
"<a href='javascript:;' class='text-red' onclick='removeInCart(\""+itemId+"\", \""+itemType+"\",true,\""+subType+"\",\""+date+"\",\""+hours.start+"\",\""+hours.end+"\");'>"+
"<i class='fa fa-times'></i>"+
"</a>"+
"</div>"+
"</div>";
......@@ -206,7 +260,18 @@
return itemHtml;
}
function removeInCart(id,type,date,start,end){
function removeInCart(id, type, deleteAll, subType, date, start, end){
ranges=null;
if(notNull(date)){
ranges=new Object;
ranges.date=date;
if(notNull(start))
ranges.hours={start: start , end: end};
}
removeFromShoppingCart(id, type, deleteAll, subType, ranges);
reloadViewCart();
}
function addInCart(id, type, subType, date, start, end){
ranges=null;
if(notNull(date)){
ranges=new Object;
......@@ -214,24 +279,36 @@
if(notNull(start))
ranges.hours={start: start , end: end};
}
removeFromShoppingCart(id, type, ranges);
addToShoppingCart(id, type, subType, ranges);
reloadViewCart();
}
function reloadViewCart(){
totalCart=0;
if(shoppingCart.countQuantity > 0 )
html=generateCartView();
else
html=generateEmptyCartView();
$(".contentCart").html(html);
bindCartEvent();
initBtnLink();
if(openDetails.length > 0){
$.each(openDetails,function(i,v){
$(".showDetail"+v).trigger("click");
});
}
}
function bindCartEvent(){
$(".showDetail").click(function(){
if($(this).hasClass("rotate")){
$(this).removeClass("rotate");
$(".showDetail").off().on("click",function(){
if($(this).find("i").hasClass("rotate")){
i = openDetails.indexOf($(this).data("value"));
openDetails.splice(i, 1);
$(this).find("i").removeClass("rotate");
$(this).parents().eq(1).find(".dateHoursDetail").fadeOut("slow");
}else{
$(this).addClass("rotate");
if(openDetails.indexOf($(this).data("value")) < 0)
openDetails.push($(this).data("value"));
$(this).find("i").addClass("rotate");
$(this).parents().eq(1).find(".dateHoursDetail").fadeIn("slow");
}
});
......
......@@ -94,6 +94,9 @@
var element=<?php echo json_encode($element); ?>;
var itemType="<?php echo $type; ?>";
var itemId=element._id.$id;
var subType=null;
if(typeof element.type !="undefined")
subType=element.type;
var templateColor = ["#93be3d", "#eb4124", "#0073b0", "#ed553b", "#df01a5", "#b45f04", "#2e2e2e"];
var dateToShow, calendar, $eventDetail, eventClass, eventCategory;
var widgetNotes = $('#notes .e-slider'), sliderNotes = $('#readNote .e-slider'), $note;
......@@ -252,7 +255,11 @@ function showCalendar() {
hoursRender
+ 'Disponible: <span class="inc-capacity">' + event.capacity + '</span><br/>'
+'<a href="javascript:;" class="letter-orange remove-session hide"><i class="fa fa-minus"></i></a>'
+'<span class="inc-session"> '+event.quantity+' </span>'
+'<span class="eventCountItem margin-left-5 margin-right-5">'
+'<i class="fa fa-shopping-cart"></i>'
+'<span class="inc-session hide topbar-badge badge animated bounceIn badge-transparent badge-success">1</span>'
+'</span>'
//+'<span class="inc-session"> '+event.quantity+' </span>'
+'<a href="javascript:;" class="letter-orange add-session"><i class="fa fa-plus"></i></a>';
element.find(".fc-content").html(new_description);
element.find(".remove-session").on('click', function (e) {
......@@ -261,34 +268,54 @@ function showCalendar() {
event.quantity--;
if(event.capacity > 0)
element.find(".add-session").removeClass("hide");
if(event.quantity === 0)
element.find(".remove-session").addClass("hide");
element.find(".inc-session").text(event.quantity);
if(event.quantity === 0){
element.find('.remove-session').addClass('hide');
element.find('.inc-session').removeClass('badge-success');
element.find('.inc-session').addClass('badge-tranparent');
element.find(".inc-session").addClass("hide");
}else{
element.find(".inc-session").html(event.quantity);
element.find('.inc-session').removeClass('hide');
element.find('.inc-session').addClass('animated bounceIn');
element.find('.inc-session').addClass('badge-success');
element.find('.inc-session').removeClass('badge-tranparent');
}
//element.find(".inc-session").text(event.quantity);
element.find(".inc-capacity").text(event.capacity);
var ranges = new Object;
ranges.date=bookDate;
if(typeof event.allDay == "undefined" || !event.allDay)
ranges.hours={start: event.startTime , end: event.endTime};