In order for a company to be able to post job ads, it must be identified with certain details (like the name and address). Since these fields are not stored in the general user table, it becomes mandatory to fill in these details after registering and logging in for the first time. To access the com_details page, there is a link on the company main page.
To create this page follow the next steps:
Open the company/com_details page in Dreamweaver.
Apply the Insert Record Form Wizard.
In the first step, configure it to use your databaseA database refers to data organized and stored on a computer that can be searched and retrieved by a computer program. Most industrial-strength and many smaller database applications can be addressed using SQL (Structured Query Language). connection and the company_com table. For the redirectThe redirect server behavior loads a new site page after a transaction is executed. For instance, users could be automatically redirected to their inbox after they log in to the website. setting, browse to the company/index page.
In the second step, set the fields to be used in the transactionA transaction is a group of SQL statements whose effects are logically connected. Anything from simple queries to inserting, and deleting operations can be considered a transaction, as well as more complex groups of several statements which accomplish a specific task.:
name_com - this will store the company's name. Leave its settings at their default.
address_com - this will store the company's address. Use a text-area as element, because addresses tend to take up more space.
idusr_com - this stores the user ID, as created when the company registered. This ID is already available to the page, because when the company logs in, the kt_login_idsessionA session is a way to preserve certain data across subsequent accesses of the same web application. The session object contains many variables to store user information on the web server in a location that you choose in special files. The session support allows you to register arbitrary numbers of variables to be preserved across requests. Sessions are specific to individual users. As a result, every user has a separate session and has access to a separate set of Session variables. variable stores it. To pass the session variable into the table column, through the insert transaction in a safe way, set it to be displayed as text (it will be displayed in the form, but not editable - you will delete it later on), and for the Default Value setting, use the InterAKT Dynamic Data to select the variable source and reference.
When the default values have been set, and the rest of the options are configured (display element, submit type), the user interface should look similar to:
Now you can click on the Finish button to add the form into the page. In Dreamweaver, remove the first row displaying the user ID, as it should not be visible.
To make sure the company only visits this page once, right after registering, you can make it the page that registration redirects to. To do this, you will have to edit the Insert Transaction on the company/register page.
Open the company/register page in the browser
Double-click the Insert transaction in the Server Behaviors tab of the Application panel
In the After inserting, go to text field, click the Browse button, and select the company/com_details page.
Click on OK to close the dialog box, and save the page. Upload it to the server and close it.
When a new company registers to the site, and finishes entering the main account data, a login form will be displayed, asking for the newly defined credentials. Once the company logs in correctly, the company details form is displayed, asking for the official name and address:
As improvement, you should build on your own a page that allows updating company details, and which can be accessed from the company's main page. To build it, use the Update Record Wizard, and select the company to update based on the session stored user ID (or an URL parameter -your choice).
In the next section of the tutorial, you will build an essential page for the companies: the means to post the job offers.