×

- Calificaciones y experiencia
- comentarios
Reserve una cita
Este doctor no tiene cita con CitaDoc
Reservar un doctor
Click to request an appointment time.
"; //}); $.each($.parseJSON(result), function (idx, obj) { var formattedDate = new Date(obj.DATE); var formattedDateMoment = moment(formattedDate, "YYYY-MM-DD"); var monthString = moment(formattedDateMoment, "YYYY-MM-DD HH:mm Z").format("MMM"); var paddedDate = ""; if (formattedDate.getDate().toString().length < 2) paddedDate = "0" + formattedDate.getDate().toString(); else paddedDate = formattedDate.getDate().toString(); if (21 == 21 && "es" == "ar") { var NewDateString = moment(formattedDate, "YYYY-MM-DD HH:mm Z").format("DD/MM/YYYY"); //weekDaysHtml += "
"; weekDaysHtml += "
"; } else { weekDaysHtml += "
"; // weekDaysHtml += "
"; } }); if (new Date($.parseJSON(result)[0].DATE).setHours(0, 0, 0, 0) == new Date().setHours(0, 0, 0, 0) && locationID!=null && locationID!=undefined && locationID!="" & locationID!='') { $("#app_previousWeekHref_" + locationID).addClass("disabled"); $("#app_previousWeekHref_" + locationID).css('color', '#dbdbdb'); } $("#app_weekDaysDiv_" + locationID).html(weekDaysHtml); } } function app_popultateTSResultList11(result, weekDays, locationID) { var AppointReqValLabel = $("#AppointmentRequestLabelVal").val(); var MoreBtnValLabel = $("#MoreButtonTimeLabel").val(); var NoAvail = $("#NoAvailableLocation").val(); nextAvailability = $("#hdnNextAvailLabel").val(); if (result != null) { var flag = 0; var splittedResult = result.split("|"); var tsStrToParse = ""; var tsDoctorIDs = ""; if (splittedResult != null && splittedResult.length > 1) { tsStrToParse = splittedResult[0]; tsDoctorIDs = splittedResult[1]; } var parsedobj = $.parseJSON(tsStrToParse); if (tsDoctorIDs != "") { var splittedDoctorIDs = tsDoctorIDs.split(","); if (splittedDoctorIDs != null && splittedDoctorIDs.length > 0) { for (var idxDocIDs = 0; idxDocIDs < splittedDoctorIDs.length; idxDocIDs++) //Doctor loop { var doctorID = parseInt(splittedDoctorIDs[idxDocIDs]); var filteredObj = app_getObjects(parsedobj, 'DoctorID', doctorID); var htmlToRender = ""; var noDirectBooking = 0; var noAvailability = 0; var unAvailableSlots = app_getObjects(filteredObj, 'Available', "No"); if (unAvailableSlots != null && unAvailableSlots.length > 0 && filteredObj != null && filteredObj.length > 0) { if (unAvailableSlots.length == filteredObj.length) noAvailability = 1; } if (filteredObj != null && filteredObj.length > 0) { if (filteredObj[0].BookingTypeID != null && filteredObj[0].BookingTypeID == 0) // Sets next availability { var formattedDate = moment(filteredObj[0].WeekDate, "YYYY-MM-DD"); var dateString = moment(formattedDate, "YYYY-MM-DD HH:mm Z").format("DD/MM/YYYY"); var nextavailableDateParam = moment(formattedDate, "YYYY-MM-DD HH:mm Z").format("YYYY-MM-DD"); // var availableDateTime = filteredObj[0].WeekDay.substring(0, 3) + ", " + moment(formattedDate, "YYYY-MM-DD HH:mm Z").format("MMM") + " " + moment(formattedDate, "YYYY-MM-DD HH:mm Z").format("DD"); var availableDateTime = ""; if (21 == 21 && "es" == "ar") availableDateTime = getArabicDay(filteredObj[0].DayID) + ", " + dateString; else availableDateTime = filteredObj[0].WeekDay.substring(0, 3) + ", " + moment(formattedDate, "YYYY-MM-DD HH:mm Z").format("MMM") + " " + moment(formattedDate, "YYYY-MM-DD HH:mm Z").format("DD"); //var availableDateTime = filteredObj[0].WeekDay + " " + dateString + " " + filteredObj[0].StartTime; //htmlToRender += "
" + NoAvail + "
" + nextAvailability; //htmlToRender += ": " + availableDateTime + " "; //htmlToRender += "
"; htmlToRender += "
" + nextAvailability + ": " + availableDateTime + " "; htmlToRender += "
"; var tsDivID = "#app_tsdiv_" + locationID; $(tsDivID).html(htmlToRender); } else { for (var weekDayIdx = 0; weekDayIdx < weekDays.length; weekDayIdx++) //Day loop { //edited by juby var columnDivID = "app_columnDiv_" + weekDays[weekDayIdx].toString() + "_" + locationID; var moreSpanID = "app_moreSpn_" + weekDays[weekDayIdx].toString() + "_" + locationID; var arFlag = 0; var moreBtnFlag = 0; htmlToRender += "
- "; var filteredByDay = app_getObjects(filteredObj, 'DayID', weekDays[weekDayIdx]); if (filteredByDay != null && filteredByDay.length > 0) { if (noAvailability == 1) { var aTagVale = ""; aTagVale = doctorID.toString() + "," + filteredByDay[0].WeekDate.trim().substr(0, 10) + " " + "00"; var locationid = locationID; htmlToRender += ""; //htmlToRender = "
"; //htmlToRender += ""; //htmlToRender += "
"; break; } if (filteredByDay[0].BookingTypeID != null && filteredByDay[0].BookingTypeID != "" && filteredByDay[0].BookingTypeID == "2") { var aTagVale = ""; var locationid = locationID; //aTagVale = filteredByDay[0].WeekDate.trim().substr(0, 10) + " " + "00"; aTagVale = doctorID.toString() + "," + filteredByDay[0].WeekDate.trim().substr(0, 10) + " " + "00"; htmlToRender += ""; //htmlToRender += ""; //htmlToRender += "" + MoreBtnValLabel + ""; arFlag = 1; moreBtnFlag = 1; } // else { for (var idx = 0; idx < filteredByDay.length; idx++) { var paddedTime = ""; if (filteredByDay[idx].StartTime != null && filteredByDay[idx].StartTime != "" && filteredByDay[idx].BookingTypeID == "1") { if (21 == 21 && "es" == "ar"){ if (filteredByDay[idx].StartTime.trim().length == 6) paddedTime = "0" + filteredByDay[idx].StartTime.trim().toString().replace("AM", "ص").replace("PM", "م"); else paddedTime = filteredByDay[idx].StartTime.trim().toString().replace("AM", "ص").replace("PM", "م"); } else{ if (filteredByDay[idx].StartTime.trim().length == 6) paddedTime = "0" + filteredByDay[idx].StartTime.trim(); else paddedTime = filteredByDay[idx].StartTime.trim(); } var spanID = "app_timeSpn_" + idx.toString() + "_" + weekDays[weekDayIdx].toString() + "_" + doctorID.toString(); var aTagVal = ""; if (filteredByDay[idx].StartTime != null && filteredByDay[idx].StartTime != "" && filteredByDay[idx].WeekDate != null && filteredByDay[idx].WeekDate != "") aTagVal = locationID.toString() + "," + doctorID.toString() + "," + filteredByDay[idx].WeekDate.trim().substr(0, 10) + " " + filteredByDay[idx].StartTime.trim(); if (idx < 7 && arFlag == 0) { if (filteredByDay[idx].Available != null && filteredByDay[idx].Available != "" && filteredByDay[idx].Available == "Yes") htmlToRender += "" + paddedTime + ""; else htmlToRender += "-"; } else { if (arFlag == 1 && idx < 6) { if (filteredByDay[idx].Available != null && filteredByDay[idx].Available != "" && filteredByDay[idx].Available == "Yes") htmlToRender += "" + paddedTime + ""; else htmlToRender += "-"; } else{ if (filteredByDay[idx].Available != null && filteredByDay[idx].Available != "" && filteredByDay[idx].Available == "Yes") htmlToRender += ""; else htmlToRender += ""; } } } if (arFlag == 0) { if (filteredByDay[idx].BookingTypeID != null && filteredByDay[idx].BookingTypeID != "" && filteredByDay[idx].BookingTypeID == "2") { if (idx < 7) { var aTagVale = ""; aTagVale = locationID.toString() + "," + doctorID.toString() + "," + filteredByDay[idx].WeekDate.trim().substr(0, 10) + " " + "00"; //htmlToRender += ""; htmlToRender += ""; } else { // htmlToRender += "" + MoreBtnValLabel + ""; moreBtnFlag = 1; var aTagVale = ""; aTagVale = locationID.toString() + "," + doctorID.toString() + "," + filteredByDay[idx].WeekDate.trim().substr(0, 10) + " " + "00"; //htmlToRender += ""; htmlToRender += ""; } arFlag = 1; } } } //if (idx > 7 && moreBtnFlag == 0)// && filteredByDay[0].BookingTypeID != null && filteredByDay[0].BookingTypeID != "" && filteredByDay[0].BookingTypeID == "2") // htmlToRender += "" + MoreBtnValLabel + ""; // } } htmlToRender += "
"; } htmlToRender += "
" + MoreBtnValLabel + "
"; var tsDivID = "#app_tsdiv_" + locationID; $(tsDivID).html(htmlToRender); $(tsDivID).addClass('avail-slot'); $(tsDivID).parent().addClass('avail-slot'); } } else { htmlToRender += "
" + NoAvail + "
"; var tsDivID = "#app_tsdiv_" + locationID; $(tsDivID).html(htmlToRender); $(tsDivID).removeClass('avail-slot'); $(tsDivID).parent().removeClass('avail-slot'); //htmlToRender += "
No Data Found
"; //var tsDivID = "#app_tsdiv_" + splittedDoctorIDs[idxDocIDs]; //$(tsDivID).html(htmlToRender); } } } } } } function app_lessButtonClick(locationID) { if (locationID != null && locationID != "") { var MoreBtnValLabel = $("#MoreButtonTimeLabel").val()+''; $(".appointmentSlotScroll").mCustomScrollbar("scrollTo", $("#app_tsdiv_"+locationID).closest(".appointment-hospital").position().top, { timeout:0, scrollInertia:200, }); for (var weekDayIdx = 1; weekDayIdx <= 7; weekDayIdx++) //Day loop { var moreButtonID = "#app_moreSpn_" + weekDayIdx.toString() + "_" + locationID; var columnDivID = "#app_columnDiv_" + weekDayIdx.toString() + "_" + locationID; $(moreButtonID).html(MoreBtnValLabel); $(moreButtonID).attr("onclick","javascript:app_moreButtonClick('"+ locationID+"')"); // $(moreButtonID).css('display', 'none'); $(columnDivID + " span[id^=app_timeSpn_]").each(function () { if($(this).attr('style') == 'display: block;'){ $(this).css('display', 'none'); } }); } //app_setHeight(id); } } function app_moreButtonClick(locationID) { if (locationID != null && locationID != "") { var lessLabel = "COLLAPSE"+''; $(".appointmentSlotScroll").mCustomScrollbar("scrollTo", $("#app_tsdiv_"+locationID).closest(".appointment-hospital").position().top, { timeout:0, scrollInertia:200, }); for (var weekDayIdx = 1; weekDayIdx <= 7; weekDayIdx++) //Day loop { var moreButtonID = "#app_moreSpn_" + weekDayIdx.toString() + "_" + locationID; var columnDivID = "#app_columnDiv_" + weekDayIdx.toString() + "_" + locationID; $(moreButtonID).html(lessLabel); $(moreButtonID).attr("onclick","javascript:app_lessButtonClick('"+ locationID+"')"); // $(moreButtonID).css('display', 'none'); $(columnDivID + " span[id^=app_timeSpn_]").each(function () { if($(this).is(':hidden')){ $(this).css('display', 'block'); } }); index = 8; $(columnDivID + " button").each(function () { if (index > 7) $(this).css('display', 'block'); index++; }); } //app_setHeight(id); } } function app_previousWeekClick11(CurLocation) { //var CurLocation = getLocationID(); $.ajax({ url: "/Appointment/MoveToPreviousWeek", type: 'GET', cache: false, data: { LocationId: CurLocation, currDate: getClientDate(), timezone: -1 * new Date().getTimezoneOffset() } }).done(function (result) { if (result != null) { app_performDateChange11(result, CurLocation); } }); } function app_nextWeekClick11(CurLocation) { //var CurLocation = getLocationID(); $.ajax({ url: "/Appointment/MoveToNextWeek", type: 'GET', cache: false, data: { LocationId: CurLocation, currDate: getClientDate(), timezone: -1 * new Date().getTimezoneOffset() } }).done(function (result) { if (result != null) { app_performDateChange11(result, CurLocation); } }); } function app_performDateChange11(result, locationID) { var splittedResultForDisable = result.split("#"); var splittedResult = splittedResultForDisable[0].split("|"); if (splittedResult != null && splittedResult.length > 1) { var tsStrToPopulate = splittedResult[0] + "|" + splittedResult[1]; if (splittedResult.length > 2 && splittedResult[2] != null) app_populateWeekDays11(splittedResult[2], locationID); if (splittedResult.length > 3 && splittedResult[3] != null) app_setMonthAndDate(splittedResult[3]); var filteredDay = $.parseJSON(splittedResult[2]).map(function (obj) { return obj.ID; }); app_popultateTSResultList11(tsStrToPopulate, filteredDay, locationID); } if (splittedResultForDisable.length > 1 && splittedResultForDisable[1] != null && splittedResultForDisable[1] == "disable_prev_week") { $("#app_previousWeekHref_"+locationID).addClass("disabled"); $("#app_previousWeekHref_"+locationID).css('color', '#dbdbdb'); } else if (splittedResultForDisable.length > 1 && splittedResultForDisable[1] != null && splittedResultForDisable[1] == "enable_prev_week") { $("#app_previousWeekHref_"+locationID).removeClass("disabled"); $("#app_previousWeekHref_"+locationID).css('color', '#4c4c4c'); } if (splittedResultForDisable.length > 1 && splittedResultForDisable[1] != null && splittedResultForDisable[1] == "disable_prev_month") { $("#app_previousMonthHref").addClass("disabled"); $("#app_previousMonthHref").css('color', '#f9f7f7'); } else if (splittedResultForDisable.length > 1 && splittedResultForDisable[1] != null && splittedResultForDisable[1] == "enable_prev_month") { $("#app_previousMonthHref").removeClass("disabled"); $("#app_previousMonthHref").css('color', '#b7b7b8'); } if (splittedResultForDisable.length > 1 && splittedResultForDisable[1] != null && splittedResultForDisable[1] == "disable_prev_all") { $("#app_previousWeekHref_"+locationID).addClass("disabled"); $("#app_previousWeekHref_"+locationID).css('color', '#dbdbdb'); $("#app_previousMonthHref").addClass("disabled"); $("#app_previousMonthHref").css('color', '#f9f7f7'); } else if (splittedResultForDisable.length > 1 && splittedResultForDisable[1] != null && splittedResultForDisable[1] == "enable_prev_all") { $("#app_previousMonthHref").removeClass("disabled"); $("#app_previousMonthHref").css('color', '#b7b7b8'); $("#app_previousWeekHref_"+locationID).removeClass("disabled"); $("#app_previousWeekHref_"+locationID).css('color', '#4c4c4c'); } } var isFormSubmit = false; function LoginPopup(Typeid) { if (Typeid == 1) { window.location.href = '/Account/PatientLogin'; } else if (Typeid == 2) { window.location.href = '/Account/DoctorLogin'; } } function nextAvailabilityWeek(nextavailabilitydate, CurLocation, event) { var obj = $(event.target).parents(".search-listing").find("[id^=locationDiv] option:selected"); var id = $(event.target).parents(".search-listing").find("[id^=locationDiv] option:selected").attr("id"); if (nextavailabilitydate != null && nextavailabilitydate != "") { $.ajax({ url: "/Appointment/MoveToNexAvailableWeek", type: 'GET', cache: false, async: false, data: { availDate: nextavailabilitydate, LocationId: CurLocation, currDate: getClientDate(), timezone: -1 * new Date().getTimezoneOffset() } }).done(function (result) { if (result != null) { app_performDateChange11(result, CurLocation); //var arr = $(obj).val().split('_'); //var locationid = arr[0]; doctorid = arr[1]; //$("#SrHospName_" + doctorid).html('').html($(obj).text().split("-")[0]); //$("#locadr_" + doctorid).html('').html(arr[2]); //if (doctorid != null && doctorid != "" && locationid != null && locationid != "") { // var anchorID = "#location_" + locationid.toString() + "_" + doctorid.toString(); // var divID = "#locationDiv_" + doctorid.toString(); // getTimeSlotForLocation(doctorid, locationid); // $(divID + ' a[id^=location_]').removeClass('active'); // $(anchorID).addClass('active'); //} //app_popultateTSResultList11(result,CurLocation); } }); } }