29 ini_set(
"session.gc_maxlifetime", 36000);
34 $sSelect =
"select oxpricealarm.oxid, oxpricealarm.oxemail, oxpricealarm.oxartid, oxpricealarm.oxprice from oxpricealarm, oxarticles where oxarticles.oxid = oxpricealarm.oxartid and oxpricealarm.oxsended = '0000-00-00 00:00:00'";
36 $rs = $oDB->SelectLimit( $sSelect,
$myConfig->getConfigParam(
'iCntofMails' ), $iStart);
38 $rs = $oDB->Execute( $sSelect);
43 if ($rs !=
false && $rs->recordCount() > 0) {
45 $oArticle =
oxNew(
"oxarticle" );
46 $oArticle->load($rs->fields[
'oxid']);
47 if ($oArticle->getPrice()->getBruttoPrice() <= $rs->fields[
'oxprice']) {
48 $this->
sendeMail( $rs->fields[
'oxemail'], $rs->fields[
'oxartid'], $rs->fields[
'oxid'], $rs->fields[
'oxprice']);
54 if ( !isset( $iStart)) {
57 $iAllCnt = $iAllCntTmp;
62 $iStart +=
$myConfig->getConfigParam(
'iCntofMails' );
64 $this->_aViewData[
"iStart"] = $iStart;
65 $this->_aViewData[
"iAllCnt"] = $iAllCnt;
69 if ( $iStart < $iAllCnt)
70 $sPage =
"pricealarm_send.tpl";
72 $sPage =
"pricealarm_done.tpl";
99 public function sendeMail( $sEMail, $sProductID, $sPricealarmID, $sBidPrice )
102 $oAlarm =
oxNew(
"oxpricealarm" );
103 $oAlarm->load( $sPricealarmID );
106 $iLang = (int) $oAlarm->oxpricealarm__oxlang->value;
108 $iOldLangId = $oLang->getTplLanguage();
109 $oLang->setTplLanguage( $iLang );
111 $oEmail =
oxNew(
'oxemail' );
112 $blSuccess = (int) $oEmail->sendPricealarmToCustomer( $sEMail, $oAlarm );
114 $oLang->setTplLanguage( $iOldLangId );
117 $oAlarm->oxpricealarm__oxsended =
new oxField( date(
"Y-m-d H:i:s" ) );