Zeus web server - Chapter 15: E-campaign System 521 Creating a Campaign
Chapter 15: E-campaign System 521 Creating a Campaign class The purpose of this class is to provide the Campaign object, which is needed to manipulate the campaign. An implementation of this class can be found in ch15/ apps/class/class.EcampaignCampaign.php file in the CDROM. This class implements the methods discussed in the following sections. EcampaignCampaign() This method sets the member variable, ecampaign_tbl, to the $ECAMPAIGN_TBL configuration variable. The member variable, dbi, is set to $dbi, which is passed from the application. This method also sets the current campaign ID using the setCampaignID() method. setCampaignID() This method sets the current campaign ID to the campaign ID supplied. If no campaign ID is supplied as a parameter, the current campaign ID is returned. getCampaignInfo() This method returns campaign information about a given campaign or the current campaign. getAvailableCampaigns() This method returns the list of campaigns from the e-campaign database. The returned associative array is keyed with the campaign ID (CAMPAIGN_ID), and the values are set to campaign name (NAME). addCampaign() This method adds a campaign in the e-campaign database. deleteCampaign() This method deletes a campaign from the e-campaign database. modifyCampaign() This method updates a campaign in the e-campaign database. Creating a URL Tracking class The purpose of this class is to provide the URL Track object, which is needed to manipulate the URL track information. An implementation of this class can be found in ch15/apps/class/class.EcampaignTrack.php file in the CDROM. This class implements the methods discussed in the following sections.