Booking System with MySQL Database


Added on  2019-09-26

5 Pages1729 Words211 Views
PHPmain body start Your task for this practical assignment consists of three parts:1Develop a web-based system using HTML, PHP, and MySQL that provides the functionality stated in the Requirements sectionbelow.2Make the system that you have created accessible and usable via the URL http://cgi.csc.liv.ac.uk/~<your user name>/books.php taking care that the access rights for the file are neither too restrictive nor too permissive. Making the system usable includes setting up the corresponding database on the departmental MySQL server and filling it with the appropriate data.RequirementsA local gym has asked you to develop a web-based system that allows members of the gym to book its fitness classes. To keep the system simple, we assume that the gym members do not have accounts with thesystem but instead enter a few personal details whenever they book a class. They also only book a class one week ahead. Each class is typically offered more than once during a week. Every time a class is runit can only accommodate a certain number of participants, in the following we will call this the capacity of the class or the number of places on the class. We keep the range and capacity of classes small.In more detail, we assume that the gym offers the following classes at the indicated times and all with the indicated capacity independent of thetime at which the class is offered:ClassTimesCapacityBoot CampMonday, 9:00; Tuesday, 9:00; Wednesday, 9:002BoxerciseThursday, 10:00; Friday, 10:004PilatesMonday, 11:00; Wednesday, 11:00; Friday, 11:003YogaTuesday, 13:00; Wednesday, 13:002ZumbaFriday, 14:002That is, in total there are 5 different classes, offered between once and three times a week, and each with a capacity for only two to four participants every time the class runs.
Booking System with MySQL Database_1

The web-based system should allow a gym member1select a class via a drop-down/pop-up list or selection menu;2select a date and time at which that particular class is offered via a separate drop-down/pop-up list or selection menu;3enter their name via a text field;4enter their phone/mobile number via another text field (in case the class is cancelled at short notice and gym members need to be notified);5after selecting/entering the data above, submit a booking request by pressing a `Submit' button.Ideally, the user of the system is able to enter all this data via a single web page (not a sequence of two or more pages). However, a sequenceof web page can be used if this is the only way that you are able to realise this system.Also, ideally, the menus are populated with data from the database.On submission of a booking request, the user should be shown a confirmation whether the booking request has been successful or unsuccessful.The system should ensure that what the user enters as a name satisfies the following constraints: A name only consist of letters (a-z and A-Z), hyphens, apostrophes and spaces; contains no sequence of two or more of the characters hyphen and apostrophe; and starts with a letter. If these constraints are satisfied, then we call the name valid. If these constraints are notsatisfied, then the system should display an error message and thebooking request must be unsuccessful.The system should ensure that what the user enters as a phone or mobile number satisfies the following constraints: A phone or mobile number only consists of digits and spaces; contains either nine or ten digits; and starts with the digit 0. If these constraints aresatisfied, then we call the phone number valid. If these constraints are not satisfied, then the system should display an error messageand the booking request must be unsuccessful.If name and phone number are valid, then a booking request must be successful if for the selected class at the selected date and time still has at least one place left. On success, the number of places on the selected class at the selected date and time is reduced by one and a record will be kept in the database of the booking, including the class, date and time, name and phone number.A booking request must be unsuccessful if there are no places left on the selected class at the selected date and time.Underlying the system must be a MySQL database. Initially, the database must contain information on the classes, the dates and times
Booking System with MySQL Database_2

End of preview

Want to access all the pages? Upload your documents or become a member.