PHP: Create html table with optional checkbox and link