Sex offenders web site - 318 Part II: Developing Intranet Solutions The

318 Part II: Developing Intranet Solutions The storeMail() method of the Contact class is used to store the e-mail information that includes the contact ID, CC address, subject of the mail, and mail send time. The PHP s mail API is used to send the e-mail with appropriate headers. The user receives a confirmation after the e-mail is sent successfully. . showMail(): This method displays e-mail information of a previously sent e-mail. This is how it works: A mail content template (CONTACT_MAIL_DETAIL_TEMPLATE) is loaded in a template object called $template. The template contains different blocks for date, mail to, mail CC to, mail subject, mail body, and so forth. These blocks are set with appropriate values retrieved using the getMailDetails() method of the Contact class. The template is parsed and printed to the user. . showDetail(): This method shows detailed information of the given contact. This is how it works: It checks whether the contact ID has been provided. If not, it shows an alert message and returns to previous page. A contact detail template (CONTACT_DETAILS_TEMPLATE) is loaded in a template object called $template. A new contact object is created and stored in $contactObj. The getKeywords() method of the Contact object is used to retrieve the keywords for the given contact and all keywords are stored into an array named $keywordArr. The values of $keywordArr are taken into a string after separating them with commas. This string is set into appropriate blocks in the template later. Reminders for the contact are also retrieved and set in the template. All the attribute values of the CONTACT_INFO table are retrieved using the getColumnValue() method of the Contact object, and are rendered in the template file. The sent e-mails are retrieved using getMails(). Sent e-mails are shown only to users having admin privilege. For non administrative users, this mail block is set to null to hide it from her. showContents() is called to show the output of this template in the preferred theme template of the user.

Leave a Reply