if ( _subscriberIsSubscribed($customer["Email"]) ) { db_query( "update ".MAILING_LIST_TABLE. " set customerID=".(int)$customerID. " where Email='".xToText($customer["Email"])."'" ); } else db_query( "insert into ".MAILING_LIST_TABLE. " ( Email, customerID ) ". " values( '".xToText($customer["Email"])."', ".(int)$customerID." ) " ); } } function subscrUnsubscribeSubscriberByCustomerId( $customerID ) { db_query( "delete from ".MAILING_LIST_TABLE." where customerID=".(int)$customerID); db_query( "update ".CUSTOMERS_TABLE." set subscribed4news=0 where customerID=".(int)$customerID ); } function subscrUnsubscribeSubscriberByEmail( $email ) { $email = base64_decode($email); db_query( "update ".CUSTOMERS_TABLE." set subscribed4news=0 where Email='".xToText($email)."'" ); db_query( "delete from ".MAILING_LIST_TABLE." where Email='".xToText($email)."'" ); } function subscrUnsubscribeSubscriberByEmail2( $email ) { db_query( "update ".CUSTOMERS_TABLE." set subscribed4news=0 where Email='".xToText($email)."'" ); db_query( "delete from ".MAILING_LIST_TABLE." where Email='".xToText($email)."'" ); } function SendNewsMessage( $title, $message ) { $q = db_query( "select Email from ".MAILING_LIST_TABLE ); while( $subscriber = db_fetch_row($q) ) xMailHtml($subscriber["Email"], $title, $message); } ?>