Buy it now not working

If an item is bought using buy it now, then when the page is revisited,
it doesn't display auction closed. This is in the bid.php file. I
commented where the error is