Jump to content

Bug in PHP app


whatabrother

Recommended Posts

Hey,

 

I have been working on a PHP system to manage a booking system for my families Cabin.  The cabin is used weekly by different people.  My (2) uncles built the cabin, and share it with their 6 other siblings.  The problem is that there is often conflict with who is using the cabin and when so My uncle asked me if I could write this application.  The app is very close to completion with the exception of one bug.  The user chooses a year and a month, then the script shows all the available days in that month.  The user chooses a starting day to book, and enters a number of days to use the cabin.  The bug lies in the section of the program that handles a situation where a stay at the cabin sits over two different months ie. March 30 for 10 days.  The program attempts to handle the issue on line 153-162 in the pastebin below.  Specifically, the program seems to be satisfying the conditions on line 183 and 192 when it shouldn't.  These conditions should only get satisfied if the user tries to book a day that has already been booked.  If a user books a date near the end of the month, the rest of that month gets booked, but as soon as the first day of the next month comes the conditions mentioned above get satisfied even if the day is open in the database.  I've dedicated hours to this bug now and still can't figure it out.  Maybe somebody can help me find it?

 

Here is the pastebin

 

http://pastebin.com/m349cf608

Link to comment
https://forums.phpfreaks.com/topic/127311-bug-in-php-app/
Share on other sites

I was editing in notepad2.  I usually use linux, but I built this at my uncles office so all I had was windows.  Anyways the font is weird in notepad 2 for variables.  An uppercase and a lowercase x look very much the same.  It wasn't until I put the code in a pastebin that I noticed the issue.  It's funny how that works.

Link to comment
https://forums.phpfreaks.com/topic/127311-bug-in-php-app/#findComment-658800
Share on other sites

I was editing in notepad2.  I usually use linux, but I built this at my uncles office so all I had was windows.  Anyways the font is weird in notepad 2 for variables.  An uppercase and a lowercase x look very much the same.  It wasn't until I put the code in a pastebin that I noticed the issue.  It's funny how that works.

 

Wow.  :P

Link to comment
https://forums.phpfreaks.com/topic/127311-bug-in-php-app/#findComment-658860
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.