Hi dev anubhav,
yes this possible to change appointment color according their status
1 go to in your plugin.
2. select menu-page folder.
3. open calendar.php file
search comment line //Loading Appointments On Calendar Start
or replace old code with new code from line number 36 to 83
global $wpdb;
$AppointmentTableName = $wpdb->prefix.”ap_appointments”;
$FetchAllApps_sql = “select id
, name
, start_time
, end_time
, date
,status
FROM $AppointmentTableName
“;
$AllAppointments = $wpdb->get_results($FetchAllApps_sql, OBJECT);
if($AllAppointments) {
foreach($AllAppointments as $single) {
$title = $single->name;
if( $single->status == ‘approved’)
{
$appointment_color = “#FFFF00”;
} else if( $single->status == ‘pending’)
{
$appointment_color = “#FFA500”;
}
else if( $single->status == ‘cancelled’)
{
$appointment_color = “#FF0000”;
}
else if( $single->status == ‘done’)
{
$appointment_color = “#008000”;
}
$start = date(“H, i”, strtotime($single->start_time));
$end= date(“H, i”, strtotime($single->end_time));
// subtract 1 from month digit coz calendar work on month 0-11
$y = date ( ‘Y’ , strtotime( $single->date ) );
$m = date ( ‘n’ , strtotime( $single->date ) ) – 1;
$d = date ( ‘d’ , strtotime( $single->date ) );
$date = “$y-$m-$d”;
$date = str_replace(“-“,”, “, $date);
$url = “?page=update-appointment&updateid=”.$single->id.”&&from=calendar”; ?>
{
title: “<?php _e(‘Booked By’, ‘appointzilla’); echo ‘: ‘; echo $title; ?>”,
start: new Date(<?php echo “$date, $start”; ?>),
end: new Date(<?php echo “$date, $end”; ?>),
url: “<?php echo $url; ?>”,
allDay: false,
backgroundColor : “<?php echo $appointment_color; ?>”,
textColor: “black”,
},<?php
}
}
it will work for you further any query let me know
Thanks
Abhishek