I am creating a wedding checklist website. For my checklist I want to enable the user to change the colour of the todo item to red, amber and green, red for not done, amber for
in db
status
with a value of 1 or 2 numbers ( it'll be the id of a status)status
with a status_id
, status_title
,status_color
, color_id
, enabled
in your code :
in your div , get the color of the task by getting the stored id
$colorOfTheTask = "SELECT color_id FROM status,task WHERE task.status = status.id ";
Like that you'll be able to manage your colours easier. You can still use a if statement like this :