Well, that is simple enough. But, be warned… You will have to create a list of all areas you deliver to. This would have to contain all of your area down to the smallest details. Perhaps even notes on which door is used. This master database table would be large. First, a good map of the area you will deliver to. Next a database to hold customer info including the locations. Next a second table with just the locations and a yes/no field allowing delivery or not. I will give you my thoughts on it. (Sorry a lot to cover…)
First, in most food delivery systems that I know about (Have worked for a pizza delivery shop), everything is based on either phone-number or full-name. So, pick some thing to use as your index. Next create a database that has all of your info need. Create a table in it called Clients or Customers, something similar. This would include the data you mentioned:
Name, PhoneNumber, address-county, address-town, address-area, address-street, address-number
Each of these items would be a separate field in the table. Whenever a new customer calls or stops in, you would fill out the above info on the system and check if it is an area you deliver to. To verify they are in a deliverable area would involve another table. This table would have similar fields. These depend on how you layout your delivery area. Let’s say you delivery to all of one county. You would have these fields:
address-county, address-town, address-area, address-street, address-number, AllowDeliveryToHere
This would involve a bit of code to check for. Put “yes” or “no” into the last field. First, if you deliver to all areas of one county, you could use a wildcard such as “" and put it into all of the fields for that county. When checking to see if the new customer’s address is okay for delivery, you check each field. If it contains the wildcard char, then move to the next field. Basically, you match each entry starting with the largest, the county. If the county is not a deliverable one, it would contain a “NO” and the routine would stop and indicate NO-DELIVERY-TO-THIS-ADDRESS. (Do not bother checking the small parts if this happens.) If you only deliver to one certain street in that county, you would have to put ‘yes’ in the county, town, are and some other code in the address-street to indicate the ‘this street only’. That would be "” in everything, in address-street, you would have all the street names and all except the one street would have “NO” in the AllowDeliveryTo field. As you develop your database you can always add a field if needed, but, then you have to go back and enter data for all your previously created locations, so it is very important to lay out the tables before creating the code. Another idea is a general layout on paper before creating the tables. Right down a few areas you deliver to, put them in a list sorted out with the fields we have been talking about and see how they would be listed in the table. Or start with an EXCEL spreadsheet with the few dozen sample deliveries and see how they would fit into your new tables. Once the delivery areas tables have been created, then you can work on the code to fill them and use them.
Whew! A tricky subject. Here in the States, it is easier as you can usually use zipcode or local phone number area codes. Hmmm, what is your phone system like? Does every delivery area have a phone? Perhaps that might be a way to go.
Lots for you to think about. Hope I didn’t make it more confusing for you… Good luck…