HomePHP Creating a Searchable Inventory System: Setting Up Your Database and User Interface (continued)
Creating a Searchable Inventory System: Setting Up Your Database and User Interface (continued)
In this second part of an article about setting up a searchable inventory system, we will cover our helper Search class, and some of the things this class will need to be able to do.
In part one of this article we discussed setting up the basic elements required for our searchable inventory system: the backend database structure, the HTML and CSS code necessary to create our visual layout, and a helper Javascript function “attach_file” which we will be taking a closer look at later.
So far, so good. Now that our overall program design has been created, we’re ready to start narrowing things down and we will start by thinking about our helper Search class. There is a variety of things this class will need to do, but for part two of this article we are only concerned with displaying a proper set of search form fields.
We will need a function within our Search class to display appropriate form field objects for each of the items by which we wish to search. Let’s call this function “get_search_field”, and as a parameter let’s pass it the name of the field for which we wish to create an input field.