sin mas les cuento, estoy usando el week calendar de jquery esto lo uso con php, javascript, ajax y mysql, pero estoy atorado en una parte de mi desarrollo, resulta que guardo mis datos bien con la funcion get de ajax y necesito traer los datos de el mysql pero no me resulta.... aqui les dejo el codigo aver si me pueden alludar
esta es mi agenda.js la que me guarda los datos etc...
Código:
$(document).ready(function() { function objetus(file) {xmlhttp=false;this.AjaxFailedAlert = "Su navegador no oporta las funcionalidades de este sitio .\n"; this.requestFile = file;this.encodeURIString = true; this.execute = false; if (window.XMLHttpRequest) {this.xmlhttp = new XMLHttpRequest(); if (this.xmlhttp.overrideMimeType) {this.xmlhttp.overrideMimeType('text/xml');}} else if (window.ActiveXObject) {try {this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");}catch (e) { try {this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");} catch (e) {this.xmlhttp = null;}} if (!this.xmlhttp && typeof XMLHttpRequest!='undefined') {this.xmlhttp = new XMLHttpRequest(); if (!this.xmlhttp){this.failed = true; } } } return this.xmlhttp ;} var $calendar = $('#calendar'); var ajax = new objetus('guardar.php'); var id = 1; $calendar.weekCalendar({ timeslotsPerHour : 2, allowCalEventOverlap : true, overlapEventsSeparate: true, firstDayOfWeek : 1, businessHours :{start: 8, end: 22, limitDisplay: true }, daysToShow : 7, height : function($calendar) { return $(window).height() - $("h1").outerHeight() - 1; }, eventRender : function(calEvent, $event) { if (calEvent.end.getTime() < new Date().getTime()) { $event.css("backgroundColor", "#aaa"); $event.find(".wc-time").css({ "backgroundColor" : "#999", "border" : "1px solid #888" }); } }, draggable : function(calEvent, $event) { return calEvent.readOnly != true; }, resizable : function(calEvent, $event) { return calEvent.readOnly != true; }, eventNew : function(calEvent, $event) { var $dialogContent = $("#event_edit_container"); resetForm($dialogContent); var startField = $dialogContent.find("select[name='start']").val(calEvent.start); var endField = $dialogContent.find("select[name='end']").val(calEvent.end); var titleField = $dialogContent.find("input[name='title']"); var bodyField = $dialogContent.find("textarea[name='body']"); var profesionalField = $dialogContent.find("select[name='profesional']"); $dialogContent.dialog({ modal: true, title: "Nueva Hora", close: function() { $dialogContent.dialog("destroy"); $dialogContent.hide(); $('#calendar').weekCalendar("removeUnsavedEvents"); }, buttons: { "Guardar" : function() { calEvent.id = id; id++; calEvent.start = new Date(startField.val()); calEvent.end = new Date(endField.val()); calEvent.profesional = profesionalField.val(); calEvent.title = titleField.val(); calEvent.body = bodyField.val(); ajax.open("GET","guardar.php?paciente="+titleField.val()+"&cuerpo="+bodyField.val()+"&profesional="+profesionalField.val()+"&fecha_inicio="+startField.val()+"&fecha_final="+endField.val()+"&tipo=ingreso&id="+calEvent.id,true); ajax.send(''); $calendar.weekCalendar("removeUnsavedEvents"); $calendar.weekCalendar("updateEvent", calEvent); $dialogContent.dialog("close"); }, "Cancelar" : function() { $dialogContent.dialog("close"); } } }).show(); $dialogContent.find(".date_holder").text($calendar.weekCalendar("formatDate", calEvent.start)); setupStartAndEndTimeFields(startField, endField, calEvent, $calendar.weekCalendar("getTimeslotTimes", calEvent.start)); }, eventDrop : function(calEvent, $event) { ajax.open("GET","guardar.php?fecha_inicio="+calEvent.start+"&fecha_final="+calEvent.end+"&tipo=actualizar_mover&id="+calEvent.id,true); ajax.send(''); }, eventResize : function(calEvent, $event) { ajax.open("GET","guardar.php?fecha_inicio="+calEvent.start+"&fecha_final="+calEvent.end+"&tipo=actualizar_flechas&id="+calEvent.id,true); ajax.send(''); }, eventClick : function(calEvent, $event) { if (calEvent.readOnly) { return; } var $dialogContent = $("#event_edit_container"); resetForm($dialogContent); var startField = $dialogContent.find("select[name='start']").val(calEvent.start); var endField = $dialogContent.find("select[name='end']").val(calEvent.end); var titleField = $dialogContent.find("input[name='title']").val(calEvent.title); var bodyField = $dialogContent.find("textarea[name='body']"); bodyField.val(calEvent.body); var profesionalField = $dialogContent.find("select[name='profesional']").val(calEvent.profesional); $dialogContent.dialog({ modal: true, title: "Editar - " + calEvent.title, close: function() { $dialogContent.dialog("destroy"); $dialogContent.hide(); $('#calendar').weekCalendar("removeUnsavedEvents"); }, buttons: { "Guardar" : function() { calEvent.start = new Date(startField.val()); calEvent.end = new Date(endField.val()); calEvent.title = titleField.val(); calEvent.body = bodyField.val(); calEvent.profesional = profesionalField.val(); ajax.open("GET","guardar.php?paciente="+titleField.val()+"&cuerpo="+bodyField.val()+"&profesional="+profesionalField.val()+"&fecha_inicio="+startField.val()+"&fecha_final="+endField.val()+"&tipo=actualizar&id="+calEvent.id,true); ajax.send(''); $calendar.weekCalendar("updateEvent", calEvent); $dialogContent.dialog("close"); }, "Borrar" : function() { if (confirm("Desea Borrar La Hora?")) { ajax.open("GET","guardar.php?tipo=borrar&id="+calEvent.id,true); ajax.send(''); $calendar.weekCalendar("removeEvent", calEvent.id); $dialogContent.dialog("close"); } }, "Cancelar" : function() { $dialogContent.dialog("close"); } } }).show(); var startField = $dialogContent.find("select[name='start']").val(calEvent.start); var endField = $dialogContent.find("select[name='end']").val(calEvent.end); $dialogContent.find(".date_holder").text($calendar.weekCalendar("formatDate", calEvent.start)); setupStartAndEndTimeFields(startField, endField, calEvent, $calendar.weekCalendar("getTimeslotTimes", calEvent.start)); $(window).resize().resize(); }, eventMouseover : function(calEvent, $event) { }, eventMouseout : function(calEvent, $event) { }, noEvents : function() { }, data : function(start, end, callback) { callback(getEventData()); } }); function resetForm($dialogContent) { $dialogContent.find("input").val(""); $dialogContent.find("textarea").val(""); } function getEventData() { var year = new Date().getFullYear(); var month = new Date().getMonth(); var day = new Date().getDate(); return { events : [ { 'id':20000, 'start': new Date(1990, month, day, 14), 'end': new Date(1990, month, day, 15, 30), 'title':'0', 'body': ' prueba', 'profesional': 'Dr. Diesel' } ] }; } function setupStartAndEndTimeFields($startTimeField, $endTimeField, calEvent, timeslotTimes) { for (var i = 0; i < timeslotTimes.length; i++) { var startTime = timeslotTimes[i].start; var endTime = timeslotTimes[i].end; var startSelected = ""; if (startTime.getTime() === calEvent.start.getTime()) { startSelected = "selected=\"selected\""; } var endSelected = ""; if (endTime.getTime() === calEvent.end.getTime()) { endSelected = "selected=\"selected\""; } $startTimeField.append("<option value=\"" + startTime + "\" " + startSelected + ">" + timeslotTimes[i].startFormatted + "</option>"); $endTimeField.append("<option value=\"" + endTime + "\" " + endSelected + ">" + timeslotTimes[i].endFormatted + "</option>"); } $endTimeOptions = $endTimeField.find("option"); $startTimeField.trigger("change"); } var $endTimeField = $("select[name='end']"); var $endTimeOptions = $endTimeField.find("option"); $("select[name='start']").change(function() { var startTime = $(this).find(":selected").val(); var currentEndTime = $endTimeField.find("option:selected").val(); $endTimeField.html( $endTimeOptions.filter(function() { return startTime < $(this).val(); }) ); var endTimeSelected = false; $endTimeField.find("option").each(function() { if ($(this).val() === currentEndTime) { $(this).attr("selected", "selected"); endTimeSelected = true; return false; } }); if (!endTimeSelected) { $endTimeField.find("option:eq(1)").attr("selected", "selected"); } }); var $about = $("#about"); $("#about_button").click(function() { $about.dialog({ title: "About this calendar demo", width: 600, close: function() { $about.dialog("destroy"); $about.hide(); }, buttons: { close : function() { $about.dialog("close"); } } }).show(); }); });
alguna alluda de ante mano gracias adios!