contact Class Reference

Class des envoi de mail vers un destinataire. More...

List of all members.

Public Member Functions

Static Protected Attributes


Detailed Description

Class des envoi de mail vers un destinataire.

envoi interne

LE formulaire utilisé doit être contenu dans le repertoire content ET tre nommé contact_(self::$suffixe)

Definition at line 17 of file page.contact.php.


Constructor & Destructor Documentation

contact::__construct (  ) 

Definition at line 25 of file page.contact.php.

00025                         {
00026       global $page;
00027       if (isset($_GET['products_id'])&& is_numeric($_GET['products_id'])) self::$suffixe='product';
00028       else self::$suffixe='us';
00029 
00030       $this->init();
00031     }


Member Function Documentation

contact::action (  ) 

exe action form

user connected, use detail user

Definition at line 67 of file page.contact.php.

00067                           {
00068     global $page;
00069 
00070 
00071     switch(self::$suffixe) {
00072       default:
00073         if (isset($_GET['action']) && ($_GET['action'] == 'send')) {
00074 
00075           $enquiry = tep_db_prepare_input($_POST['enquiry']);
00076           $data='';
00077 
00078             if (!tep_session_is_registered('customer_id')) {
00079               $name = tep_db_prepare_input($_POST['name']);
00080               $email_address = tep_db_prepare_input($_POST['email']);
00081 
00082               $enquiry = $name.' '.$email_address." <br><br> ".$enquiry;
00083 
00084               $data .='&user='.$name.'&user_email='.$email_address;
00085             }
00087             else {
00088               $cust=customer::getInstance();
00089               $user=$cust->the_customer($_SESSION['customer_id']);
00090               $user=new objectInfo($user);
00091               $name = $user->customers_lastname.' '.$user->customers_firstname;
00092               $email_address=$user->customers_email_address;
00093               $data .='&customers_id='.$user->customers_id;
00094             }
00095 
00096 
00097           if (tep_validate_email($email_address) && !empty($name) ) {
00098 
00099             $myarray = array(
00100                 'from'=>$name,
00101                 'from_email'=>$email_address,
00102                 'subject'=>EMAIL_SUBJECT,
00103                 'email_use_html'=>_cst_bool('EMAIL_USE_HTML'),
00104                 'message'=>$name.' '.$email_address.'<br />'.$enquiry,
00105             );
00106 
00107             notification::notif('contact_us',EMAIL_SUBJECT,$myarray,$data);
00108 
00109 
00110             tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));
00111           }
00112           elseif(empty($name) ) {
00113             $error = true;
00114 
00115             $page->messageStack->add('contact', ENTRY_NAME_CHECK_ERROR);
00116           }
00117           else {
00118             $error = true;
00119 
00120             $page->messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
00121           }
00122         }
00123     }
00124   }

contact::init (  ) 

Definition at line 34 of file page.contact.php.

Referenced by __construct().

00034                         {
00035 
00036     switch(self::$suffixe) {
00037       case 'product':
00038         $this->params_form='products_id='.$_GET['products_id'];
00039       break;
00040       default:
00041         $this->t_user['email']=STORE_OWNER_EMAIL_ADDRESS;
00042         $this->t_user['name']=STORE_OWNER;
00043 
00044         $this->params_form='';
00045     }
00046   }

contact::the_form (  ) 

call form , return suffixe

Definition at line 52 of file page.contact.php.

00052                             {
00053     return self::$suffixe;
00054   }

contact::the_params (  ) 

Retour du formulaire à chargée.

Definition at line 59 of file page.contact.php.

00059                               {
00060     return $this->params_form;
00061   }


Member Data Documentation

contact::$suffixe [static, protected]

Definition at line 23 of file page.contact.php.


The documentation for this class was generated from the following file: