Users search jobs
In this part of the tutorial, you will build some pages that will allow
users to search for jobs. There are two pages to be created, one containing
the form that establishes the search criteria, and one that displays the
results as a table, with links to each job's detail.
The fist page to be created is the form search page. Users should be
able to search for jobs matching a desired type, domain, location, some
keywords. Also, the user can enter a minimal value for the salary. There
is no need for a maximum, because everybody knows that the higher, the
better.
To create this page, follow the next steps:
- Open the search page from
the user folder in .
- To add the form that allows the user select the criteria
for the job ad search, you can use the Custom Form Wizard. It allows the
user to add fields that are associated to form elements. You can access
this wizard from the tab of
the . Configure it as shown
below.
- In the first step, you must select a database connection.
The wizard will not actually perform a SQL transaction , but the connection
is used for error handling purposes. You can leave the redirect page field
empty, as the generated form will point somewhere else anyway.

- In the second step you will have to specify the fields
to use with the custom transaction. This is important, as this is where
you define what fields and under what form will appear on page. To add
a field, you can click on the Plus (+) button of the Form fields grid,
and type its label in the dialog box that opens:

- After you add a field, you can configure its properties
through the Display as and Submit
as drop-down menus. The display as menu determines what form element
will be used in the page, while the submit as menu selects the type of
data to use. Configure the elements as follows:
· Add 5 elements
to the Form fields grid: , , ,
and .
· Set the
Job type field to be displayed as a menu. when you select this option
in the drop-down menu, two new buttons become available: Menu properties
and Add recordset . Click the Menu properties to define the elements that
will appear in the drop-down on the page: Full-time, Part-time and Project
based. Add these both as values and labels:

· The Job
domain and location will also use a menu to be displayed. But their values
will be retrieved from the database. After you choose the Menu option
in the Display as drop-down menu, two new buttons are available: Add recordset
and Menu Properties.
- For the job domain, select the Menu display as option,
and Add a recordset. Configure it as shown below:

- Close the recordset creation dialog box and hit the
button. Set the menu to
use values from the database, with the id_dom
column for values, and name_dom for labels.

- Do the same for the Job Location - recordset and
menu properties.

- Click
to close the wizard, and add the
form into the page:

·
The Job details field will actually contain the keywords after which search
will be conducted. change its label to reflect this.
· Now the
form and its elements are on the page. One thing that the Custom Form
Wizard does is leave the form action property empty, which is useful when
the data processing is done in the same page. However, the page that processes
the search criteria and displays the results is, in this case, another
file. To make the form post the data to the correct file, select it on
the page, and, in the Action field of the Property Inspector, enter the
path to the results file:

Next you will change the Minimum
salary field, for which you will use the Numeric Text Field server behavior.
This is done in order to ensure that only numeric input will be allowed.
Configure it to allow float values, and display the spin controls, for
easier manipulation:

Now the search form is completed, with all fields
necessary. You can preview the page in the browser, and it will display
all available data for the Job type, domain and location, allowing you
to select the desired values.

Once you are done with the search form page, you can move on and build
the page that actually performs the search operation, showing the user
only the matching results.
The search operation is actually only a fancier recordset, one that
selects only the data matching the criteria specified in the search form.
Thus, the first step when building the results page is (besides opening
it in , of course) to create
the results recordset.
To create this recordset, follow the next steps:
- Click on the (+)
button of the tab, and select from the pop-up menu.
- The recordset we're about to create is pretty complex,
and you cannot create it in the simple form of the dialog box. Click the
button to switch the dialog box interface.
- A window like the one below will appear. Configure
it as shown, then click New Query:

- Enter a name for the query in the prompt:

- Now the
window will open in a new window. If you're not already familiar with
the interface, you may want to give the QuB
Workspace orientation page a quick look.
- Check the table (job_job) to add it to the query
and the database area of QuB

- With the table now in the , you can select the necessary fields by checking the associated
checkbox. Select the following fields:
· id_job
· iddom_job
· idloc_job
· title_job
· type_job
· salary_job
· detail_job
- Now these fields will appear below in the panel. Here you will add conditions to five of the seven
fields by clicking the button under the
heading:

- Starting with the type_job
field, click the button. Configure
the interface as follows, using the appropriate form variable from the
search page:

- Repeat the previous step for the idloc_job,
type_job, and salary_job
fields using their appropriate form variable counterpart (Job_location,
Job_type, or Minimum_salary). With the salary_job field however,it would
be better to use the ">=" condition instead of "=".
- The last condition to add is the detail_job field
which needs to be configured a little differently since it is not numeric.
Click the button and configure
it as follows:

- With all the conditions added, save the query from
the menu:

- Close the MX Query Builder interface and go back
into Dreamweaver. The
window should still be open.
- Click the Refresh button next to the Query
name field in the
window.

- The SQL code will then appear in the
field of the interface. Click .
- To display the search results, add a dynamic table
to the page, configured on the rsResults
recordset, and displaying all records:

As all other dynamic tables you have used in this tutorial, you will
notice that all fields from the recordset are displayed, some having very
little significance for the user. As this is only the results page, you
should eliminate all job details, and instead create a link to the job
detail page, next to each result. First remove all columns, except the
title_job column. For this remaining column, change it's header (in the
first row's cell) to something more readable, like .
Next add a new column at the end of the table, in which you will store
the link to the job detail page. Type the title on the first row: . For the link text, type in . Select the text and, by using the button next to the link drop-down menu, select the job_detail page.
The job details page requires the job ID as parameter, and as such you
have to pass it one. Press the
button and add a new one, configured as follows:
- Set the name to id_job.
- Use the dynamic data icon next to the Value text-field,
to select the id_job field of the rsResults
recordset: For , use <%=(rsResults.Fields.Item("id_job").Value)%>
in the Value field.

Now the results page displays the job title, and
a link to list more job details:

With this last step, the user's job search pages are completed, and
you can save and upload them to the server. In order to try them out,
login with a user account, and go to the search page. Here enter some
criteria for the type, domain, location and salary, and eventually some
keywords, and when you click the search button, the results page will
open, with a link to more details, and the apply for jobs option:
First enter the search criteria:

Then click on search and see the results:

Congratulations for the successful search pages.
Using a similar approach you can create a search form that allows companies
search for job applicants based on their defined preferred domain, location
and minimum salary.