Sort by date using a date picker to sort/filter data from MySQL table...?

Hi,
using the following code to display content of a table.


        echo "<table class=\\"styled-table\\">";
        echo "<tr> <th>ID</th> <th>Company Name</th> <th>Delivery Address</th> <th>Order Date</th> <th>Delivery Date</th>  <th>Status</th> <th>Checked</th> <th>Loaded by</th> <th>Pallets</th> <th>Extra Blocks</th> <th>Extra Pallets</th> <th>Total Pallets</th> <th></th> <th></th></tr>";

        // loop through results of database query, displaying them in the table
        while($row = mysql_fetch_array( $result )) {

                // echo out the contents of each row into a table
                echo "<tr>";
                echo '<td>' . $row['id'] . '</td>';
                echo '<td>' . $row['company_name'] . '</td>';
                echo '<td>' . $row['delivery_address'] . '</td>';
				echo '<td>' . $row['order_date'] . '</td>';
				echo '<td>' . $row['delivery_date'] . '</td>';
				echo '<td>' . $row['status'] . '</td>';
				echo '<td>' . $row['hb_checked'] . '</td>';
				echo '<td>' . $row['loaded_by'] . '</td>';
				echo '<td>' . $row['pallets'] . '</td>';
				echo '<td>' . $row['extra_blocks'] . '</td>';
				echo '<td>' . $row['extra_pallets'] . '</td>';
				echo '<td>' . $row['total_pallets'] . '</td>';
                echo '<td><a href="edit-order.php?id=' . $row['id'] . '" class="button">Edit</a></td>';
                echo '<td><a href="delete-order.php?id=' . $row['id'] . '" class="button">Delete</a></td>';
                echo "</tr>";
        }

        // close table>
        echo "</table>";

How can I have a button, a date picker to sort/filter these records by date?

thanks