In this last section concerning the company pages, you will create a page that will allow the future employers consult all details regarding the job and a certain applicant, and also send an e-mail with the date and time for an interview. The data required for this page is retrieved from several tables:
The job details from the job_job, location_loc, company_com, and domain_dom tables.
The job and applicant reference are passed to the page through the id_job and id_usr URL parameters, as mentioned in the previous topic. Based on these, you will have to add three different filtered recordsets into the page.
To build the page, follow the next steps:
You have already created a recordset that extracts
the job details in the Apply to job
page. The good news is that you don't need to create it again. You will
reuse the query rsDetails from the MX
Query Builder Repository. Simply define a new recordset in Dreamweaver
from the Bindings panel, then click the QuB3
button. In the QuB Visual Recordset interface, you can select any of the
previously created queries in the Query name
menu.

After you select the query, the corresponding SQL code will load in the SQL text area. Click OK to save your recordset. You can now use the recordset fields in your page – just drag each one from the Bindings panel into your page.
The second recordset you must create will retrieve
details about the applicant. In the new recordset dialog box, the table
to use is resume_rsm:

Click the QuB3 button, and create a new query
in the QuB Visual Recordset interface, as explained previously. In the
displayed MX Query Builder web interface, you need to:
·
Display the resume_rsm, location_loc and domain_dom tables from the Table
panel:

·
Join the location_loc and resume_rsm tables.
·
Join the domain_dom and resume_rsm tables.
·
Select the columns you need in your recordset.
The database diagram should look like this:

·
Define a condition on the idusr_rsm field: it should be equal to the URL
parameter id_usr.
![]()
Save your query, close the MX Query Builder web interface and return to Dreamweaver. In the QuB Visual Recordset interface click the Refresh button, to load the generated SQL code, then click OK.
The third and last recordset retrieves the user's
e-mail, and will be used when implementing the send e-mail server behavior,
to know to which address to send the mail. The table to use for this recordset
is user_usr:

Now you have to display the data retrieved by the recordsets into the
page. for the job details, type the titles for some of the database
fields, as the job title, type and the job details. Then drag & drop
the fields from the rsJobdetails recordset
into the page, next to their corresponding titles:

Below the job details, you have to add the applicant details. This must be a more comprehensive list of fields, as it will be used by the company to decide whether to invite him to an interview or not. Also, you can display the applicant's photo, as well as a link to download the resume.
Type "Job Applicant" on a new line below the job details.
Create a table with 7 rows and 2 columns, where you will display the
applicants details:

In the first column, type the labels (each on a new row):
Name
Phone
Preferred domain
Preferred location
Preferred salary
Photo
Download resume.
In the second column, you have to drag & drop the corresponding fields from the Bindings panel, the rsUserDetails recordset. Do not place the last two fields, as they will be inserted through some server behaviors, which will allow you to display the applicant photo, and to implement the download of the dynamic file.
Now, the page should look as follows in Dreamweaver Design View:

Next, click in the cell next to the Photo label, and apply the Show image server behavior. You can access this server behavior from the Server Behaviors tab, MX Kollection -> File Upload -> Show image.
Configure the options in the dialog box that opens as follows:

Now the applicant's photo is displayed on the page and in order to complete the table, you only need to add the resume download link. Click in the last row's second cell, and apply the Download file server behavior. You can find it in Server Behaviors -> MX Kollection -> File Upload -> Download File.
Configure the user interface that opens in the following manner:
In the File Folder text-box enter the site folder where the resume files are stored. You can use the Browse... button to select it from the site's local root.
In the Recordset drop-down menu, select the rsUserDetails recordset again, as it contains the applicant data.
In the Recordset column
drop-down menu, select the field that contains the names of the files
to download.

When done configuring the server behavior, click the OK button to apply it to the page.
Now the applicant detail table is complete and all that remains is to
add the mail sending capability. So far, the page looks like the following
(in Dreamweaver):

In the mail invitation to an interview, the company has to send the date and time, as the company's location is publicly available on the job-site, on the job details page. Also, you need to send the mail only when the company representative presses a button, and not in an automatic manner. The third thing is that after the e-mail has been sent, the company's index page must be opened.
The answer to all these problems is the use of a custom transaction. You can add form fields in an easy manner, the execution does not start until the submit button has been pressed, and it is a requirement for the use of triggers (as the send e-mail trigger for example).
The Custom transaction comes as a wizard and a server behavior, but for our purpose, the wizard is more suited, as it generates the HTML form elements, as well as the actual transaction. Open the Custom Form Wizard from the MX Kollection tab of the Insert panel, or from the Server Behaviors tab menu, MX Kollection -> Forms.
Configure each step as shown below:
In the wizard's first step, enter the database
connection that you use for the site, as well as the file which will be
opened after the execution - e.g. the company's index page:

In the second step of the wizard, you can add
form fields, and define how will they be represented in the page, and
on submit. To add a field, click on the Plus (+)
button of the Form fields grid, and enter
its label. Afterwards, you can change its Submit
and Display type with the help of the drop-down
menus. Add two field, with the labels Date
and Time. Leave them as simple text-fields,
and finish the wizard, as there is no SQL to enter in step 3:

Now the two text fields have been added into the page, as well as a
submit button. Rename the button to "Invite
to interview", by changing its label in the Property
Inspector:

Before adding the send e-mail trigger, there is another usability problem
to consider: why manually enter the date in the text-field, when you can
use a calendar to select it, as done for the
job posting page. Replace the text field with the DatePicker
control, by applying the DatePicker server
behavior. You do not need to configure any special options, except maybe
for the skin you wish to use:

Now you're down to the very end of this page's creation: all that remains is to add the Send E-mail trigger. Click on the Plus (+) button of the Server Behaviors tab, and select MX Kollection -> Send E-mail -> Send E-mail. This will open the mail trigger dialog box. Configure it as follows:

Now your page is complete, and it looks similar to the image below,
when viewed in Dreamweaver:

You can save it and upload it to the server. If you want to see it in
action, log in with a company account, and browse the existing jobs. For
one that has applicants, click the Invite to interview button to see the
advanced details, decide on a date and time, and then send him an e-mail
by simply pressing the button:

This was the last section of the tutorial that addressed the company pages in the job site. At this point, you can use the application, with its basic features to allow applicants and companies post jobs, list available jobs, and apply to jobs.
The next sections of the tutorial add improvements, making the application easier to use and feature rich.