<% _.each( rows, function( row ){ %> <% var programPath = row.register_url ?? row.field_register_url.value; var shopamine_url = row.shopamine_url ?? row.field_shopamine_url.value; if(row.sao_type == 1 && row.info_for_group_required == 1 && (row.max_tickets != 0 || row.max_tickets != 1)) { if(row.is_paid == true && row.register_url){ programPath = programPath; } else if(row.max_tickets > 1 && row.info_for_group_required == 1 && row.register_url){ programPath = programPath; }else{ programPath = shopamine_url; } } %>
 <% var recur_check = ""; if ( row.recur_event_display ){ recur_check = checkForDayNames(row, "recur_date"); if(recur_check == ""){ recur_check = getMonthNames(row.recur_event_display, "true"); } } else { if ( row.formatted_date ){ recur_check = getMonthNames(row.formatted_date); } } if(recur_check == ""){ if(row.iso_start_date){ recur_check = getCourseDay(row.iso_start_date, row.iso_end_date); }else{ recur_check = getCourseDay(row.start_date, row.end_date); } row.formatted_date = recur_check; } %> <%= recur_check %> <% if ( row.weekend_timings || row.weekday_timings ){ %>
 <% if ( row.weekend_timings && row.weekend_timings != "NULL" ){ %> <%= row.weekend_timings %> <% } else if ( row.weekday_timings && row.weekday_timings != "NULL" ) { %> <%= row.weekday_timings %> <% } %>
 <% } %>
 <% reglink = "https://my.artofliving.org/" %>
 <% if ( row.is_online_event != undefined && row.is_online_event == 1 ){ %> <%= Drupal.t("Online") %> <% } %> <% if ( row.is_online_event != undefined && row.is_online_event == 1 && hide_address_online != 1){ %> , <% } %> <% if ( hide_address_online != 1 ){ %> <%= row.address %> <% } %>
 <% if(row.ctype == "762239" || row.ctype == "55116"){%> 
<% if(typeof row.register_title != "undefined" && row.register_title != ""){ %><%= row.register_title %><% } else{ %>Register Now<% } %>  <% }else{ %> 
<% if(typeof row.register_title != "undefined" && row.register_title != ""){ %><%= row.register_title %><% } else{ %>Register Now<% } %>  <%}%>
 <% }); %>
 <% _.each( rows, function( row ){ %> <% var programPath = row.register_url ?? row.field_register_url.value; var shopamine_url = row.shopamine_url ?? row.field_shopamine_url.value; if(row.sao_type == 1 && row.info_for_group_required == 1 && (row.max_tickets != 0 || row.max_tickets != 1)) { if(row.is_paid == true && row.register_url){ programPath = programPath; } else if(row.max_tickets > 1 && row.info_for_group_required == 1 && row.register_url){ programPath = programPath; }else{ programPath = shopamine_url; } } %>
 <% }); %>
PROGRAM DAY ADDRESS CONTACT  <%= row.title %>   <% var recur_check = ""; if ( row.recur_event_display ){ recur_check = checkForDayNames(row, "recur_date"); if(recur_check == ""){ recur_check = getMonthNames(row.recur_event_display, "true"); } } else { if ( row.formatted_date ){ recur_check = getMonthNames(row.formatted_date); } } if(recur_check == ""){ if(row.iso_start_date){ recur_check = getCourseDay(row.iso_start_date, row.iso_end_date); }else{ recur_check = getCourseDay(row.start_date, row.end_date); } row.formatted_date = recur_check; } %> <%= recur_check %> <% if ( row.recur_event_display ){ %> <% if ( row.weekend_timings && row.weekend_timings != "NULL" ){ %> <%= row.weekend_timings %> <% } else if ( row.weekday_timings && row.weekday_timings !="NULL" ) { %> <%= row.weekday_timings %> <% } %>
 <% } %>   <% if ( hide_address_online != 1 ){ %> <%= row.address %>  <% } %>  <% if (row.register_url == "" && row.course_fee == 0 && row.early_course_fee == 0 && row.recur_event_display == "") { if(rsvp_nid){ var save_seat_url = "../webform-ajax/"+rsvp_nid+"?course_nid="+row.id; %> Save My Seat  <% } }else if(Drupal.settings.aol.country == "in"){ %> <% var sub_url = ""; var reg_url = ""; var reg_title = "Interested"; if(row.sao_id && row.register_url == ""){ if (row.sao_type == 0) { sub_url = "india-course-registration"; }else if (row.sao_type == 1) { sub_url = "india-event-registration"; } } if (row.register_url != "" && row.register_url.indexOf("sendemailtoteacher") != -1) { sub_url = "india-registration"; reg_title = "Register Now"; } if(row.register_url.indexOf("www.") != -1 && row.register_url.indexOf("artofliving") == -1){ if(sub_url){ reg_url = sub_url+"/"+row.sao_id; }else{ reg_url = row.register_url; reg_title = "Register Now"; } }else{ reg_url = row.register_url; reg_title = "Interested"; } if(reg_url){ %> <%= reg_title %>  <% } } else if (row.register_url) { %> <% if (row.sao_type == 1) { %> <% if (row.info_for_group_required == 1 && (row.max_tickets != 0 || row.max_tickets != 1)) { %> <% if(row.is_paid == true && row.register_url){ %> Register Now  <% }else if(row.max_tickets > 1 && row.info_for_group_required == 1 && row.register_url){ %> Register Now  <% }else { %> <% if(rsvp_nid){ var save_seat_url = "../webform-ajax/"+rsvp_nid+"?course_nid="+row.id; } %> Save My Seat  <% } %> <% }else if (row.course_fee != 0) { %> Register Now  <% } %> <% }else if (row.register_url) { %> <% if(row.ctype == "762239" || row.ctype == "55116"){%> <% if(typeof row.register_title != "undefined" && row.register_title != ""){ %><%= row.register_title %><% } else{ %>Register Now<% } %>  <% }else{ %> Register Now  <%}%> <% } %> <% } %> 
 <% _.each( rows, function( row ){ %>
 " class="upcoming-city"><%= row.address %>
 <% var recur_check = ""; if ( row.recur_event_display ){ recur_check = checkForDayNames(row, "recur_date"); if(recur_check == ""){	recur_check = getMonthNames(row.recur_event_display, "true"); } } else if ( row.combined_date ){ recur_check = row.combined_date;	} else { if ( row.formatted_date ){	recur_check = getMonthNames(row.formatted_date); } } if(recur_check == ""){	if(row.iso_start_date){	recur_check = getCourseDay(row.iso_start_date, row.iso_end_date); }else{	recur_check = getCourseDay(row.start_date, row.end_date); }	row.formatted_date = recur_check; } %> <%= recur_check %>
<%= row.title %>
  <% }); %>
 <% _.each( rows, function( row ){ %>
 <% var recur_check = ""; if ( row.recur_event_display ){ recur_check = checkForDayNames(row, "recur_date"); if(recur_check == ""){	recur_check = getMonthNames(row.recur_event_display, "true"); } } else { if ( row.formatted_date ){	recur_check = getMonthNames(row.formatted_date); } } if(recur_check == ""){	if(row.iso_start_date){	recur_check = getCourseDay(row.iso_start_date, row.iso_end_date); }else{	recur_check = getCourseDay(row.start_date, row.end_date); }	row.formatted_date = recur_check; } %> <%= recur_check %>
 <% if(row.address){ %>
 <% if ( hide_address_online != 1 ){ %> <%= row.address %> <% } %>
 <% }if((row.teachers !== null) || row.email || (row.phones !== null)){ %>
 <% var count = 1; if(row.teachers !== null){ %> Teacher:   <% _.each( row.teachers, function( teacher ){ %> <% if(count != 1 && teacher !== ""){ %> &   <% }if(row.email || (row.phones !== null)){ %> Contact:   <%= row.email %> <% if(row.phones !== null){ count = 1; _.each( row.phones, function( phone ){ %> , <%= phone %> <% count++; }); } %>  <% } %>  <% } %>
 <% if(row.register_url){ %>
 <% }if(typeof preselected_course_types !== "undefined" && preselected_course_types !== null){ %>
 <% } %>
 <% }); %>
 <% if(prev_month_flag == true){ %> 
<%= prev_month %>  <% } %> 
<%= FullMonths[get_month] + " " + get_year %>  <%= next_month %>  <% var set_course_date = ""; var d = new Date(); var firstDayOfMonth = new Date(get_year, get_month, 1).getDay(); var lastDateOfMonth = new Date(get_year, get_month+1, 0).getDate(); var lastDayOfLastMonth = get_month == 0 ? new Date(get_year-1, 11, 0).getDate() : new Date(get_year, get_month, 0).getDate(); %>
 <% for(var i=0; i < DaysOfWeek.length;i++) { %><%= DaysOfWeek[i] %>  <% } %>  <% var i=1; do { var dow = new Date(get_year, get_month, i).getDay(); if ( dow == 0 ) { %> <% }else if ( i == 1 ) { %>  <% var k = lastDayOfLastMonth - firstDayOfMonth+1; for(var j=0; j < firstDayOfMonth; j++) { %><%= k %>  <% k++; } } var chk = new Date(); var chkY = chk.getFullYear(); var chkM = chk.getMonth(); current_date_course = ""; course_date_class = ""; var active_class = ""; if(typeof all_course_dates[i] !== "undefined"){ current_date_course = JSON.stringify(all_course_dates[i]); course_date_class = "course_available"; } if (chkY == get_year && chkM == get_month && i == chk.getDate()) { var today = i; if(typeof all_course_dates[i] !== "undefined") set_course_date = i; if(course_date_class !== "") active_class = "active"; %>   <% } else { if(typeof all_course_dates[i] !== "undefined" && set_course_date == ""){ set_course_date = i; if((typeof all_course_dates[chk.getDate()] == "undefined" && get_month == current_month) || get_month != current_month) active_class = "active"; } %>   <% } if ( dow == 6 ) { %>  <% }else if ( i == lastDateOfMonth ) { var k=1; for(dow; dow < 6; dow++) { %><%= k %>  <% k++; } } i++; }while(i <= lastDateOfMonth); %>
 <% var get_courses = ""; if(typeof all_course_dates[set_course_date] !== "undefined") get_courses = all_course_dates[set_course_date]; %> 
Events on <% if(set_course_date !== ""){ %> <%= set_course_date %>  <% } %> <%= FullMonths[get_month] %>  <% if(get_courses !== ""){ var count = 1; %> <% _.each( get_courses, function( get_course ){ var image = ""; var thumbnail = ""; if(typeof get_course.image_url != ""){ image = get_course.image_url; image = image.replace("public://", "/sites/unity.artofliving.org/files/styles/blog_promoted_3_box_grid/public/"); thumbnail = image.replace("public://", "/sites/unity.artofliving.org/files/styles/thumbnail/public/"); } %> <% count++; }); %> <% }else{ %>No courses found  <% } %>  <% _.each( rows, function( row ){ %> <% var programPath = row.register_url ?? row.field_register_url.value; var shopamine_url = row.shopamine_url ?? row.field_shopamine_url.value; if(row.sao_type == 1 && row.info_for_group_required == 1 && (row.max_tickets != 0 || row.max_tickets != 1)) { if(row.is_paid == true && row.register_url){ programPath = programPath; } else if(row.max_tickets > 1 && row.info_for_group_required == 1 && row.register_url){ programPath = programPath; }else{ programPath = shopamine_url; } } %>
 <% }); %>
 <% _.each( rows, function( row ){ %> <% var programPath = row.register_url ?? row.field_register_url.value; var shopamine_url = row.shopamine_url ?? row.field_shopamine_url.value; if(row.sao_type == 1 && row.info_for_group_required == 1 && (row.max_tickets != 0 || row.max_tickets != 1)) { if(row.is_paid == true && row.register_url){ programPath = programPath; } else if(row.max_tickets > 1 && row.info_for_group_required == 1 && row.register_url){ programPath = programPath; }else{ programPath = shopamine_url; } } %>
 <% var recur_check = ""; if ( row.recur_event_display ){ recur_check = checkForDayNames(row, "recur_date"); if(recur_check == ""){ recur_check = getMonthNames(row.recur_event_display, "true"); } } else { if ( row.formatted_date ){ recur_check = getMonthNames(row.formatted_date); } } if(recur_check == ""){ if(row.iso_start_date){ recur_check = getCourseDay(row.iso_start_date, row.iso_end_date); }else{ recur_check = getCourseDay(row.start_date, row.end_date); } row.formatted_date = recur_check; } %> <%= recur_check %> <% if ( row.weekend_timings || row.weekday_timings ){ %>
 <% if ( row.weekend_timings && row.weekend_timings != "NULL" ){ %> <%= row.weekend_timings %> <% } else if ( row.weekday_timings && row.weekday_timings != "NULL" ) { %> <%= row.weekday_timings %> <% } %>
 <% } %>
 <% reglink = "https://my.artofliving.org/" %>
 <% if ( row.is_online_event != undefined && row.is_online_event == 1 ){ %> <%= Drupal.t("Online") %> <% } %> <% if ( row.is_online_event != undefined && row.is_online_event == 1 && hide_address_online != 1){ %> , <% } %> <% if ( hide_address_online != 1 ){ %> <%= row.address %> <% } %>
 <% if(row.ctype == "762239" || row.ctype == "55116"){%> 
<% if(typeof row.register_title != "undefined" && row.register_title != ""){ %><%= row.register_title %><% } else{ %>Register Now<% } %>  <% }else{ %> 
<% if(typeof row.register_title != "undefined" && row.register_title != ""){ %><%= row.register_title %><% } else{ %>Register Now<% } %>  <%}%>
 <% }); %>
 <% _.each( rows, function( row ){ %> <% var programPath = row.register_url ?? row.field_register_url.value; var shopamine_url = row.shopamine_url ?? row.field_shopamine_url.value; if(row.sao_type == 1 && row.info_for_group_required == 1 && (row.max_tickets != 0 || row.max_tickets != 1)) { if(row.is_paid == true && row.register_url){ programPath = programPath; } else if(row.max_tickets > 1 && row.info_for_group_required == 1 && row.register_url){ programPath = programPath; }else{ programPath = shopamine_url; } } %>
 <% }); %>
PROGRAM DAY ADDRESS CONTACT  <%= row.title %>   <% var recur_check = ""; if ( row.recur_event_display ){ recur_check = checkForDayNames(row, "recur_date"); if(recur_check == ""){ recur_check = getMonthNames(row.recur_event_display, "true"); } } else { if ( row.formatted_date ){ recur_check = getMonthNames(row.formatted_date); } } if(recur_check == ""){ if(row.iso_start_date){ recur_check = getCourseDay(row.iso_start_date, row.iso_end_date); }else{ recur_check = getCourseDay(row.start_date, row.end_date); } row.formatted_date = recur_check; } %> <%= recur_check %> <% if ( row.recur_event_display ){ %> <% if ( row.weekend_timings && row.weekend_timings != "NULL" ){ %> <%= row.weekend_timings %> <% } else if ( row.weekday_timings && row.weekday_timings !="NULL" ) { %> <%= row.weekday_timings %> <% } %>
 <% } %>   <% if ( hide_address_online != 1 ){ %> <%= row.address %>  <% } %>  <% if (row.register_url == "" && row.course_fee == 0 && row.early_course_fee == 0 && row.recur_event_display == "") { if(rsvp_nid){ var save_seat_url = "../webform-ajax/"+rsvp_nid+"?course_nid="+row.id; %> Save My Seat  <% } }else if(Drupal.settings.aol.country == "in"){ %> <% var sub_url = ""; var reg_url = ""; var reg_title = "Interested"; if(row.sao_id && row.register_url == ""){ if (row.sao_type == 0) { sub_url = "india-course-registration"; }else if (row.sao_type == 1) { sub_url = "india-event-registration"; } } if (row.register_url != "" && row.register_url.indexOf("sendemailtoteacher") != -1) { sub_url = "india-registration"; reg_title = "Register Now"; } if(row.register_url.indexOf("www.") != -1 && row.register_url.indexOf("artofliving") == -1){ if(sub_url){ reg_url = sub_url+"/"+row.sao_id; }else{ reg_url = row.register_url; reg_title = "Register Now"; } }else{ reg_url = row.register_url; reg_title = "Interested"; } if(reg_url){ %> <%= reg_title %>  <% } } else if (row.register_url) { %> <% if (row.sao_type == 1) { %> <% if (row.info_for_group_required == 1 && (row.max_tickets != 0 || row.max_tickets != 1)) { %> <% if(row.is_paid == true && row.register_url){ %> Register Now  <% }else if(row.max_tickets > 1 && row.info_for_group_required == 1 && row.register_url){ %> Register Now  <% }else { %> <% if(rsvp_nid){ var save_seat_url = "../webform-ajax/"+rsvp_nid+"?course_nid="+row.id; } %> Save My Seat  <% } %> <% }else if (row.course_fee != 0) { %> Register Now  <% } %> <% }else if (row.register_url) { %> <% if(row.ctype == "762239" || row.ctype == "55116"){%> <% if(typeof row.register_title != "undefined" && row.register_title != ""){ %><%= row.register_title %><% } else{ %>Register Now<% } %>  <% }else{ %> Register Now  <%}%> <% } %> <% } %> 
 <% _.each( rows, function( row ){ %>
 " class="upcoming-city"><%= row.address %>
 <% var recur_check = ""; if ( row.recur_event_display ){ recur_check = checkForDayNames(row, "recur_date"); if(recur_check == ""){	recur_check = getMonthNames(row.recur_event_display, "true"); } } else if ( row.combined_date ){ recur_check = row.combined_date;	} else { if ( row.formatted_date ){	recur_check = getMonthNames(row.formatted_date); } } if(recur_check == ""){	if(row.iso_start_date){	recur_check = getCourseDay(row.iso_start_date, row.iso_end_date); }else{	recur_check = getCourseDay(row.start_date, row.end_date); }	row.formatted_date = recur_check; } %> <%= recur_check %>
<%= row.title %>
  <% }); %>
 <% _.each( rows, function( row ){ %>
 <% var recur_check = ""; if ( row.recur_event_display ){ recur_check = checkForDayNames(row, "recur_date"); if(recur_check == ""){	recur_check = getMonthNames(row.recur_event_display, "true"); } } else { if ( row.formatted_date ){	recur_check = getMonthNames(row.formatted_date); } } if(recur_check == ""){	if(row.iso_start_date){	recur_check = getCourseDay(row.iso_start_date, row.iso_end_date); }else{	recur_check = getCourseDay(row.start_date, row.end_date); }	row.formatted_date = recur_check; } %> <%= recur_check %>
 <% if(row.address){ %>
 <% if ( hide_address_online != 1 ){ %> <%= row.address %> <% } %>
 <% }if((row.teachers !== null) || row.email || (row.phones !== null)){ %>
 <% var count = 1; if(row.teachers !== null){ %> Teacher:   <% _.each( row.teachers, function( teacher ){ %> <% if(count != 1 && teacher !== ""){ %> &   <% }if(row.email || (row.phones !== null)){ %> Contact:   <%= row.email %> <% if(row.phones !== null){ count = 1; _.each( row.phones, function( phone ){ %> , <%= phone %> <% count++; }); } %>  <% } %>  <% } %>
 <% if(row.register_url){ %>
 <% }if(typeof preselected_course_types !== "undefined" && preselected_course_types !== null){ %>
 <% } %>
 <% }); %>
 <% if(prev_month_flag == true){ %> 
<%= prev_month %>  <% } %> 
<%= FullMonths[get_month] + " " + get_year %>  <%= next_month %>  <% var set_course_date = ""; var d = new Date(); var firstDayOfMonth = new Date(get_year, get_month, 1).getDay(); var lastDateOfMonth = new Date(get_year, get_month+1, 0).getDate(); var lastDayOfLastMonth = get_month == 0 ? new Date(get_year-1, 11, 0).getDate() : new Date(get_year, get_month, 0).getDate(); %>
 <% for(var i=0; i < DaysOfWeek.length;i++) { %><%= DaysOfWeek[i] %>  <% } %>  <% var i=1; do { var dow = new Date(get_year, get_month, i).getDay(); if ( dow == 0 ) { %> <% }else if ( i == 1 ) { %>  <% var k = lastDayOfLastMonth - firstDayOfMonth+1; for(var j=0; j < firstDayOfMonth; j++) { %><%= k %>  <% k++; } } var chk = new Date(); var chkY = chk.getFullYear(); var chkM = chk.getMonth(); current_date_course = ""; course_date_class = ""; var active_class = ""; if(typeof all_course_dates[i] !== "undefined"){ current_date_course = JSON.stringify(all_course_dates[i]); course_date_class = "course_available"; } if (chkY == get_year && chkM == get_month && i == chk.getDate()) { var today = i; if(typeof all_course_dates[i] !== "undefined") set_course_date = i; if(course_date_class !== "") active_class = "active"; %>   <% } else { if(typeof all_course_dates[i] !== "undefined" && set_course_date == ""){ set_course_date = i; if((typeof all_course_dates[chk.getDate()] == "undefined" && get_month == current_month) || get_month != current_month) active_class = "active"; } %>   <% } if ( dow == 6 ) { %>  <% }else if ( i == lastDateOfMonth ) { var k=1; for(dow; dow < 6; dow++) { %><%= k %>  <% k++; } } i++; }while(i <= lastDateOfMonth); %>
 <% var get_courses = ""; if(typeof all_course_dates[set_course_date] !== "undefined") get_courses = all_course_dates[set_course_date]; %> 
Events on <% if(set_course_date !== ""){ %> <%= set_course_date %>  <% } %> <%= FullMonths[get_month] %>  <% if(get_courses !== ""){ var count = 1; %> <% _.each( get_courses, function( get_course ){ var image = ""; var thumbnail = ""; if(typeof get_course.image_url != ""){ image = get_course.image_url; image = image.replace("public://", "/sites/unity.artofliving.org/files/styles/blog_promoted_3_box_grid/public/"); thumbnail = image.replace("public://", "/sites/unity.artofliving.org/files/styles/thumbnail/public/"); } %> <% count++; }); %> <% }else{ %>No courses found  <% } %>  <% _.each( rows, function( row ){ %> <% var programPath = row.register_url ?? row.field_register_url.value; var shopamine_url = row.shopamine_url ?? row.field_shopamine_url.value; if(row.sao_type == 1 && row.info_for_group_required == 1 && (row.max_tickets != 0 || row.max_tickets != 1)) { if(row.is_paid == true && row.register_url){ programPath = programPath; } else if(row.max_tickets > 1 && row.info_for_group_required == 1 && row.register_url){ programPath = programPath; }else{ programPath = shopamine_url; } } %>
 <% }); %>
 <% _.each( rows, function( row ){ %> <% var programPath = row.register_url ?? row.field_register_url.value; var shopamine_url = row.shopamine_url ?? row.field_shopamine_url.value; if(row.sao_type == 1 && row.info_for_group_required == 1 && (row.max_tickets != 0 || row.max_tickets != 1)) { if(row.is_paid == true && row.register_url){ programPath = programPath; } else if(row.max_tickets > 1 && row.info_for_group_required == 1 && row.register_url){ programPath = programPath; }else{ programPath = shopamine_url; } } %>
 <% var recur_check = ""; if ( row.recur_event_display ){ recur_check = checkForDayNames(row, "recur_date"); if(recur_check == ""){ recur_check = getMonthNames(row.recur_event_display, "true"); } } else { if ( row.formatted_date ){ recur_check = getMonthNames(row.formatted_date); } } if(recur_check == ""){ if(row.iso_start_date){ recur_check = getCourseDay(row.iso_start_date, row.iso_end_date); }else{ recur_check = getCourseDay(row.start_date, row.end_date); } row.formatted_date = recur_check; } %> <%= recur_check %> <% if ( row.weekend_timings || row.weekday_timings ){ %>
 <% if ( row.weekend_timings && row.weekend_timings != "NULL" ){ %> <%= row.weekend_timings %> <% } else if ( row.weekday_timings && row.weekday_timings != "NULL" ) { %> <%= row.weekday_timings %> <% } %>
 <% } %>
 <% reglink = "https://my.artofliving.org/" %>
 <% if ( row.is_online_event != undefined && row.is_online_event == 1 ){ %> <%= Drupal.t("Online") %> <% } %> <% if ( row.is_online_event != undefined && row.is_online_event == 1 && hide_address_online != 1){ %> , <% } %> <% if ( hide_address_online != 1 ){ %> <%= row.address %> <% } %>
 <% if(row.ctype == "762239" || row.ctype == "55116"){%> 
<% if(typeof row.register_title != "undefined" && row.register_title != ""){ %><%= row.register_title %><% } else{ %>Register Now<% } %>  <% }else{ %> 
<% if(typeof row.register_title != "undefined" && row.register_title != ""){ %><%= row.register_title %><% } else{ %>Register Now<% } %>  <%}%>
 <% }); %>
 <% _.each( rows, function( row ){ %> <% var programPath = row.register_url ?? row.field_register_url.value; var shopamine_url = row.shopamine_url ?? row.field_shopamine_url.value; if(row.sao_type == 1 && row.info_for_group_required == 1 && (row.max_tickets != 0 || row.max_tickets != 1)) { if(row.is_paid == true && row.register_url){ programPath = programPath; } else if(row.max_tickets > 1 && row.info_for_group_required == 1 && row.register_url){ programPath = programPath; }else{ programPath = shopamine_url; } } %>
 <% }); %>
PROGRAM DAY ADDRESS CONTACT  <%= row.title %>   <% var recur_check = ""; if ( row.recur_event_display ){ recur_check = checkForDayNames(row, "recur_date"); if(recur_check == ""){ recur_check = getMonthNames(row.recur_event_display, "true"); } } else { if ( row.formatted_date ){ recur_check = getMonthNames(row.formatted_date); } } if(recur_check == ""){ if(row.iso_start_date){ recur_check = getCourseDay(row.iso_start_date, row.iso_end_date); }else{ recur_check = getCourseDay(row.start_date, row.end_date); } row.formatted_date = recur_check; } %> <%= recur_check %> <% if ( row.recur_event_display ){ %> <% if ( row.weekend_timings && row.weekend_timings != "NULL" ){ %> <%= row.weekend_timings %> <% } else if ( row.weekday_timings && row.weekday_timings !="NULL" ) { %> <%= row.weekday_timings %> <% } %>
 <% } %>   <% if ( hide_address_online != 1 ){ %> <%= row.address %>  <% } %>  <% if (row.register_url == "" && row.course_fee == 0 && row.early_course_fee == 0 && row.recur_event_display == "") { if(rsvp_nid){ var save_seat_url = "../webform-ajax/"+rsvp_nid+"?course_nid="+row.id; %> Save My Seat  <% } }else if(Drupal.settings.aol.country == "in"){ %> <% var sub_url = ""; var reg_url = ""; var reg_title = "Interested"; if(row.sao_id && row.register_url == ""){ if (row.sao_type == 0) { sub_url = "india-course-registration"; }else if (row.sao_type == 1) { sub_url = "india-event-registration"; } } if (row.register_url != "" && row.register_url.indexOf("sendemailtoteacher") != -1) { sub_url = "india-registration"; reg_title = "Register Now"; } if(row.register_url.indexOf("www.") != -1 && row.register_url.indexOf("artofliving") == -1){ if(sub_url){ reg_url = sub_url+"/"+row.sao_id; }else{ reg_url = row.register_url; reg_title = "Register Now"; } }else{ reg_url = row.register_url; reg_title = "Interested"; } if(reg_url){ %> <%= reg_title %>  <% } } else if (row.register_url) { %> <% if (row.sao_type == 1) { %> <% if (row.info_for_group_required == 1 && (row.max_tickets != 0 || row.max_tickets != 1)) { %> <% if(row.is_paid == true && row.register_url){ %> Register Now  <% }else if(row.max_tickets > 1 && row.info_for_group_required == 1 && row.register_url){ %> Register Now  <% }else { %> <% if(rsvp_nid){ var save_seat_url = "../webform-ajax/"+rsvp_nid+"?course_nid="+row.id; } %> Save My Seat  <% } %> <% }else if (row.course_fee != 0) { %> Register Now  <% } %> <% }else if (row.register_url) { %> <% if(row.ctype == "762239" || row.ctype == "55116"){%> <% if(typeof row.register_title != "undefined" && row.register_title != ""){ %><%= row.register_title %><% } else{ %>Register Now<% } %>  <% }else{ %> Register Now  <%}%> <% } %> <% } %> 
 <% _.each( rows, function( row ){ %>
 " class="upcoming-city"><%= row.address %>
 <% var recur_check = ""; if ( row.recur_event_display ){ recur_check = checkForDayNames(row, "recur_date"); if(recur_check == ""){	recur_check = getMonthNames(row.recur_event_display, "true"); } } else if ( row.combined_date ){ recur_check = row.combined_date;	} else { if ( row.formatted_date ){	recur_check = getMonthNames(row.formatted_date); } } if(recur_check == ""){	if(row.iso_start_date){	recur_check = getCourseDay(row.iso_start_date, row.iso_end_date); }else{	recur_check = getCourseDay(row.start_date, row.end_date); }	row.formatted_date = recur_check; } %> <%= recur_check %>
<%= row.title %>
  <% }); %>
 <% _.each( rows, function( row ){ %>
 <% var recur_check = ""; if ( row.recur_event_display ){ recur_check = checkForDayNames(row, "recur_date"); if(recur_check == ""){	recur_check = getMonthNames(row.recur_event_display, "true"); } } else { if ( row.formatted_date ){	recur_check = getMonthNames(row.formatted_date); } } if(recur_check == ""){	if(row.iso_start_date){	recur_check = getCourseDay(row.iso_start_date, row.iso_end_date); }else{	recur_check = getCourseDay(row.start_date, row.end_date); }	row.formatted_date = recur_check; } %> <%= recur_check %>
 <% if(row.address){ %>
 <% if ( hide_address_online != 1 ){ %> <%= row.address %> <% } %>
 <% }if((row.teachers !== null) || row.email || (row.phones !== null)){ %>
 <% var count = 1; if(row.teachers !== null){ %> Teacher:   <% _.each( row.teachers, function( teacher ){ %> <% if(count != 1 && teacher !== ""){ %> &   <% }if(row.email || (row.phones !== null)){ %> Contact:   <%= row.email %> <% if(row.phones !== null){ count = 1; _.each( row.phones, function( phone ){ %> , <%= phone %> <% count++; }); } %>  <% } %>  <% } %>
 <% if(row.register_url){ %>
 <% }if(typeof preselected_course_types !== "undefined" && preselected_course_types !== null){ %>
 <% } %>
 <% }); %>
 <% if(prev_month_flag == true){ %> 
<%= prev_month %>  <% } %> 
<%= FullMonths[get_month] + " " + get_year %>  <%= next_month %>  <% var set_course_date = ""; var d = new Date(); var firstDayOfMonth = new Date(get_year, get_month, 1).getDay(); var lastDateOfMonth = new Date(get_year, get_month+1, 0).getDate(); var lastDayOfLastMonth = get_month == 0 ? new Date(get_year-1, 11, 0).getDate() : new Date(get_year, get_month, 0).getDate(); %>
 <% for(var i=0; i < DaysOfWeek.length;i++) { %><%= DaysOfWeek[i] %>  <% } %>  <% var i=1; do { var dow = new Date(get_year, get_month, i).getDay(); if ( dow == 0 ) { %> <% }else if ( i == 1 ) { %>  <% var k = lastDayOfLastMonth - firstDayOfMonth+1; for(var j=0; j < firstDayOfMonth; j++) { %><%= k %>  <% k++; } } var chk = new Date(); var chkY = chk.getFullYear(); var chkM = chk.getMonth(); current_date_course = ""; course_date_class = ""; var active_class = ""; if(typeof all_course_dates[i] !== "undefined"){ current_date_course = JSON.stringify(all_course_dates[i]); course_date_class = "course_available"; } if (chkY == get_year && chkM == get_month && i == chk.getDate()) { var today = i; if(typeof all_course_dates[i] !== "undefined") set_course_date = i; if(course_date_class !== "") active_class = "active"; %>   <% } else { if(typeof all_course_dates[i] !== "undefined" && set_course_date == ""){ set_course_date = i; if((typeof all_course_dates[chk.getDate()] == "undefined" && get_month == current_month) || get_month != current_month) active_class = "active"; } %>   <% } if ( dow == 6 ) { %>  <% }else if ( i == lastDateOfMonth ) { var k=1; for(dow; dow < 6; dow++) { %><%= k %>  <% k++; } } i++; }while(i <= lastDateOfMonth); %>
 <% var get_courses = ""; if(typeof all_course_dates[set_course_date] !== "undefined") get_courses = all_course_dates[set_course_date]; %> 
Events on <% if(set_course_date !== ""){ %> <%= set_course_date %>  <% } %> <%= FullMonths[get_month] %>  <% if(get_courses !== ""){ var count = 1; %> <% _.each( get_courses, function( get_course ){ var image = ""; var thumbnail = ""; if(typeof get_course.image_url != ""){ image = get_course.image_url; image = image.replace("public://", "/sites/unity.artofliving.org/files/styles/blog_promoted_3_box_grid/public/"); thumbnail = image.replace("public://", "/sites/unity.artofliving.org/files/styles/thumbnail/public/"); } %> <% count++; }); %> <% }else{ %>No courses found  <% } %>  <% _.each( rows, function( row ){ %> <% var programPath = row.register_url ?? row.field_register_url.value; var shopamine_url = row.shopamine_url ?? row.field_shopamine_url.value; if(row.sao_type == 1 && row.info_for_group_required == 1 && (row.max_tickets != 0 || row.max_tickets != 1)) { if(row.is_paid == true && row.register_url){ programPath = programPath; } else if(row.max_tickets > 1 && row.info_for_group_required == 1 && row.register_url){ programPath = programPath; }else{ programPath = shopamine_url; } } %>
 <% }); %>
 <% _.each( rows, function( row ){ %> <% var programPath = row.register_url ?? row.field_register_url.value; var shopamine_url = row.shopamine_url ?? row.field_shopamine_url.value; if(row.sao_type == 1 && row.info_for_group_required == 1 && (row.max_tickets != 0 || row.max_tickets != 1)) { if(row.is_paid == true && row.register_url){ programPath = programPath; } else if(row.max_tickets > 1 && row.info_for_group_required == 1 && row.register_url){ programPath = programPath; }else{ programPath = shopamine_url; } } %>
 <% var recur_check = ""; if ( row.recur_event_display ){ recur_check = checkForDayNames(row, "recur_date"); if(recur_check == ""){ recur_check = getMonthNames(row.recur_event_display, "true"); } } else { if ( row.formatted_date ){ recur_check = getMonthNames(row.formatted_date); } } if(recur_check == ""){ if(row.iso_start_date){ recur_check = getCourseDay(row.iso_start_date, row.iso_end_date); }else{ recur_check = getCourseDay(row.start_date, row.end_date); } row.formatted_date = recur_check; } %> <%= recur_check %> <% if ( row.weekend_timings || row.weekday_timings ){ %>
 <% if ( row.weekend_timings && row.weekend_timings != "NULL" ){ %> <%= row.weekend_timings %> <% } else if ( row.weekday_timings && row.weekday_timings != "NULL" ) { %> <%= row.weekday_timings %> <% } %>
 <% } %>
 <% reglink = "https://my.artofliving.org/" %>
 <% if ( row.is_online_event != undefined && row.is_online_event == 1 ){ %> <%= Drupal.t("Online") %> <% } %> <% if ( row.is_online_event != undefined && row.is_online_event == 1 && hide_address_online != 1){ %> , <% } %> <% if ( hide_address_online != 1 ){ %> <%= row.address %> <% } %>
 <% if(row.ctype == "762239" || row.ctype == "55116"){%> 
<% if(typeof row.register_title != "undefined" && row.register_title != ""){ %><%= row.register_title %><% } else{ %>Register Now<% } %>  <% }else{ %> 
<% if(typeof row.register_title != "undefined" && row.register_title != ""){ %><%= row.register_title %><% } else{ %>Register Now<% } %>  <%}%>
 <% }); %>
 <% _.each( rows, function( row ){ %> <% var programPath = row.register_url ?? row.field_register_url.value; var shopamine_url = row.shopamine_url ?? row.field_shopamine_url.value; if(row.sao_type == 1 && row.info_for_group_required == 1 && (row.max_tickets != 0 || row.max_tickets != 1)) { if(row.is_paid == true && row.register_url){ programPath = programPath; } else if(row.max_tickets > 1 && row.info_for_group_required == 1 && row.register_url){ programPath = programPath; }else{ programPath = shopamine_url; } } %>
 <% }); %>
PROGRAM DAY ADDRESS CONTACT  <%= row.title %>   <% var recur_check = ""; if ( row.recur_event_display ){ recur_check = checkForDayNames(row, "recur_date"); if(recur_check == ""){ recur_check = getMonthNames(row.recur_event_display, "true"); } } else { if ( row.formatted_date ){ recur_check = getMonthNames(row.formatted_date); } } if(recur_check == ""){ if(row.iso_start_date){ recur_check = getCourseDay(row.iso_start_date, row.iso_end_date); }else{ recur_check = getCourseDay(row.start_date, row.end_date); } row.formatted_date = recur_check; } %> <%= recur_check %> <% if ( row.recur_event_display ){ %> <% if ( row.weekend_timings && row.weekend_timings != "NULL" ){ %> <%= row.weekend_timings %> <% } else if ( row.weekday_timings && row.weekday_timings !="NULL" ) { %> <%= row.weekday_timings %> <% } %>
 <% } %>   <% if ( hide_address_online != 1 ){ %> <%= row.address %>  <% } %>  <% if (row.register_url == "" && row.course_fee == 0 && row.early_course_fee == 0 && row.recur_event_display == "") { if(rsvp_nid){ var save_seat_url = "../webform-ajax/"+rsvp_nid+"?course_nid="+row.id; %> Save My Seat  <% } }else if(Drupal.settings.aol.country == "in"){ %> <% var sub_url = ""; var reg_url = ""; var reg_title = "Interested"; if(row.sao_id && row.register_url == ""){ if (row.sao_type == 0) { sub_url = "india-course-registration"; }else if (row.sao_type == 1) { sub_url = "india-event-registration"; } } if (row.register_url != "" && row.register_url.indexOf("sendemailtoteacher") != -1) { sub_url = "india-registration"; reg_title = "Register Now"; } if(row.register_url.indexOf("www.") != -1 && row.register_url.indexOf("artofliving") == -1){ if(sub_url){ reg_url = sub_url+"/"+row.sao_id; }else{ reg_url = row.register_url; reg_title = "Register Now"; } }else{ reg_url = row.register_url; reg_title = "Interested"; } if(reg_url){ %> <%= reg_title %>  <% } } else if (row.register_url) { %> <% if (row.sao_type == 1) { %> <% if (row.info_for_group_required == 1 && (row.max_tickets != 0 || row.max_tickets != 1)) { %> <% if(row.is_paid == true && row.register_url){ %> Register Now  <% }else if(row.max_tickets > 1 && row.info_for_group_required == 1 && row.register_url){ %> Register Now  <% }else { %> <% if(rsvp_nid){ var save_seat_url = "../webform-ajax/"+rsvp_nid+"?course_nid="+row.id; } %> Save My Seat  <% } %> <% }else if (row.course_fee != 0) { %> Register Now  <% } %> <% }else if (row.register_url) { %> <% if(row.ctype == "762239" || row.ctype == "55116"){%> <% if(typeof row.register_title != "undefined" && row.register_title != ""){ %><%= row.register_title %><% } else{ %>Register Now<% } %>  <% }else{ %> Register Now  <%}%> <% } %> <% } %> 
 <% _.each( rows, function( row ){ %>
 " class="upcoming-city"><%= row.address %>
 <% var recur_check = ""; if ( row.recur_event_display ){ recur_check = checkForDayNames(row, "recur_date"); if(recur_check == ""){	recur_check = getMonthNames(row.recur_event_display, "true"); } } else if ( row.combined_date ){ recur_check = row.combined_date;	} else { if ( row.formatted_date ){	recur_check = getMonthNames(row.formatted_date); } } if(recur_check == ""){	if(row.iso_start_date){	recur_check = getCourseDay(row.iso_start_date, row.iso_end_date); }else{	recur_check = getCourseDay(row.start_date, row.end_date); }	row.formatted_date = recur_check; } %> <%= recur_check %>
<%= row.title %>
  <% }); %>
 <% _.each( rows, function( row ){ %>
 <% var recur_check = ""; if ( row.recur_event_display ){ recur_check = checkForDayNames(row, "recur_date"); if(recur_check == ""){	recur_check = getMonthNames(row.recur_event_display, "true"); } } else { if ( row.formatted_date ){	recur_check = getMonthNames(row.formatted_date); } } if(recur_check == ""){	if(row.iso_start_date){	recur_check = getCourseDay(row.iso_start_date, row.iso_end_date); }else{	recur_check = getCourseDay(row.start_date, row.end_date); }	row.formatted_date = recur_check; } %> <%= recur_check %>
 <% if(row.address){ %>
 <% if ( hide_address_online != 1 ){ %> <%= row.address %> <% } %>
 <% }if((row.teachers !== null) || row.email || (row.phones !== null)){ %>
 <% var count = 1; if(row.teachers !== null){ %> Teacher:   <% _.each( row.teachers, function( teacher ){ %> <% if(count != 1 && teacher !== ""){ %> &   <% }if(row.email || (row.phones !== null)){ %> Contact:   <%= row.email %> <% if(row.phones !== null){ count = 1; _.each( row.phones, function( phone ){ %> , <%= phone %> <% count++; }); } %>  <% } %>  <% } %>
 <% if(row.register_url){ %>
 <% }if(typeof preselected_course_types !== "undefined" && preselected_course_types !== null){ %>
 <% } %>
 <% }); %>
 <% if(prev_month_flag == true){ %> 
<%= prev_month %>  <% } %> 
<%= FullMonths[get_month] + " " + get_year %>  <%= next_month %>  <% var set_course_date = ""; var d = new Date(); var firstDayOfMonth = new Date(get_year, get_month, 1).getDay(); var lastDateOfMonth = new Date(get_year, get_month+1, 0).getDate(); var lastDayOfLastMonth = get_month == 0 ? new Date(get_year-1, 11, 0).getDate() : new Date(get_year, get_month, 0).getDate(); %>
 <% for(var i=0; i < DaysOfWeek.length;i++) { %><%= DaysOfWeek[i] %>  <% } %>  <% var i=1; do { var dow = new Date(get_year, get_month, i).getDay(); if ( dow == 0 ) { %> <% }else if ( i == 1 ) { %>  <% var k = lastDayOfLastMonth - firstDayOfMonth+1; for(var j=0; j < firstDayOfMonth; j++) { %><%= k %>  <% k++; } } var chk = new Date(); var chkY = chk.getFullYear(); var chkM = chk.getMonth(); current_date_course = ""; course_date_class = ""; var active_class = ""; if(typeof all_course_dates[i] !== "undefined"){ current_date_course = JSON.stringify(all_course_dates[i]); course_date_class = "course_available"; } if (chkY == get_year && chkM == get_month && i == chk.getDate()) { var today = i; if(typeof all_course_dates[i] !== "undefined") set_course_date = i; if(course_date_class !== "") active_class = "active"; %>   <% } else { if(typeof all_course_dates[i] !== "undefined" && set_course_date == ""){ set_course_date = i; if((typeof all_course_dates[chk.getDate()] == "undefined" && get_month == current_month) || get_month != current_month) active_class = "active"; } %>   <% } if ( dow == 6 ) { %>  <% }else if ( i == lastDateOfMonth ) { var k=1; for(dow; dow < 6; dow++) { %><%= k %>  <% k++; } } i++; }while(i <= lastDateOfMonth); %>
 <% var get_courses = ""; if(typeof all_course_dates[set_course_date] !== "undefined") get_courses = all_course_dates[set_course_date]; %> 
Events on <% if(set_course_date !== ""){ %> <%= set_course_date %>  <% } %> <%= FullMonths[get_month] %>  <% if(get_courses !== ""){ var count = 1; %> <% _.each( get_courses, function( get_course ){ var image = ""; var thumbnail = ""; if(typeof get_course.image_url != ""){ image = get_course.image_url; image = image.replace("public://", "/sites/unity.artofliving.org/files/styles/blog_promoted_3_box_grid/public/"); thumbnail = image.replace("public://", "/sites/unity.artofliving.org/files/styles/thumbnail/public/"); } %> <% count++; }); %> <% }else{ %>No courses found  <% } %>  <% _.each( rows, function( row ){ %> <% var programPath = row.register_url ?? row.field_register_url.value; var shopamine_url = row.shopamine_url ?? row.field_shopamine_url.value; if(row.sao_type == 1 && row.info_for_group_required == 1 && (row.max_tickets != 0 || row.max_tickets != 1)) { if(row.is_paid == true && row.register_url){ programPath = programPath; } else if(row.max_tickets > 1 && row.info_for_group_required == 1 && row.register_url){ programPath = programPath; }else{ programPath = shopamine_url; } } %>
 <% }); %>