laravel-fullcalendar
laravel-fullcalendar copied to clipboard
I want to show resources view in single day
I want to show Docter-A, Doctor-B, Doctor-B resource list in a single day.
'resources' => [
['id' => 'a', 'title' => 'Doctor A' ],
['id' => 'b', 'title' => 'Doctor B'],
['id' => 'c', 'title' => 'Doctor C']
],
Below my controller code how can i apply please help me.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($data->count()){
foreach ($data as $key => $value) {
$color="#ffb3b3";
if($value['status']==1){
$color=$calendar_setting_record_found_check['color_arrived'];
}elseif($value['status']==2){
$color=$calendar_setting_record_found_check['color_in_booked'];
}elseif($value['status']==3){
$color=$calendar_setting_record_found_check['color_in_dna'];
}elseif($value['status']==4){
$color=$calendar_setting_record_found_check['color_in_seen'];
}elseif($value['status']==5){
$color=$calendar_setting_record_found_check['color_in_process'];
}
$events[] = \Calendar::event(
$value->name .''. $value->surname,
false,
new \DateTime($value->start_date_time),
new \DateTime($value->end_date_time),
$value->appointment_id,
[
/* 'url' => url('manager/show-appointment-details', $value->appointment_id),/
'color' => $color,
//any other full-calendar supported parameters
]
);
}
}
$calendar = \Calendar::addEvents($events) //add an array with addEvents
->setOptions([
'defaultView' => 'agendaDays',
/'businessHours'=> [
'dow' => [2,3,4],
'start'=> '08:00',
'end' => '11:00',
],*/
'views' => [
'agendaDays' => [
'weekends'=>$weekend,
//'hiddenDays'=> [0,6],
'type' => 'agenda',
'allDaySlot'=>false,
'minTime'=> $calendar_setting_record_found_check['business_time_start'].":00",
'maxTime'=> $calendar_setting_record_found_check['business_time_end'].":00",
'slotDuration'=> "00:".$calendar_setting_record_found_check['time_slot_size'],
'duration' => [
'days'=> $id,
],
],
],
])->setCallbacks([
/*'eventMouseover' => 'function() {
alert("hi");
}',*/
'eventClick' => 'function(event, jsEvent, view){
var data = event.id;
$.ajax({
type : "GET",
url : "/manager/client-info",
data: {appointment_id:data},
success: function(data) {
console.log(data.appointment_id);
$("#modalpractionarname").html(data.practionar_name);
$("#modalTitle").html(data.name);
$("#modalEmail").html(data.email);
$("#modalPhone").html(data.phone_number);
$("#modalAppointmentDate").html(data.appointment_date);
$("#modalStartTime").html(data.start_time);
$("#modalEndTime").html(data.end_time);
$("#modalAppointmentId").val(data.appointment_id);
$("#modalCancelAppointmentId").val(data.appointment_id);
$("#AppointmentId").val(data.appointment_id);
$("#appointment_id_for_arrived_check").val(data.appointment_id);
$("#appointment_id_for_dna_check").val(data.appointment_id);
$("#appointment_id_for_seen_check").val(data.appointment_id);
$("#appointment_id_for_inprocess_check").val(data.appointment_id);
$("#clientId").val(data.client_id);
$("#calendarModal").modal();
$("#modaldefault").modal("hide");
$("#read").show();
$("#record-edit").hide();
},
error : function(data)
{
alert("error");
}
});
}'
]);
//dd($calendar);