01hanstu Posted August 2, 2012 Share Posted August 2, 2012 Hi, We currently have a booking system where people can book single resources, however we now need to develop the system further and I would just like your opinion on this and if there are tutorials, examples I can look at to tailor my system. I want the database to have a figure i.e. 30 and the use clicks book and the system asks how many they want to book and it deducts it from the number so if the user books 10 cameras it leaves 20 in the database for another user to book the remainder. I hope this makes sence and someone is able to guide me. Regards, Stuart Quote Link to comment https://forums.phpfreaks.com/topic/266587-phpmysql-inventory-system/ Share on other sites More sharing options...
peipst9lker Posted August 2, 2012 Share Posted August 2, 2012 Table resources: id, name, amount Table bookings: id, resource_id, amount_booked, booking_date, etc. Example: You have a resource with id 1, name is Camera XY, amount is 30. Someone already created a booking of resource_id = 1 and amount_booked = 10. Execute a query which sums up amount_booked from table bookings where resource_id = 1 and you're done Quote Link to comment https://forums.phpfreaks.com/topic/266587-phpmysql-inventory-system/#findComment-1366236 Share on other sites More sharing options...
Barand Posted August 2, 2012 Share Posted August 2, 2012 I'd go for an individual record for each bookable item. If 30 booked out and 29 returned you then know exactly which one (serial number, spec etc) Quote Link to comment https://forums.phpfreaks.com/topic/266587-phpmysql-inventory-system/#findComment-1366256 Share on other sites More sharing options...
peipst9lker Posted August 2, 2012 Share Posted August 2, 2012 I'd go for an individual record for each bookable item. If 30 booked out and 29 returned you then know exactly which one (serial number, spec etc) I totally agree on that, provides a much better control. Quote Link to comment https://forums.phpfreaks.com/topic/266587-phpmysql-inventory-system/#findComment-1366258 Share on other sites More sharing options...
01hanstu Posted August 2, 2012 Author Share Posted August 2, 2012 Hi, Thank you both for your replies, much appreciated. It has certainly given me a point in the right direction, and I may be able to actually start this, this year (Was demoted to receptionist today ). At the minute all of the kit is asset tagged, and we ask staff to fill in the form when they take the kit. I want to develop it so that the admins/technicians can check the kit and mark it back in the system as being returned OK and that sort of thing. I will start the front end first though. Thanks again, Stuart Quote Link to comment https://forums.phpfreaks.com/topic/266587-phpmysql-inventory-system/#findComment-1366385 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.