I currently have a booking system which allows users to view, edit, and delete records. The system currently allows users to delete records at any time. However as it is a booking system, so users should only be able to delete records 48 hours prior to the booking date and it should restrict users from deleting records within 24 hours of the booking date. Is there some sort of function that I will need to include?

This is my current code for deleting records:

bookings.php 

```
   echo "<td><a href = 'delete.php?id=".$row['booking_id']."' onclick='return          

   confirmation()'> Remove </td>"; 

      <script type="text/javascript">

        function confirmation()

  {

        if (confirm("Are you sure you want to cancel booking")){
             location.href='delete.php';

           }

           else {

            return false;

           }
         } 

```

```
     Delete.php 

          $id = $_GET['id'];

             $query1="DELETE from bookings1 where booking_id='$id'";

                  $results = $mysqli->query($query1);

```