$(document).ready(function() { $('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: '' }, height: 'auto', allDaySlot: false, defaultView: 'month', defaultDate: '2024-05-05', validRange: function(nowDate) { return { //start: nowDate.clone().add(-1, 'days'), start: nowDate, end: nowDate.clone().add(89, 'days') }; }, //hiddenDays: [ ], //scrollTime: "{class_start_time}", //minTime: "{class_start_time}", //maxTime: "{class_end_time}", locale: 'ja', buttonIcons: false, // show the prev/next text weekNumbers: false, navLinks: false, // can click day/week names to navigate views editable: false, //businessHours: { // start: "{class_start_time}", // a start time (10am in this example) // end: "{class_end_time}", // an end time (6pm in this example) //}, eventLimit: true, // allow "more" link when too many events events: { url: 'get_yoyaku_data.php', error: function() { $('#script-warning').show(); } }, eventClick: function(event) { if (event.url) { $.ajax({ type: "GET", url: event.url, }).success(function(data, dataType) { if (data.url !== undefined) { // successのブロック内は、Ajax通信が成功した場合に呼び出される var tmp_form = $('
', {'action': data.url, 'method': 'post'}); tmp_form.append($('', {'type': 'hidden', 'name': 'mode', 'value': data.mode})); tmp_form.append($('', {'type': 'hidden', 'name': 'product_id', 'value': data.product_id})); tmp_form.append($('', {'type': 'hidden', 'name': 'product_class_id', 'value': data.product_class_id})); tmp_form.append($('', {'type': 'hidden', 'name': 'quantity', 'value': data.quantity})); tmp_form.append($('', {'type': 'hidden', 'name': 'stay', 'value': data.stay})); tmp_form.appendTo(parent.document.body); tmp_form.submit(); } else { alert(data.errmsg); } }).error(function(XMLHttpRequest, textStatus, errorThrown) { // 通常はここでtextStatusやerrorThrownの値を見て処理を切り分けるか、単純に通信に失敗した際の処理を記述します。 // this; // thisは他のコールバック関数同様にAJAX通信時のオプションを示します。 // エラーメッセージの表示 alert('Error : ' + errorThrown); }); //window.parent.location.href = event.url; return false; } } }); });