This topic is locked

Show status with colors

8/14/2008 8:39:20 AM
PHPRunner General questions
G
gbhmayer1 author

I have a table "projects" with a read only field "project_status"(varchar) and "inicial_date" and "final_date (date fields). I would like to show, IN A LIST FORM, the field "project_status" with colors : for example

  • if (final_date - inicial_date) > 10 - project_status shows red box;
  • if (final_date - inicial_date) > 5 - project_status shows green box;
    I could to write a new view and project_status could show, for example, in html mode (??)

J
Jane 8/15/2008

Hi,
check following thread:

http://www.asprunner.com/forums/index.php?showtopic=6413
To compare two dates use following code:

//10246060 - 10 days

if (strtotime($data["final_date"])-strtotime($data["inicial_date"])>10246060)

...

G
gbhmayer1 author 8/15/2008

Problem solved, Thank you Jane