<?php
header("Access-Control-Allow-Origin: *");
header('Content-type:application/json');
mysql_connect('localhost','root','') or die(mysql_error());
mysql_select_db('pmothesis');
$select = mysql_query("SELECT * FROM venue_reservations join venue on venue.venue_code = venue_reservations.venue_code join office on office.office_id = venue_reservations.office_id where status != 'Finished'");
$rows = array();
while ($row = mysql_fetch_array($select))
{
$rows[] = array('id'=>$row['venue_reservation_id'],
'title'=>$row['venue_name'],
'start'=>$row['date_time_start'],
'end'=>$row['date_time_end'],
'description'=>"Purpose: ".$row['purpose'].
' <br> Venue reservation id: ' .$row['venue_reservation_id'].
' <br> Event type: ' .$row['event_type'].
' <br> Number of persons: ' .$row['number_of_persons'].
' <br> Office name: ' .$row['office_name'].
' <br> <br> Status: <font style="color: red;"> ' .$row['status']. ' </font>'
);
}
echo json_encode($rows);
?>
That is my JSON file. I want to change the event color of my fullcalendar. I have certain conditions related to reservation approval. For example, if it's already approved, the event will change into color blue from red which is pending. Your answers are highly appreciated. Thank you :)