function remove_loaner($loaner_id)
 {
     $l = new Loaner($loaner_id, null, null, null);
     if ($l->check_in($this->id)) {
         for ($i = 0; $i < sizeof($this->loaners); $i++) {
             if ($this->loaners[$i] == $loaner_id) {
                 unset($this->loaners[$i]);
                 update_dbBookings($this);
                 return true;
             }
         }
     }
     return false;
 }
/**
 * 
 * checks the arrival date of the current booking and updates the 
 * flag in the database to "past arrival date" if this is the case
 * @param Booking $b
 */
function check_arrival_date($b)
{
    //corrects an incorrectly set "past arrival date" flag
    if ($b->get_flag() == "past arrival date") {
        if ($b->get_date_in() > date("y-m-d") || $b->get_date_in() == "Will Call") {
            $b->set_flag('viewed');
            update_dbBookings($b);
        }
    } elseif ($b->get_date_in() != "Will Call") {
        if ($b->get_date_in() < date("y-m-d")) {
            $b->set_flag("past arrival date");
            update_dbBookings($b);
        }
    }
}