notification Class Reference

cette class est a cheval entre front et backoffice. More...

List of all members.

Static Public Member Functions

Public Attributes

Static Protected Member Functions

  • static loadConf ($key)
    load conf key
  • static methode ($subjet, $myarray='', $data, $message_final='')

Static Protected Attributes


Detailed Description

cette class est a cheval entre front et backoffice.

UTilise les class des admins

Definition at line 17 of file notification.php.


Member Function Documentation

static notification::loadConf ( key  )  [static, protected]

load conf key

Parameters:
key string

Definition at line 37 of file notification.php.

Referenced by notif(), and notifInMess().

00037                                           {
00038     $DB=Database::getInstance();
00039     $r=$DB->query("select * from ".self::TABLE." where chknotif_key='".(string)$key."' " );
00040 
00041     self::$conf=$r->fetchAllAssoc();
00042   }

static notification::methode ( subjet,
myarray = '',
data,
message_final = '' 
) [static, protected]

Definition at line 53 of file notification.php.

Referenced by notif(), and notifInMess().

00053                                                                                 {
00054     global $language;
00055 
00056     $DB=Database::getInstance();
00057 
00058     if(empty($message_final)) $message_final=tep_post_prepare_email(self::$key.'.tpl',$language,$myarray);
00059 
00060     foreach(self::$conf as $item){
00061       switch($item['chknotif_method']) {
00062         case 'sql' :
00063 
00064           $DB->query($sql="INSERT INTO  ".self::ADMIN_TABLE_NOTIF." (notif_id,notif_type,user_id,notif_key,notif_data,notif_text, notif_date) VALUES ('',0,'".(int)$item['chknotif_user']."', '".self::$key."','".tep_db_input($data)."','".tep_db_input($message_final['html'])."' ,now() )  " );
00065 
00066         break;
00067 
00068         case 'email':
00069         default:
00070           $r=$DB->query("select admin_firstname as firstname, admin_lastname as lastname, admin_email_address as email from ".TABLE_ADMIN." where admin_id='".(int)$item['chknotif_user']."' " );
00071 
00072           $admin=$r->fetchAssoc();
00073           tep_mail($admin['firstname'].'  '.$admin['lastname'], $admin['email'], $subjet, $message_final, STORE_OWNER, EMAIL_FROM);
00074       }
00075     }
00076   }

static notification::notif ( key,
subjet,
myarray,
data 
) [static]

public call notif notification::notif($key,$subjet,$myarray,$data)

Parameters:
$key string
$subjet string
$myarray array
$data string GET

Definition at line 86 of file notification.php.

Referenced by contact::action().

00086                                                            {
00087     self::$key=$key;
00088 
00089     self::loadConf($key);
00090 
00091 
00092     if(function_exists('tep_get_ip_address'))$data .='&ip='.tep_get_ip_address();
00093 
00094     self::methode($subjet,$myarray,$data);
00095   }

static notification::notifInMess ( key,
subjet,
message_final,
data 
) [static]

public call notif and pass direct message notification::notif($key,$subjet,$myarray,$data)

Parameters:
$key string
$subjet string
$message_final string
$data string GET

Definition at line 105 of file notification.php.

Referenced by checkout_process::email_confirm_order().

00105                                                                        {
00106     self::$key=$key;
00107 
00108     self::loadConf($key);
00109 
00110     if(function_exists('tep_get_ip_address'))$data .='&ip='.tep_get_ip_address();
00111 
00112     self::methode($subjet,'',$data, array('html'=>(is_array($message_final) ? $message_final['html']: $message_final)));
00113   }


Member Data Documentation

notification::$conf [static, protected]

Definition at line 26 of file notification.php.

notification::$key [static, protected]

Definition at line 31 of file notification.php.

Referenced by loadConf(), notif(), and notifInMess().

Definition at line 19 of file notification.php.


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