In this section of the tutorial you will build two pages: one that shows a list of all jobs posted by the currently logged in company, and one to provide details on a specific job offer, including the applicant list. These pages are located inside the company folder, and are named view_jobs and view_applicants.
The first page to be created is the one listing the job offers (expired or not) of the current company. If you've gone through the tutorial right, you might remember having already done such a page, but for the user section. During the creation of the companies' page for viewing job offers, references will be made to the user's job listing page.
To create the view_jobs page, follow the next steps:
Open the company/view_jobs page in Dreamweaver.
To retrieve the current's company list of job offers posted to the site, you must create a filtered recordset. Due to the fact that the company ID (not the user ID, but the one from the company table - generated in the company details page) is not available to the user, you will have to create an advanced recordset, implying a JOIN operation aside the filtering condition. The easiest way to achieve this is to use MX Query Builder. MX Query Builder has already been used during this tutorial for the Apply to job page.
Create a new recordset from the Bindings tab of the Application panel. Select the database connection to use, and click on the QuB3 button. This will open the Dreamweaver MX Query Builder user interface that allows creating a new query, or editing and deleting existing ones. Click the New query button, and enter a name (different from the existing saved queries) - e.g. rsJobs (it can be the same as the recordset name).
In the main MX Query Builder window, select the job_job and company_com tables.
If there is no relation defined between the two tables (if you have defined it in a past work session with MX Query Builder, it is saved), simply drag and drop the idcom_job column from the job_job table over the id_com column of the company_com table). A line will appear between the two tables, symbolizing the relation.
Select only the following columns to retrieve:id_job, idusr_com, the job title and type.
You will need to restrict the recordset to retrieve
only jobs posted by the currently logged in company. To do so, add a condition
for the foreign key to the user's table (idusr_com).
To do so, click on the ... button next to the column name in the Columns
area, and fill in the fields for the dialog box that opens as shown below:

Save the query and close the window by clicking on Query > Close. Back in Dreamweaver click the Refresh button next to the Query name drop-down menu, and after the query is displayed, click the OK button to add it to the page.
To display data retrieved by the recordset, use a dynamic table. You can apply the Dynamic Table command from the Application tab of the Insert bar (top of the screen, below the main menu). Configure it to display all records from the newly added recordset.
New you have to edit the dynamic table, in order to make it display only the data you need. Follow the instruction below to adapt the table to your particular needs:
First, remove the first two columns from the dynamic
table. These columns display the user ID and the company ID, which are
not used.

Add a new column at the end of the table, where
a link to the page displaying the applicant details will be. To add a
column, right-click in the last column, and from the pop-up menu select
Table > Insert rows or columns.

Select to add a new column, after the current
one. In the second row's last cell, enter the link's text (e.g. See more
details). To turn it into a link to the job detail and applicant list
page, select the text and right-click on it. From the pop-up menu select
the Make link option.

Make the link point to the view_applicants
page. In order for the detail page to display data relevant only for the
job whose detail link has been clicked, you must also pass it the job
ID, as an URL parameter. In the Link configuration window, click the Parameters
button to define URL parameters for the current link. Add a new one, with
the label id_job and the value of the job ID retrieved by the rsJobs
recordset.

Click the OK button to close the dialog box and create the link.
The last thing to do on the view_jobs page is
to replace the default table column titles from the dynamic table with
more appropriate text (e.g title_job with Job title, type_job with Job
type ). Then save the page and upload it to the server. If you log in
with a company account, and you have posted job offers from the respective
account, the list will be displayed properly.

The second page you must create in this tutorial section, is used to display a list of applicants for the selected job in the job listing page created before. The job to display details and applicants for is determined by its ID, which is passed as an URL parameter.
To build the page, follow the instructions below:





At this point you can see what people applied for which jobs. All that lacks is a way to call them up for an interview, but this is what you'll solve next. Add a new column at the end of the dynamic table. In the cell next to the dynamic text, enter the "Invite to interview" text.
Make this a link to the applicant_detail page, and also pass it an URL parameter containing the user id. To do so, in the Browse for page dialog box, select the applicant_detail page, and then click on the Parameters button. Enter the id_usr name, and select for the value the idusr_rsm field from the rsApplicants recordset.
The second URL parameter that needs to be passed
to the page is the job ID. While in the Parameters
dialog box, add another parameter, named id_job,
with the id_job field from the rsJob
recordset as value.
Note: For ASP users, enter the following code for the parameter
Value fields: id_user:
<%=(rsApplicants.Fields.Item("idusr_rsm").Value)%>
id_job: <%=(rsJob.Fields.Item("id_job").Value)%>

If you save the page, upload it to the server,
and log in with a company account, when you access the view applicants
area for a specific job ad, you'll see something like the following:

If no applicants are available, the table header or the Invite to Interview link do not have to show up. To hide them, you should use the Show If Recordset is Not Empty server behavior , as for the company job listing page's last step.
In the last section of the company page tutorial you will implement a view of all details: the job details, and the applicants detail, as well as adding the actual sending of the e-mail containing the invitation to an interview. The page you will create next is the one used in the Invite to interview link.